diff --git a/ng6-seed/package-lock.json b/ng6-seed/package-lock.json index acab22cae..656543677 100644 --- a/ng6-seed/package-lock.json +++ b/ng6-seed/package-lock.json @@ -950,6 +950,11 @@ "resolved": "https://registry.npmjs.org/angular-draggable-droppable/-/angular-draggable-droppable-2.0.0.tgz", "integrity": "sha512-/b8LIGamjOKnDI2uG1jRUErTIHeQ3w2WqHn4cbeiUTy+6eNHjkQI32DNhvxl0nVxr2gF5QluECNB4uWjMMyzQg==" }, + "angular-notifier": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/angular-notifier/-/angular-notifier-4.1.1.tgz", + "integrity": "sha512-QrL5cW3GDjONy6Ack+HIgd3tUf93ztkPT6C551/pqOaE69Ad2YDem+JyBLnlLKBnCFUxhKkSVnv/Ak2HsOrBxQ==" + }, "angular-resizable-element": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/angular-resizable-element/-/angular-resizable-element-2.0.0.tgz", @@ -7203,6 +7208,11 @@ "resolved": "https://registry.npmjs.org/ng2-file-upload/-/ng2-file-upload-1.2.1.tgz", "integrity": "sha1-VWPF39b0P7++gVwgbjQ0ZKCmoZc=" }, + "ng2-toastr": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/ng2-toastr/-/ng2-toastr-4.1.2.tgz", + "integrity": "sha1-G0UvBxOZYcOPhmxuJKBiR++iGxE=" + }, "ng2-validation": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/ng2-validation/-/ng2-validation-4.2.0.tgz", diff --git a/ng6-seed/src/app/template/questions/add/add.component.html b/ng6-seed/src/app/template/questions/add/add.component.html index f9dc06f56..c088d4150 100644 --- a/ng6-seed/src/app/template/questions/add/add.component.html +++ b/ng6-seed/src/app/template/questions/add/add.component.html @@ -1,154 +1,77 @@
-<<<<<<< HEAD - -
-

{{pageTitle}}

-
-
- -
-
-
- -
- - - {{ ct.categroy_name }} - - You must Select Category. - -
-
- - - You must Include Question. - -
-
- - - You must Include Description. - -
-
- - - {{ ans.answer_type_name }} - - You must Select Answer Type. - -
-
-
-
-
-
-
- - - - - -
-
- - - -
-
-
+ +
+

{{pageTitle}}

