From 2364d53218e0a3b155cf0f63a2bebd22983d8526 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Sun, 4 Nov 2018 12:28:19 +0530 Subject: [PATCH 1/2] forms based questions changes in start pd --- .../list-pd/start-pd/start-pd.component.html | 35 +++++++++++++++++++ .../list-pd/start-pd/start-pd.component.ts | 31 ++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html index 86135e42d..1d7761abf 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html @@ -21,6 +21,14 @@ + + + + {{ (formButton.form_name.length>15)? (formButton.form_name | slice:0:15)+'..':(formButton.form_name) }} + + + + @@ -49,12 +57,14 @@
+

No Records Found..

+ @@ -359,7 +369,32 @@ +
+ + +
+ + + +

supplier

+
+ + + + +

client

+
+ + + + +

Personal

+
+ +
+
+ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts index 083464bb4..1bedab318 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts @@ -29,6 +29,28 @@ selectedQuestionIndex:number; getQuestionsLength:number; answerList:any=[]; ansPDList:any=[]; + +// category static form buttons +categoryFormButtons : any=[ +{ + "form_id":1, + "form_name":"Supplier Details" +}, +{ + "form_id":2, + "form_name":"Client Details", +}, +{ + "form_id":3, + "form_name":"Personal Details", +}, + +]; + +formsCategoryEnable:boolean=false; +selectedFormsCategory:any; + + // create values for status check pdStatusCheck :any={ "DRAFT" :'DRAFT', @@ -106,6 +128,7 @@ loadTemplates(startID:string){ } OnSelectDirectQuestions(selectedQuestions: any, categoryIndex:number,questionsIndex:number){ + this.formsCategoryEnable=false; this.selectedCategory=selectedQuestions; this.selectedCategoryIndex=categoryIndex; this.selectedQuestionIndex=questionsIndex; @@ -425,6 +448,14 @@ optionsMapItems(items) { }); } + // direct form based questions + OnSelectDirectForms(details:any){ + this.formsCategoryEnable = true; + this.selectedFormsCategory = details; + + } + + // load pd view component loadPdViewCompoent(){ this.router.navigate([ '../../viewpd',this.startPD], { relativeTo: this.route }); From 3d05553993d7520b2fe5e462d94c0a2da86caaa8 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Sun, 4 Nov 2018 12:28:52 +0530 Subject: [PATCH 2/2] merge changes : kms --- .../app/session/login/login-component.html | 12 +- .../app/session/login/login-component.scss | 53 +++---- .../entity-edit-billing-info.component.html | 8 +- .../entity-edit-region.component.html | 4 +- .../entity-add-tat.component.html | 2 +- .../entity-edit-tat.component.html | 6 +- .../entity-list/entity.list.component.html | 41 +++++- .../template/questions/add/add.component.html | 111 ++++++++------- .../template/questions/add/add.component.ts | 19 ++- .../questions/edit/edit.component.html | 134 ++++++++++-------- .../template/questions/edit/edit.component.ts | 38 +++-- .../questions/list/list.component.html | 20 +-- 12 files changed, 278 insertions(+), 170 deletions(-) diff --git a/ng6-seed/src/app/session/login/login-component.html b/ng6-seed/src/app/session/login/login-component.html index 61229ce5e..41ee7e92e 100644 --- a/ng6-seed/src/app/session/login/login-component.html +++ b/ng6-seed/src/app/session/login/login-component.html @@ -2,7 +2,7 @@
-

SINEEDGE +

SINEEDGE

@@ -11,7 +11,6 @@

Login

