From 260e96b8b137bd6c06ed65c992e1624e977a944f Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Mon, 23 Nov 2020 15:30:09 +0530 Subject: [PATCH] Fairoj : cliq feedback changes --- .../list-pd/add-pd/add-pd.component.html | 6 +- .../dynamic-form/dynamic-form.component.html | 2 +- .../dynamic-question-template.component.html | 8 ++- .../dynamic-question-template.component.ts | 7 +++ .../ques-form/ques-form.service.ts | 1 + .../start-pd/forms/form/form.component.ts | 10 ++-- .../image-capture.component.html | 2 +- .../list-pd/start-pd/start-pd.component.ts | 9 ++- .../progress-spineer-dialog.component.html | 2 +- .../progress-spineer-dialog.component.scss | 5 ++ .../data/SMC_CREDIT_TEMPLATES/LFMP/13.json | 58 +++++++++---------- .../data/SMC_CREDIT_TEMPLATES/WCTL/13.json | 44 +++++--------- 12 files changed, 81 insertions(+), 73 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html index 3f8f299..e22a9d2 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html @@ -263,7 +263,8 @@ - Name of Individual Applicant + @@ -304,7 +305,8 @@ - Name of Individual Applicant + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.html index 5857a79..6f7bcc2 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.html @@ -44,7 +44,7 @@ [whole_json]="parent_ques.group_questions[g_i]" [json_index]="g_i" (generateGroupControls) = generateGroupControls($event)>
-
+
- {{parent_ques.question}} @@ -67,6 +67,7 @@ {{parent_ques.question}} + Select {{val.answer}} @@ -92,6 +93,7 @@ {{parent_ques.question}} + Select {{val.answer}} @@ -160,7 +162,7 @@ - + {{parent_ques.question}} @@ -169,7 +171,7 @@ close - -- + Select { + if(vv.question_key == curr_obj.insert_control) { + vv.is_hidden = true + }}) + console.log("sdfffffffffff",this.whole_json,curr_obj.insert_control); } if(formArray.value.length < 2) { return; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts index 0440b4f..7b631b0 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts @@ -452,6 +452,7 @@ export class QuesFormService { for(let i=0;i<=2;i++){ fy.push({fy_year:(fy[i].curr-2)+'-'+(fy[i].curr-1),curr:fy[i].curr-1}) } + fy.reverse(); return fy.map(val=>({answer:val.fy_year,answer_id:val.fy_year})) } // END OF GETCURRFYYEARS FUN diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts index 3d6a033..7cb0133 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts @@ -74,7 +74,7 @@ export class FormComponent implements OnInit { // this.pdTriggerService.loadTemplate(Number(this.pd_all_details.form_id)).subscribe(result=>{ let params = {"fk_entity_id":"35","fk_product_id":this.pd_all_details.pdmaster_details.fk_product_id,"pd_form_id":this.pd_all_details.form_id,"fk_pd_id":this.pd_all_details.pdmaster_details.pd_id} this.pdTriggerService.loadCreditPDTemplate(params).subscribe(result=>{ - // result.dataStatus = false + // result.dataStatus = false if(result.dataStatus) { let question_template: any = result.records if (question_template && question_template != null && question_template != undefined @@ -275,7 +275,7 @@ export class FormComponent implements OnInit { if(result['dataStatus']) { this.notifier.notify("success","Saved successfully..") setTimeout(()=>{ - this.dialogRef.close() + this.dialogRef.close('refresh') },1500) } else { @@ -379,6 +379,8 @@ export class FormComponent implements OnInit { return sum_val == 100}());` let exp1 = `(function (){let sum_val=null;let ques_key=[]; control.forEach(ques_obj=>{ques_key.push(ques_obj[submitProperty.key_name])});console.log('none',ques_key);return new Set(ques_key).size === ques_key.length}())` + let exp2 = `(function (){let sum_val=null;let ques_key=[]; + control.forEach(ques_obj=>{ques_key.push(ques_obj[submitProperty.key_name])});console.log('none',ques_key);return new Set(ques_key).size === ques_key.length}())` //for image total check // let exp=` @@ -401,8 +403,8 @@ export class FormComponent implements OnInit { // return sum_val }());` - // let val= eval(submitProperty.expression); - let val= eval(exp1); + let val= eval(submitProperty.expression); + // let val= eval(exp1); console.log(val) return val } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/image-capture.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/image-capture.component.html index ffe5da6..ce3b50b 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/image-capture.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/image-capture.component.html @@ -5,7 +5,7 @@
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 8f7ac86..9c01160 100755 --- 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 @@ -8,6 +8,7 @@ import {PdTrigerService} from '../../../pd-service/pd-triger.service'; import { PdStatusChangeDialogueComponent } from '../pd-status-change-dialogue/pd-status-change-dialogue.component'; import { FormComponent } from './forms/form/form.component'; import { ImageCaptureComponent } from './forms/image-capture/image-capture.component'; +import { LoaderService } from 'app/shared/loaderService/loader.service'; @Component({ selector: 'app-start-pd', @@ -47,7 +48,7 @@ export class StartPdComponent implements OnInit, OnDestroy { constructor(notifier: NotifierService, private dialog: MatDialog, private fb: FormBuilder, private route: ActivatedRoute, private router: Router, - private listPDComponent: ListPdComponent, private _pd: PdTrigerService) { + private listPDComponent: ListPdComponent, private _pd: PdTrigerService,private loaderService:LoaderService) { this.startPD = this.route.snapshot.params['pdid']; this.randomString = this.route.snapshot.params['rdmstr']; // console.log(this.route.snapshot.params['pdid'],this.route.snapshot.params['rdmstr']); @@ -101,6 +102,7 @@ export class StartPdComponent implements OnInit, OnDestroy { // load templates details loadTemplates(startID:string,type:number,randomString:string){ + this.loaderService.showMatSpinnerDialog('Please wait') // console.log('start pd component inside - loadTemplates params are,',startID,type,randomString); this._pd.loadPDTemplates(startID,randomString).subscribe( data => { @@ -146,7 +148,10 @@ export class StartPdComponent implements OnInit, OnDestroy { this.currentPDStatus = false; } // this.getAnswers(serachQuestions); + this.loaderService.closeMatSpinnerDialog() + },err=>{ + this.loaderService.closeMatSpinnerDialog() }); } @@ -210,7 +215,9 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); + // if(dataresult == 'refresh') { this.loadTemplates(this.startPD,2,this.randomString); + // } }); } diff --git a/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.html b/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.html index 5cf61c0..7fc4378 100644 --- a/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.html +++ b/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.html @@ -1,4 +1,4 @@
- +

{{spinnerMsg}}

\ No newline at end of file diff --git a/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.scss b/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.scss index 7d7126a..5eec45f 100644 --- a/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.scss +++ b/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.scss @@ -2,4 +2,9 @@ box-shadow: none; background: rgba(0, 0, 0, 0.0); } +mat-spinner { + @media(min-width:600px) { + margin-left: 75px; + } +} } \ No newline at end of file diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/13.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/13.json index 61777b9..13ba301 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/13.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/13.json @@ -201,24 +201,13 @@ { "purpose": "validations", "validations": [ + { "name": "required", "isactive": "1", "validator": "", - "message": "Required", - "value": "(String('estimated_quantity') != String('')) || (String('estimated_stock_value') != String('')) ", - "validation_to": null, - "value_keys": [ - "estimated_quantity", - "estimated_stock_value" - ] - }, - { - "name": "required", - "isactive": "1", - "validator": "", - "message": "Required", - "value": "(String('estimated_quantity') != String('')) || (String('estimated_stock_value') != String('')) ", + "message": "Either Estimated Stock value or Estimated Quantity is required", + "value": "(String('estimated_quantity') === String(''))", "validation_to": "estimated_stock_value", "value_keys": [ "estimated_quantity", @@ -232,7 +221,15 @@ "is_subfield": "1", "parent_question_key": "provider_observed", "answers": null, - "validations": [] + "validations": [ + { + "name": "required", + "isactive": "1", + "validator": "Validators.required", + "message": "Either Estimated Stock value or Estimated Quantity is required", + "value": null + } + ] }, { "question": "UOM", @@ -280,23 +277,10 @@ "name": "required", "isactive": "1", "validator": "", - "message": "Required", - "value": "(String('estimated_quantity') != String('')) || (String('estimated_stock_value') != String('')) ", - "validation_to": null, - "value_keys": [ - "estimated_quantity", - "estimated_stock_value" - ] - }, - { - "name": "required", - "isactive": "1", - "validator": "", - "message": "Required", - "value": "(String('estimated_quantity') != String('')) || (String('estimated_stock_value') != String('')) ", + "message": "Either Estimated Stock value or Estimated Quantity is required", + "value": "(String('estimated_stock_value') === String(''))", "validation_to": "estimated_quantity", "value_keys": [ - "estimated_quantity", "estimated_stock_value" ] } @@ -345,6 +329,20 @@ "value": null } ] + }, + { + "question_key":"common_remarks", + "question":"Remarks", + "place_holder":"Enter the text", + "type":"7", + "api_properties":null, + "answers":null, + "onchange_properties":null, + "is_repeatable":null, + "field_type":"string", + "field_width":"45", + "validations":[ + ] } ] } \ No newline at end of file diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/WCTL/13.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/WCTL/13.json index 61777b9..b465931 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/WCTL/13.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/WCTL/13.json @@ -201,24 +201,13 @@ { "purpose": "validations", "validations": [ + { "name": "required", "isactive": "1", "validator": "", - "message": "Required", - "value": "(String('estimated_quantity') != String('')) || (String('estimated_stock_value') != String('')) ", - "validation_to": null, - "value_keys": [ - "estimated_quantity", - "estimated_stock_value" - ] - }, - { - "name": "required", - "isactive": "1", - "validator": "", - "message": "Required", - "value": "(String('estimated_quantity') != String('')) || (String('estimated_stock_value') != String('')) ", + "message": "Either Estimated Stock value or Estimated Quantity is required", + "value": "(String('estimated_quantity') === String(''))", "validation_to": "estimated_stock_value", "value_keys": [ "estimated_quantity", @@ -232,7 +221,15 @@ "is_subfield": "1", "parent_question_key": "provider_observed", "answers": null, - "validations": [] + "validations": [ + { + "name": "required", + "isactive": "1", + "validator": "Validators.required", + "message": "Either Estimated Stock value or Estimated Quantity is required", + "value": null + } + ] }, { "question": "UOM", @@ -280,23 +277,10 @@ "name": "required", "isactive": "1", "validator": "", - "message": "Required", - "value": "(String('estimated_quantity') != String('')) || (String('estimated_stock_value') != String('')) ", - "validation_to": null, - "value_keys": [ - "estimated_quantity", - "estimated_stock_value" - ] - }, - { - "name": "required", - "isactive": "1", - "validator": "", - "message": "Required", - "value": "(String('estimated_quantity') != String('')) || (String('estimated_stock_value') != String('')) ", + "message": "Either Estimated Stock value or Estimated Quantity is required", + "value": "(String('estimated_stock_value') === String(''))", "validation_to": "estimated_quantity", "value_keys": [ - "estimated_quantity", "estimated_stock_value" ] }