+
+
+
- -
-
- - -
- - - {{ ct.categroy_name }} - - You must Select Category. - -
-
- - - You must Include Question. - -
-
- - - You must Include Description. - -
-
- - - {{ ans.answer_type_name }} - - You must Select Answer Type. - -
-
-
-
-
-
-
- - - - - -
-
- - - + + +
+ + + {{ ct.categroy_name }} + + You must Select Category. + +
+
+ + + You must Include Question. + +
+
+ + + You must Include Description. + +
+
+ + + {{ ans.answer_type_name }} + + You must Select Answer Type. + +
+
+
+
+
+
+
+ + + + + +
+
+ + + +
+ +
- -
-
- - -<<<<<<< HEAD -
- - -
- - - -======= -
- - -
- - - ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe -
\ No newline at end of file + + +
+ + +
+ + + +
\ No newline at end of file diff --git a/ng6-seed/src/app/template/questions/add/add.component.ts b/ng6-seed/src/app/template/questions/add/add.component.ts index d904ca310..c8824cd9e 100644 --- a/ng6-seed/src/app/template/questions/add/add.component.ts +++ b/ng6-seed/src/app/template/questions/add/add.component.ts @@ -12,11 +12,8 @@ import { FormArray, } from '@angular/forms'; -<<<<<<< HEAD -======= import { NotifierService } from 'angular-notifier'; ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe import { MatDialog, MatDialogRef, @@ -26,38 +23,24 @@ import { import { MastersService } from './../../service/masters/masters.service'; import { QuestionsService } from './../../service/questions/questions.service'; -<<<<<<< HEAD -======= /* * Question master add details * : kdk */ ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe @Component({ selector: 'app-add', templateUrl: './add.component.html', styleUrls: ['./add.component.scss'] }) export class AddComponent implements OnInit { -<<<<<<< HEAD - - public pageTitle : string = "Add Question Details"; -======= public pageTitle: string = "Add Question Details"; ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe public _addQuesFrom: FormGroup; public submitted = false; public categories: any = []; public questionsOptions: any = []; errorMessage: string; -<<<<<<< HEAD - constructor(private _formBuilder: FormBuilder, - private dialogRef: MatDialogRef, - private masterService: MastersService, - private questionsService: QuestionsService) { } -======= /** * Notifier service */ @@ -71,7 +54,6 @@ export class AddComponent implements OnInit { private questionsService: QuestionsService) { this.notifier = notifier; } ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe ngOnInit() { @@ -88,22 +70,6 @@ export class AddComponent implements OnInit { // OnInit Load Category and Question Type Masters this.getCategoryListMaster(); this.getQuestionOptionsMaster(); -<<<<<<< HEAD - - // /** For SelectDrop Datas*/ - // this._mastersService.getAllMasterData('CITY') - // .subscribe( - // data => { - - // if (data.status == 200) { - // this.citydatas = data.records; - // this.citydatas = this.citydatas.filter(city=>city.isactive == 1 ); - // } - - // }, error => this.errorMessage = error); - -======= ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe } // convenience getter for easy access to form fields @@ -132,12 +98,8 @@ export class AddComponent implements OnInit { this.categories = data.records.filter(category => category.isactive == 1); }, error => { -<<<<<<< HEAD - this.errorMessage = "No Category Record Found."; -======= this.notifier.notify('warning', 'No Category Records Found.!'); this.errorMessage = "No Category Records Found."; ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe } ) } @@ -147,10 +109,7 @@ export class AddComponent implements OnInit { this.questionsOptions = data.records; }, error => { -<<<<<<< HEAD -======= this.notifier.notify('warning', 'No Answer Type Records Found.!'); ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe this.errorMessage = "No Answer Type Record Found."; } ) @@ -171,27 +130,6 @@ export class AddComponent implements OnInit { } else { var answerFormValues = this._addQuesFrom.value; -<<<<<<< HEAD - //To Remove The "Null" With Key also - Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]); - - //Add BRANCH data with help Service File - this.questionsService.addQuestionMasterDetails(answerFormValues).subscribe( - dataresult => { - if (dataresult.status == 200) { - console.log(dataresult); - alert("sample alert for Saving"); - } - else { - this.errorMessage = "Some Thing Wents Wrong Try Again !"; - } - } , error => { - this.errorMessage = "Some Thing Wents Wrong Try Again !"; - this.dialogRef.close(); - }); - //After Saving the BRANCH data then popup close - // this.dialogRef.close(); -======= //To Remove The "Null" With Key also Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]); @@ -215,7 +153,6 @@ export class AddComponent implements OnInit { }); //After Saving the BRANCH data then popup close // this.dialogRef.close(); ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe } } diff --git a/ng6-seed/src/app/template/questions/edit/edit.component.html b/ng6-seed/src/app/template/questions/edit/edit.component.html index 0d2782356..159e706ca 100644 --- a/ng6-seed/src/app/template/questions/edit/edit.component.html +++ b/ng6-seed/src/app/template/questions/edit/edit.component.html @@ -1,96 +1,87 @@
- -
-

{{pageTitle}}

-
-
- + +
+

{{pageTitle}}

+
+
+ +
-
- -
- -
- - - {{ ct.categroy_name }} - - You must Select Category. - -
-
- - - You must Include Question. - -
-
- - - You must Include Description. - -
-
- - - {{ ans.answer_type_name }} - - You must Select Answer Type. - -
-
-
-
-
-
-
- - - - - -
-
- - - - + + + +
+ + + {{ ct.categroy_name }} + + You must Select Category. + +
+
+ + + You must Include Question. + +
+
+ + + You must Include Description. + +
+
+ + + {{ ans.answer_type_name }} + + You must Select Answer Type. + +
+
+
+
+
+
+
+ + + + + +
+
+ + + + +
+ +
- -
-
-
-<<<<<<< HEAD - Active/InActive -======= - Active/InActive ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe -
- - -
-<<<<<<< HEAD - -======= - ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe - -
- - - -
- - \ No newline at end of file +
+ Active/InActive +
+ + +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/ng6-seed/src/app/template/questions/edit/edit.component.ts b/ng6-seed/src/app/template/questions/edit/edit.component.ts index dfd3287c1..20dd63a40 100644 --- a/ng6-seed/src/app/template/questions/edit/edit.component.ts +++ b/ng6-seed/src/app/template/questions/edit/edit.component.ts @@ -23,13 +23,10 @@ import { import { MastersService } from './../../service/masters/masters.service'; import { QuestionsService } from './../../service/questions/questions.service'; -<<<<<<< HEAD -======= /* * Question master details edit component * : kdk */ ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe @Component({ selector: 'app-edit', templateUrl: './edit.component.html', @@ -38,30 +35,18 @@ import { QuestionsService } from './../../service/questions/questions.service'; export class EditComponent implements OnInit { -<<<<<<< HEAD - public pageTitle : string = "Edit Question Details"; -======= public pageTitle: string = "Edit Question Details"; ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe public _addQuesFrom: FormGroup; public submitted = false; public categories: any = []; public questionsOptions: any = []; errorMessage: string; -<<<<<<< HEAD - - /** - * Notifier service - */ - private notifier: NotifierService; -======= /** * Notifier service */ private notifier: NotifierService; ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe constructor( notifier: NotifierService, @@ -70,13 +55,8 @@ export class EditComponent implements OnInit { private masterService: MastersService, private questionsService: QuestionsService, @Inject(MAT_DIALOG_DATA) public data: any) { -<<<<<<< HEAD - this.notifier = notifier; - } -======= this.notifier = notifier; } ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe ngOnInit() { this.loadFormData(); @@ -87,23 +67,14 @@ export class EditComponent implements OnInit { this.addLanguage(vals['answer'], vals['question_answer_id'], vals['isactive'], null); } } -<<<<<<< HEAD - -======= ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe // OnInit Load Category and Question Type Masters this.getCategoryListMaster(); this.getQuestionOptionsMaster(); } -<<<<<<< HEAD - loadAnsData(){ - if (this.data["0"].length > 0) { -======= // load answer details list loadAnsData() { if (this.data["0"].length > 0) { ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe for (let val of this.data["0"]) { // alert(JSON.stringify(val)); let vals = val; @@ -112,38 +83,22 @@ export class EditComponent implements OnInit { } } -<<<<<<< HEAD - loadFormData() { - /** Questions Form Datas*/ -======= // load form data form the master loadFormData() { /** Questions Form Datas*/ ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe this._addQuesFrom = this._formBuilder.group({ question_id: [this.data.question_id], question: [this.data.question, Validators.compose([Validators.required])], description: [this.data.description, Validators.compose([Validators.required])], fk_question_catagory: [this.data.fk_question_catagory, Validators.compose([Validators.required])], fk_question_answertype: [this.data.fk_question_answertype, Validators.compose([Validators.required])], -<<<<<<< HEAD - isactive:[this.data.isactive], -======= isactive: [this.data.isactive], ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe answers: this._formBuilder.array([ // this.initAnswers(null, null), ]) }); } -<<<<<<< HEAD - get f_ans() { return this._addQuesFrom.get('answers'); } - - // convenience getter for easy access to form fields - get f() { return this._addQuesFrom.controls; } - -======= // convenience getter for easy access to form fields get f() { return this._addQuesFrom.controls; } @@ -151,7 +106,6 @@ export class EditComponent implements OnInit { get f_ans() { return this._addQuesFrom.get('answers'); } ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe // Dynamic Form field creation Functionality : START ===> initAnswers(ans, fk_id, isAct) { isAct = isAct == null ? 1 : isAct; @@ -178,10 +132,7 @@ export class EditComponent implements OnInit { this.categories = data.records.filter(category => category.isactive == 1); }, error => { -<<<<<<< HEAD -======= this.notifier.notify('warning', 'No Category Records Found.!'); ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe this.errorMessage = "No Category Record Found."; } ) @@ -192,10 +143,7 @@ export class EditComponent implements OnInit { this.questionsOptions = data.records; }, error => { -<<<<<<< HEAD -======= this.notifier.notify('warning', 'No Answer Type Records Found.!'); ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe this.errorMessage = "No Answer Type Record Found."; } ) @@ -224,30 +172,18 @@ export class EditComponent implements OnInit { dataresult => { if (dataresult.status == 200) { console.log(dataresult); -<<<<<<< HEAD - this.notifier.notify( 'success', 'Your Changes Updated!' ); -======= this.notifier.notify('success', 'Your Changes Updated.!'); ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe this.dialogRef.close(); // this.notifierService('success', 'You are awesome! I mean it!'); // alert("sample alert for Saving"); } else { -<<<<<<< HEAD - this.notifier.notify( 'warning', 'Something Wents Wrong Try Again !' ); - this.errorMessage = "Something Wents Wrong Try Again !"; - } - }, error => { - this.errorMessage = "Some Thing Wents Wrong Try Again !"; -======= this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); this.errorMessage = "Something Wents Wrong Try Again.!"; } }, error => { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); this.errorMessage = "Some Thing Wents Wrong Try Again.!"; ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe this.dialogRef.close(); }); //After Saving the BRANCH data then popup close diff --git a/ng6-seed/src/app/template/questions/list/list.component.html b/ng6-seed/src/app/template/questions/list/list.component.html index 7ca772592..d4f6ed730 100644 --- a/ng6-seed/src/app/template/questions/list/list.component.html +++ b/ng6-seed/src/app/template/questions/list/list.component.html @@ -1,210 +1,119 @@
- -<<<<<<< HEAD - - -
-
Questions Master
-
List of Questions
-
-
-
-
- - - - - - {{cat.categroy_name}} - - - - + + +
+
Questions Master
+
List of Questions
-
-
- -
-
- - - - -
- -
- -
- -
-
- {{ product.categroy_name }} +
+
+
+
+ + + + + {{cat.categroy_name}} + +
-
-
{{ product.question }} -
-
-
+ +
+
+
-
- -
-
- - - - -
- -
- -
- -
-
- {{ product.categroy_name }} -
-
-
{{ product.question }} + + + + +
+ +
+ +
+ +
+
+ {{ product.categroy_name }} +
+
+
{{ product.question }} +
-
-
- - + + + --> +
-
- -<<<<<<< HEAD + + +
+ + +
No Record Found ...
-
- - - - - - - - - - - - - -
- - - - \ No newline at end of file +
+ + + + \ No newline at end of file diff --git a/ng6-seed/src/app/template/questions/list/list.component.scss b/ng6-seed/src/app/template/questions/list/list.component.scss index 7792de345..fa863a272 100644 --- a/ng6-seed/src/app/template/questions/list/list.component.scss +++ b/ng6-seed/src/app/template/questions/list/list.component.scss @@ -44,12 +44,9 @@ color: #fff; box-shadow: 0 2px 3px #c8bbbb; } -<<<<<<< HEAD -======= .no-record-found { font-size: 18px; color: #03a9f4; padding : 12px 8px; -} ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe +} \ No newline at end of file diff --git a/ng6-seed/src/app/template/questions/list/list.component.ts b/ng6-seed/src/app/template/questions/list/list.component.ts index ea4e65f38..4ef7238db 100644 --- a/ng6-seed/src/app/template/questions/list/list.component.ts +++ b/ng6-seed/src/app/template/questions/list/list.component.ts @@ -1,11 +1,6 @@ import { Component, ViewChild, OnInit } from '@angular/core'; -<<<<<<< HEAD -import { MatPaginator, MatSort, MatTableDataSource, MatDialog, PageEvent} from '@angular/material'; -import { FormGroup, FormControl } from '@angular/forms'; -======= import { MatPaginator, MatSort, MatTableDataSource, MatDialog, PageEvent } from '@angular/material'; import { FormGroup, FormControl, FormBuilder } from '@angular/forms'; ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe import { DataSource } from '@angular/cdk/table'; import { Observable } from 'rxjs/Observable'; import { QuestionsService } from './../../service/questions/questions.service'; @@ -14,37 +9,16 @@ import { MastersService } from './../../service/masters/masters.service'; import { AddComponent } from './../add/add.component'; import { EditComponent } from './../edit/edit.component'; -<<<<<<< HEAD -======= /* * Questions master List component * : kdk */ ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe @Component({ selector: 'app-list', templateUrl: './list.component.html', styleUrls: ['./list.component.scss'] }) export class ListComponent implements OnInit { -<<<<<<< HEAD - - public productList: any[] = []; - public paginationList: any[] = []; - public categories: any = []; - public search_cid :any = null; - - public filterFormCtrl : FormControl = new FormControl(); - /** control for the MatSelect filter keyword */ - // public masterFilterCtrl: FormControl = new FormControl(); - - length = 50; - pageIndex = 0; - pageSize = 10; - - pageEvent: PageEvent; - -======= public productList: any[] = []; public paginationList: any[] = []; @@ -61,46 +35,15 @@ export class ListComponent implements OnInit { pageEvent: PageEvent; // data source variable details ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe questionListData = null; public dataLength: number; public dataSource = new MatTableDataSource(); displayedColumns = ['categroy_name', 'question', 'actions']; -<<<<<<< HEAD - -======= ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe @ViewChild(MatPaginator) paginator: MatPaginator; @ViewChild(MatSort) sort: MatSort; constructor(private dialog: MatDialog, -<<<<<<< HEAD - private questionsService: QuestionsService, - private masterService: MastersService) { - this.getQuestionsMasters(); - } - - getQuestionsMasters(){ - this.search_cid = this.filterFormCtrl.value; - console.log(this.filterFormCtrl); - this.questionsService.getQuestionMasterDetails(this.search_cid).subscribe( - data => { - this.productList = data.records; - this.questionListData = data.records; - // alert(this.userData); - this.dataLength = data.records.length; - this.dataSource.data = this.questionListData; - } - ) - } - - ngOnInit() { - this.getCategorMaster(); - } - - getCategorMaster() { -======= private questionsService: QuestionsService, private masterService: MastersService, private _formBuilder: FormBuilder) { @@ -143,7 +86,6 @@ export class ListComponent implements OnInit { // get category master details getCategorMaster() { ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe this.masterService.getAllMasterData('QUESTIONCATEGORY').subscribe( data => { this.categories = data.records.filter(category => category.isactive == 1); @@ -154,11 +96,7 @@ export class ListComponent implements OnInit { ) } -<<<<<<< HEAD - ngAfterViewInit() { -======= ngAfterViewInit() { ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; } @@ -172,32 +110,6 @@ export class ListComponent implements OnInit { // add questions popup model call addNewQuestion() { const dialogRef = this.dialog.open(AddComponent, { -<<<<<<< HEAD - data: {} - }); - - dialogRef.afterClosed() - .subscribe(dataresult => { - this.getQuestionsMasters(); - // this.getBranch(); - // this.isPopupOpened = false; - }); - } - - editQuestion(rowDetails: any){ - const dialogRef = this.dialog.open(EditComponent, { - data: rowDetails - }); - - dialogRef.afterClosed() - .subscribe(dataresult => { - this.getQuestionsMasters(); - // this.getBranch(); - // this.isPopupOpened = false; - }); - } - -======= data: {}, disableClose: true }); @@ -223,7 +135,6 @@ export class ListComponent implements OnInit { }); } // padination page event call ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe pageChange(e) { console.log(e); } diff --git a/ng6-seed/src/app/template/questions/questions.module.ts b/ng6-seed/src/app/template/questions/questions.module.ts index 872db1b18..e5e6301fb 100644 --- a/ng6-seed/src/app/template/questions/questions.module.ts +++ b/ng6-seed/src/app/template/questions/questions.module.ts @@ -28,14 +28,8 @@ import { AddComponent } from './add/add.component'; import { EditComponent } from './edit/edit.component'; /* * Question Master Module details -<<<<<<< HEAD -*/ - - -======= * : kdk */ ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe /** * Custom angular notifier options */ @@ -47,11 +41,7 @@ const customNotifierOptions: NotifierOptions = { }, vertical: { position: 'top', -<<<<<<< HEAD - distance: 12, -======= distance: 32, ->>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe gap: 10 } },