-
@@ -22,10 +21,11 @@
- + -
+
+
@@ -41,7 +41,7 @@
- \ No newline at end of file diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.html index bcca26bbe..750981985 100644 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.html +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.html @@ -1,6 +1,7 @@
+
@@ -31,7 +32,7 @@ Branch Required.! --> -
+
@@ -41,6 +42,7 @@
+
diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-add-tat.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-add-tat.component.html index 921e2291d..b7de951e7 100644 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-add-tat.component.html +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-add-tat.component.html @@ -1,4 +1,4 @@ -
+
+
+
@@ -18,7 +18,7 @@ {{data.tatVal2}}
- +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.html b/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.html index 32b8be9c7..c6ce4f330 100644 --- a/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.html +++ b/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.html @@ -8,7 +8,40 @@
+ + + + + + {{ product.entity_name }} + + + + +
{{ product.full_name }} ({{product.short_name}})
+
{{ product.branch_name }}
+
{{product.city_name}}, {{product.state_name}}
+
+
+ + +
{{ product.phone_number }}
+
{{ product.official_email }}
+
+ + + + + + + + + +
+
+
+ +
No Record Found ...
+
- + +
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 f4e60e780..daa410b1d 100644 --- a/ng6-seed/src/app/template/questions/add/add.component.html +++ b/ng6-seed/src/app/template/questions/add/add.component.html @@ -1,78 +1,89 @@ -
- -
-

{{pageTitle}}

-
-
- -
-
- - -
- + + +

{{pageTitle}}

+ + + +
+
+ {{ ct.category_name }} You must Select Category.
-
- +
+ + + {{ gp.group_name }} + + You must Select Group. + +
+
+
+
+ You must Include Question.
-
- +
+
+
+ You must Include Description.
-
- +
+
+
+ {{ ans.answer_type_name }} You must Select Answer Type.
-
-
-
-
-
-
- - - - +
+
+
+
+
+
+
+ + + +
+
+ + + {{ gp.group_name }} + -
-
- +
+
+ -
- - -
+
- - -
- - -
- - - -
\ 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 657254038..3a5968b3b 100644 --- a/ng6-seed/src/app/template/questions/add/add.component.ts +++ b/ng6-seed/src/app/template/questions/add/add.component.ts @@ -39,6 +39,7 @@ export class AddComponent implements OnInit { public submitted = false; public categories: any = []; public questionsOptions: any = []; + public m_group: any = []; errorMessage: string; /** @@ -62,6 +63,7 @@ export class AddComponent implements OnInit { question: [null, Validators.compose([Validators.required])], description: [null, Validators.compose([Validators.required])], fk_question_category: [null, Validators.compose([Validators.required])], + fk_question_group_id: [null, Validators.compose([Validators.required])], fk_question_answertype: [null, Validators.compose([Validators.required])], answers: this._formBuilder.array([ this.initAnswers(), @@ -70,6 +72,7 @@ export class AddComponent implements OnInit { // OnInit Load Category and Question Type Masters this.getCategoryListMaster(); this.getQuestionOptionsMaster(); + this.getQuestionGroupMaster(); } // convenience getter for easy access to form fields @@ -78,7 +81,8 @@ export class AddComponent implements OnInit { // Dynamic Form field creation Functionality : START ===> initAnswers() { return this._formBuilder.group({ - answer: ['', Validators.compose([Validators.required])] + answer: ['', Validators.compose([Validators.required])], + fk_question_group_id: [''] }); } addLanguage(e) { @@ -103,6 +107,19 @@ export class AddComponent implements OnInit { } ) } + + getQuestionGroupMaster() { + this.masterService.getAllMasterData('QUESTIONGROUP').subscribe( + data => { + this.m_group = data.records; + }, + error => { + this.notifier.notify('warning', 'No Question Group Records Found.!'); + this.errorMessage = "No Question Group Records Found."; + } + ) + } + getQuestionOptionsMaster() { this.masterService.getAllMasterData('QUESTIONANSWERTYPE').subscribe( data => { 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 d68696cd4..20fea4322 100644 --- a/ng6-seed/src/app/template/questions/edit/edit.component.html +++ b/ng6-seed/src/app/template/questions/edit/edit.component.html @@ -1,92 +1,108 @@ -
- -
-

{{pageTitle}}

-
-
- -
-
- -
- -
- +

{{pageTitle}}

+ + + + +
+
+ {{ ct.category_name }} You must Select Category.
-
- +
+ + + {{ gp.group_name }} + + You must Select Group. + +
+
+
+
+ You must Include Question.
-
- +
+
+
+ You must Include Description.
-
- +
+
+
+ {{ ans.answer_type_name }} You must Select Answer Type.
-
- - - -
-
-
-
-
-
-
- - - - - -
-
- - +
+
+
+
+
+
+
+ + + + + +
+
+ + + {{ gp.group_name }} + + +
+
+ + -
- - -
+ + +
- - - + -
- - -
- - - -
- - \ No newline at end of file +
+ + +
+ + + + + + + + \ 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 16268c336..4db0e5967 100644 --- a/ng6-seed/src/app/template/questions/edit/edit.component.ts +++ b/ng6-seed/src/app/template/questions/edit/edit.component.ts @@ -39,6 +39,7 @@ export class EditComponent implements OnInit { public _addQuesFrom: FormGroup; public submitted = false; public categories: any = []; + public m_group: any = []; public questionsOptions: any = []; errorMessage: string; @@ -60,15 +61,16 @@ export class EditComponent implements OnInit { ngOnInit() { this.loadFormData(); - if (this.data["0"].length > 0) { - for (let val of this.data["0"]) { - // alert(JSON.stringify(val)); - let vals = val; - this.addLanguage(vals['answer'], vals['question_answer_id'], vals['isactive'], null); - } - } + // if (this.data["0"].length > 0) { + // for (let val of this.data["0"]) { + // // alert(JSON.stringify(val)); + // let vals = val; + // this.addLanguage(vals['answer'], vals['question_answer_id'], vals['isactive'], null); + // } + // } // OnInit Load Category and Question Type Masters this.getCategoryListMaster(); + this.getQuestionGroupMaster(); this.getQuestionOptionsMaster(); } @@ -78,7 +80,7 @@ export class EditComponent implements OnInit { for (let val of this.data["0"]) { // alert(JSON.stringify(val)); let vals = val; - this.addLanguage(vals['answer'], vals['question_answer_id'], vals['isactive'], null); + this.addLanguage(vals['answer'], vals['question_answer_id'], vals['fk_question_group_id'], vals['isactive'], null); } } } @@ -91,6 +93,7 @@ export class EditComponent implements OnInit { question: [this.data.question, Validators.compose([Validators.required])], description: [this.data.description, Validators.compose([Validators.required])], fk_question_category: [this.data.fk_question_category, Validators.compose([Validators.required])], + fk_question_group_id: [this.data.fk_question_group_id, Validators.compose([Validators.required])], fk_question_answertype: [this.data.fk_question_answertype, Validators.compose([Validators.required])], isactive: [this.data.isactive], answers: this._formBuilder.array([ @@ -107,17 +110,18 @@ export class EditComponent implements OnInit { // Dynamic Form field creation Functionality : START ===> - initAnswers(ans, fk_id, isAct) { + initAnswers(ans, fk_id, fk_question_group_id, isAct) { isAct = isAct == null ? 1 : isAct; return this._formBuilder.group({ answer: [ans, Validators.compose([Validators.required])], question_answer_id: [fk_id], + fk_question_group_id: [fk_question_group_id], isactive: [isAct] }); } - addLanguage(ans, fk_id, isAct, e) { + addLanguage(ans, fk_id, fk_question_group_id, isAct, e) { const control = this._addQuesFrom.controls['answers']; - control.push(this.initAnswers(ans, fk_id, isAct)); + control.push(this.initAnswers(ans, fk_id, fk_question_group_id, isAct)); } removeLanguage(i: number) { const control = this._addQuesFrom.controls['answers']; @@ -137,6 +141,18 @@ export class EditComponent implements OnInit { } ) } + + getQuestionGroupMaster() { + this.masterService.getAllMasterData('QUESTIONGROUP').subscribe( + data => { + this.m_group = data.records; + }, + error => { + this.notifier.notify('warning', 'No Question Group Records Found.!'); + this.errorMessage = "No Question Group Records Found."; + } + ) + } getQuestionOptionsMaster() { this.masterService.getAllMasterData('QUESTIONANSWERTYPE').subscribe( data => { 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 4665b1381..fd7fe1a92 100644 --- a/ng6-seed/src/app/template/questions/list/list.component.html +++ b/ng6-seed/src/app/template/questions/list/list.component.html @@ -25,31 +25,33 @@
- + + - + {{ product.category_name }} - + {{ product.question }} - + - - - +
+ +
-
No Record Found ...
+ +
No Record Found ...
+