From 76b66f0681e274e77b54115baf2b71c241b35a58 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Fri, 16 Oct 2020 19:45:09 +0530 Subject: [PATCH] Fairoj : Employer info image capture functionality and validation and some improvements --- .../layouts/admin/admin-layout.component.ts | 2 +- .../dynamic-docs-form.component.html | 2 + .../dynamic-docs-form.component.scss | 39 +++ .../dynamic-docs-form.component.ts | 13 +- .../employer-info.component.html | 125 +++++--- .../employer-info.component.scss | 44 ++- .../employer-info/employer-info.component.ts | 269 +++++++++++------- .../list-pd/view-pd/view-pd.component.ts | 4 + .../pd-service/pd-triger.service.ts | 12 + .../src/app/session/login/login.component.ts | 6 +- ng6-seed/src/assets/images/PD_watermark.png | Bin 0 -> 2357 bytes 11 files changed, 354 insertions(+), 162 deletions(-) create mode 100755 ng6-seed/src/assets/images/PD_watermark.png diff --git a/ng6-seed/src/app/layouts/admin/admin-layout.component.ts b/ng6-seed/src/app/layouts/admin/admin-layout.component.ts index 287136d..2720bcb 100755 --- a/ng6-seed/src/app/layouts/admin/admin-layout.component.ts +++ b/ng6-seed/src/app/layouts/admin/admin-layout.component.ts @@ -291,7 +291,7 @@ export class AdminLayoutComponent implements OnInit, OnDestroy { menunav(active){ switch(active){ case 'HOME': - if(this.pdTriggerService.customer_url_data && this.pdTriggerService.customer_url_data.pdid && this.pdTriggerService.customer_url_data.rdmstr) { + if(this.pdTriggerService.customer_url_data && this.pdTriggerService.customer_url_data.pdid && this.pdTriggerService.customer_url_data.rdmstr && this.pdTriggerService.customer_url_data.from == 'link') { let data= this.pdTriggerService.customer_url_data this.router.navigateByUrl('/personal_discussion/pdlist/viewpd?str='+data.pdid+'/'+data.rdmstr+'/link', {replaceUrl: true}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/dynamic-docs-form/dynamic-docs-form.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/dynamic-docs-form/dynamic-docs-form.component.html index 0747f28..c395719 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/dynamic-docs-form/dynamic-docs-form.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/dynamic-docs-form/dynamic-docs-form.component.html @@ -21,7 +21,9 @@
+ + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/dynamic-docs-form/dynamic-docs-form.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/dynamic-docs-form/dynamic-docs-form.component.scss index 7e871cb..aa1bd51 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/dynamic-docs-form/dynamic-docs-form.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/dynamic-docs-form/dynamic-docs-form.component.scss @@ -14,4 +14,43 @@ input{ .mat-input-placeholder { white-space: normal; } + @-webkit-keyframes highlight-fade { + 0% { + background: orange; + } + 100% { + background: white; + } + } + @-moz-keyframes highlight-fade { + 0% { + background: orange; + } + 100% { + background: white; + } + } + @-ms-keyframes highlight-fade { + 0% { + background: orange; + } + 100% { + background: white; + } + } + @keyframes highlight-fade { + 0% { + background: orange; + } + 100% { + background: white; + } + } + .field_highlight { + -webkit-animation: highlight-fade 4s ease-out; + -moz-animation: highlight-fade 4s ease-out; + -o-animation: highlight-fade 4s ease-out; + animation: highlight-fade 4s ease-out; + // background: blue; + } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/dynamic-docs-form/dynamic-docs-form.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/dynamic-docs-form/dynamic-docs-form.component.ts index afb70f0..e043fef 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/dynamic-docs-form/dynamic-docs-form.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/dynamic-docs-form/dynamic-docs-form.component.ts @@ -75,10 +75,15 @@ export class DynamicDocsFormComponent implements OnInit { } } - // capture(index,item_obj) { - // item_obj.controls['is_new'].setValue(1); - // this.eventCapturePic.emit({controls:item_obj.controls['img'],img_name:item_obj.value.placeholder,form_id:'24'}) - // } + capture(event,index,item_obj) { + item_obj.controls['is_new'].setValue(1); + this.eventCapturePic.emit({controls:item_obj.controls['img'],img_name:item_obj.value.placeholder,form_id:'24'}) + } + captureI(event){ + event.preventDefault(); + let element:HTMLElement = document.getElementById('input-file') as HTMLElement + element.click(); + } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/employer-info/employer-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/employer-info/employer-info.component.html index 297f53b..b7aab9b 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/employer-info/employer-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/employer-info/employer-info.component.html @@ -39,7 +39,7 @@ Not Met + formControlName="is_person_met" (change)="checkPartEnable(1);dynamicOnChangeValidations($event.checked,[applicant.controls['is_person_met_pic'],applicant.controls['is_person_met_id_proof']],true)"> Met @@ -48,14 +48,16 @@
-
+
-
+
- + + + Selfie of the Person Met @@ -65,13 +67,15 @@
- + + + ID Proof of the person
-
+



+ Is the Employer/ Manager available during FI visit? Select @@ -92,7 +96,7 @@ Required - + Anyone met during FI visit at initiated address? Select @@ -106,7 +110,7 @@
- + Name of Person Met
+ +
- + Enter name of Employer/Manager Name Required - + Designation of the person met
+ + Cash voucher +required (selectionChange)="dynamicOnChangeValidations($event.value,[getDocsSightedGroup['controls'].cash_voucher_pic],'yes')"> Select Yes No @@ -480,7 +496,9 @@ required> src="{{getDocsSightedGroup['value'].cash_voucher_pic}}" style="max-width: 80px;max-height: 80px">
+ + Salary Certificate +required (selectionChange)="dynamicOnChangeValidations($event.value,[getDocsSightedGroup['controls'].sal_certificate_pic],'yes')"> Select Yes No @@ -513,7 +531,9 @@ required> src="{{getDocsSightedGroup['value'].sal_certificate_pic}}" style="max-width: 80px;max-height: 80px">
+ + Salary Slip +required (selectionChange)="dynamicOnChangeValidations($event.value,[getDocsSightedGroup['controls'].sal_slip_pic],'yes')"> Select Yes No @@ -546,7 +566,9 @@ required> src="{{getDocsSightedGroup['value'].sal_slip_pic}}" style="max-width: 80px;max-height: 80px"> + + Required - + Others please specify +required (selectionChange)="dynamicOnChangeValidations($event.value,[getDocsSightedGroup['controls'].other_doc_pic],'yes')"> Select Yes No @@ -572,7 +594,7 @@ required>
- + Specify the Document Required @@ -585,7 +607,10 @@ required> src="{{getDocsSightedGroup['value'].other_doc_pic}}" style="max-width: 80px;max-height: 80px">
+ + +
- + Why Documents are not available? {{item}} Required - + Specify the reason @@ -626,21 +651,23 @@ Image -->
-
+

-
+
Office Photograph {{i+1}}
-
- No Photographs Found
+
- + + + Add More
-
+

-
+
Name Board {{i+1}}
-
- No Photographs Found
+
- + + + Add More
+ (eventCapturePic) ="captureControls($event.controls,$event.img_name,$event.form_id)">
@@ -909,7 +938,7 @@ Image -->
- + Approach to FI location Select @@ -923,7 +952,9 @@ Image -->
+ +
- + Comment on locality Select @@ -974,7 +1005,7 @@ Image -->
Required
- + Is there a competetion to the applicant's business in the location Select @@ -991,7 +1022,7 @@ Image --> Required - + Any demolition activity seen in the locality by PD officer Select @@ -1006,7 +1037,7 @@ Image --> Required - + Any sealing activity observed in the locality by PD officer Select @@ -1034,7 +1065,7 @@ Image --> Submit - + Final Status of visit @@ -1045,7 +1076,7 @@ Image --> Required - + Comments Required @@ -1053,7 +1084,7 @@ Image -->
Neighbourhood check
- + Existence of organization/office confirmed by neighbour Select diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/employer-info/employer-info.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/employer-info/employer-info.component.scss index 9ead99c..0295354 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/employer-info/employer-info.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/employer-info/employer-info.component.scss @@ -40,12 +40,15 @@ } .mat-radio-button.mat-accent .mat-radio-ripple .mat-ripple-element { - background-color:rgb(255, 37, 37); + background-color:rgb(80, 52, 52); } .mat-form-field { // margin-top: 16px; width: 100%; } +::ng-deep .mat-dialog-container{ + padding: 0px !important; +} .whole_form { @media(min-width:500px) { @@ -96,4 +99,43 @@ -o-animation: highlight-fade 4s ease-out; animation: highlight-fade 4s ease-out; // background: blue; + } + + input{ + // width: 100px; + // border-radius: 4px; + // border-color: gray; + // font-size: 12px; + height: 28px; + + } + .mat-select-panel mat-option.mat-option { + margin: 1rem 0; + overflow: visible; + line-height: initial; + word-wrap: break-word; + white-space: pre-wrap; + } + // .mat-option, + .largeMatOption{ + margin: 1rem 0; + overflow: visible; + line-height: initial !important; + word-wrap: break-word; + white-space: pre-wrap; + } + // .mat-option i, + .largeMatOption i{ + display: block; + font-size: 1.5rem; + opacity: 0.6; + margin-left: 0.5rem; + + } + input-placeholder{ + margin:10px; + } + mat-select{ + + margin : 5px 0; } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/employer-info/employer-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/employer-info/employer-info.component.ts index d5a9eab..33cfb4d 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/employer-info/employer-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-questions/employer-info/employer-info.component.ts @@ -9,6 +9,7 @@ import { NotifierService } from 'angular-notifier'; import { AwsService } from 'app/AwsService/aws.service'; import { CommonQuesComponent } from '../common-ques/common-ques.component'; import { takeUntil } from 'rxjs/operators'; +import { CameraService } from 'app/personal-discussion/camera-service/camera.service'; @Component({ selector: 'app-employer-info', @@ -61,7 +62,7 @@ export class EmployerInfoComponent implements OnInit { isDisplay2:any = []; isOrganisationOwner: any = []; photoIdCardList:any=[ - "Aadhaar card", "Electoral Photo Identity Card (EPIC) card", "PAN card", "Driving license" , "Others" + "Aadhaar card", "Electoral Photo Identity Card (EPIC) card", "PAN card", "Driving license" , "Not Provided", "Others" ] docNotAvailList:any=[ "Documents were not shared by Employer", "Documents are not issued by Employer", "Documents were not available", "Employer was not available", "Others (please specify)" @@ -106,6 +107,7 @@ export class EmployerInfoComponent implements OnInit { generalExistBusinessMonth: number; dynamicStepperHeadingForEmp:String; notifier: NotifierService; + currImageControls: { controls: any; img_name?: String; form_id?: any; fun_name:string,valid:boolean}; get questions() { return this.employerForm.get('questions');} get getEmployer_details() {return this.questions.get([2]).get('employer_details')} get getDocsSightedGroup() {return this.questions.get([7]).get('docs_sighted')} @@ -119,7 +121,7 @@ export class EmployerInfoComponent implements OnInit { public filteredcompanyRelationshipList:ReplaySubject = new ReplaySubject(1); public filteredrelationshipList:ReplaySubject = new ReplaySubject(1); - constructor(private actRoute:ActivatedRoute,private quesService:PdTrigerService,private router:Router, + constructor(private actRoute:ActivatedRoute,private quesService:PdTrigerService,private router:Router,private cameraService:CameraService, @Inject(MAT_DIALOG_DATA)public data,private _formBuilder:FormBuilder, notifier:NotifierService,private _awsService:AwsService,private dialogRef:MatDialogRef) { this.notifier=notifier @@ -524,7 +526,7 @@ export class EmployerInfoComponent implements OnInit { // datas[8].office_photographs = group_obj.office_photograph datas.push({office_photographs:group_obj.office_photographs}) group_obj.office_photographs.forEach(()=>{ - this.addMoreImage('office_photographs','',8) + this.addMoreImage('','office_photographs','',8) }) } else { @@ -535,7 +537,7 @@ export class EmployerInfoComponent implements OnInit { // datas[9].nameboard_photographs = group_obj.nameboard_photographs datas.push({nameboard_photographs:group_obj.nameboard_photographs}) group_obj.nameboard_photographs.forEach(()=>{ - this.addMoreImage('nameboard_photographs','',9) + this.addMoreImage('','nameboard_photographs','',9) }) } else { @@ -631,7 +633,7 @@ export class EmployerInfoComponent implements OnInit { uom_others:[''], is_pd_done_on_initiated_address:[true], pd_location:['',Validators.compose([Validators.required])], - pd_location_pic:[''], + pd_location_pic:['',Validators.compose([Validators.required])], comment_locality:['',Validators.compose([Validators.required])], form_id:['5'], form_name:["Address Info"], @@ -718,7 +720,7 @@ export class EmployerInfoComponent implements OnInit { name_person_met:['',Validators.compose([Validators.required])], designation_person_met:['',Validators.compose([Validators.required])], // proof image - person_met_pic:[''], + person_met_pic:['',Validators.compose([Validators.required])], photo_id_card:[''], photo_id_others:[''], photo_id_card_pic:[''], @@ -914,7 +916,8 @@ export class EmployerInfoComponent implements OnInit { // } // // console.log(this.employerForm.value); // } - addMoreImage(formArrayName,form_id?,formGroupIndex?) { + addMoreImage(event,formArrayName,form_id?,formGroupIndex?) { + console.log(event,formArrayName,form_id,formGroupIndex) let formArray = this.employerForm.get('questions') as FormArray; // console.log(formArray); let officeControl = formArray.at(formGroupIndex).get(formArrayName) as FormArray @@ -923,7 +926,7 @@ export class EmployerInfoComponent implements OnInit { // console.log("stock",stockCtrl); // stockCtrl.push(this.addStockImageControl()) if(form_id) { - // this.capturePic(officeControl,formArrayName,form_id) + this.capturePic(event,officeControl,formArrayName,form_id) } else { officeControl.push(this.addImageControl()) @@ -1075,70 +1078,105 @@ export class EmployerInfoComponent implements OnInit { ChdCtrls.controls.other_organisation_owner.updateValueAndValidity(); } + captureControls(controls,img_name?:String,form_id?,fun_name='capturePic') { + this.currImageControls = {controls:controls,img_name:img_name,form_id:form_id,fun_name:fun_name,valid:true} + } - // capturePic(controls,img_name?:String,form_id?) { - // console.clear(); - // console.log(controls) - // // return; - // // controls.setValue("pic"); + capturePic(event,controls,img_name?:String,form_id?) { + console.clear(); + console.log("Capture pic",event,controls,img_name,event) + if(this.currImageControls && this.currImageControls.valid) { + controls = this.currImageControls.controls + img_name = this.currImageControls.img_name + form_id = this.currImageControls.form_id + } + if(this.currImageControls.fun_name != 'capturePic' && this.currImageControls.valid) { + if(this.currImageControls.fun_name == 'saveApplicantInfo') { + this.currImageControls.valid = false + this.saveApplicantInfo(event,controls,img_name) + return; + } + if(this.currImageControls.fun_name == 'addMoreImage') { + this.currImageControls.valid = false + this.addMoreImage(event,controls,form_id,img_name) + return; + } + } + console.log("Capture pic",event,controls,img_name,event) + // if(this.currImageControls != 'capturePic') { + // if() + // } + // return; + // controls.setValue("pic"); - // // this.cameraProvider.getpicture().then(res => { - // this.cameraProvider.showImageDialog().then((res:any)=>{ - // console.log("g",res) - // if (res != 'error') { - // let geoCoordinates = localStorage.getItem('current_coordinates') - // // this.cons.getGeoTag().then(geoCoordinates=>{ - // this.cameraProvider.addWatermarks(res).then(watermarkedImage => { - // console.log("image name",img_name,img_name === 'office_photograph ') - // if(img_name == 'nameboard_photographs' || img_name == 'office_photographs') { - // console.log("Before") - // controls.push(this.addImageControl()) - // console.log("after") - // img_name = img_name+String(controls.length) - // controls = controls.at(controls.length-1)['controls'].image - // } - // console.log("controls",controls); - // controls.setValue(watermarkedImage) - // let bucket: any = [] - // bucket.push({ 'image': watermarkedImage, 'Name': img_name, 'link': geoCoordinates }); - // let records: any = { - // 'pd_id': this.pdDetails.pd_id, - // 'formid': form_id, - // 'images': bucket, - // 'company_id': null, - // } - // // For Business Groups - // if(form_id == '11' || form_id == '13' || form_id == '22') { - // records.company_id = '1' - // } - // console.log("params savePDImage", records) - // this.quesService.savePDImages(records).subscribe(result => { - // if(result['dataStatus']) { - // if(img_name == 'Person Met Pic') { - // this.sendGeoCords(geoCoordinates) - // } - // controls.setValue(result['uri']) - // } - // else { - // console.log(result); - // controls.setValue("") - // this.toastProvider.pdTriggerappmessage("Something went wrong!!",'warning'); - // } - // },err=>{ - // controls.setValue("") - // console.log(err) - // this.toastProvider.pdTriggerappmessage("Network Error","danger") - // }) - // }) - // } - // }) - // } - // sendGeoCords(location) { - // let params = {"pd_id":this.pdDetails.pd_id,"geo_location":location,"comment":"","fk_updatedby":this.users} - // this.quesService.renewSatellite(params).subscribe(rr=>{ + // this.cameraProvider.getpicture().then(res => { + // this.cameraProvider.showImageDialog().then((res:any)=>{ + // console.log("g",res) + var reader = new FileReader(); + // let imagePath = event; + reader.readAsDataURL(event); + reader.onload = (_event) => { + // this.imageData = reader.result; + this.cameraService.getPosition().then(geoCords=>{ + let geoCoordinates + if(geoCords != 'error') { + geoCoordinates = geoCords + } + else { + geoCoordinates = null; + } + console.log(geoCords); + this.cameraService.addWatermarks(reader.result,geoCoordinates).then(watermarkedImage=> { + console.log("image name",img_name,img_name === 'office_photograph ') + if(img_name == 'nameboard_photographs' || img_name == 'office_photographs') { + console.log("Before") + controls.push(this.addImageControl()) + console.log("after") + img_name = img_name+String(controls.length) + controls = controls.at(controls.length-1)['controls'].image + } + console.log("controls",controls); + controls.setValue(watermarkedImage) + let bucket: any = [] + bucket.push({ 'image': watermarkedImage, 'Name': img_name, 'link': geoCoordinates }); + let records: any = { + 'pd_id': this.pdDetails.pd_id, + 'formid': form_id, + 'images': bucket, + 'company_id': null, + } + // For Business Groups + if(form_id == '11' || form_id == '13' || form_id == '22') { + records.company_id = '1' + } + console.log("params savePDImage", records) + this.quesService.savePDImages(records).subscribe(result => { + if(result['dataStatus']) { + if(img_name == 'Person Met Pic') { + this.sendGeoCords(geoCoordinates) + } + controls.setValue(result['uri']) + } + else { + console.log(result); + controls.setValue("") + this.notifier.notify('warning',"Something went wrong!!"); + } + },err=>{ + controls.setValue("") + console.log(err) + this.notifier.notify("danger","Network Error") + }) + }) + }) + } + } + sendGeoCords(location) { + let params = {"pd_id":this.pdDetails.pd_id,"geo_location":location,"comment":"","fk_updatedby":this.users} + this.quesService.renewSatellite(params).subscribe(rr=>{ - // }) - // } + }) + } compareObjects(o1: any, o2: any) { if(o1.id == o2.id && o1.group_id == o2.group_id) return true; @@ -1191,43 +1229,58 @@ export class EmployerInfoComponent implements OnInit { // } // } - // saveApplicantInfo(applicant_obj,image_key) { - // console.log(applicant_obj); - // this.cameraProvider.showImageDialog().then((res:any)=>{ - // console.log("g",res) - // if (res != 'error') { - // let geoCoordinates = localStorage.getItem('current_coordinates') - // // this.cons.getGeoTag().then(geoCoordinates=>{ - // this.cameraProvider.addWatermarks(res).then(watermarkedImage => { - // applicant_obj.controls[image_key].setValue(watermarkedImage); - // let params = { - // "pd_co_applicant_id":applicant_obj.value.pd_co_applicant_id, - // "applicant_name":applicant_obj.value.applicant_name, - // "is_person_met":applicant_obj.value.is_person_met, - // "fk_pd_id":this.pdDetails.pd_id, - // "link":geoCoordinates - // } - // params[image_key] = applicant_obj.value[image_key] + saveApplicantInfo(event,applicant_obj,image_key) { + // return; + // controls.setValue("pic"); - // this.quesService.saveApplicantImgFromVendorForm(params).subscribe(result=>{ - // if(result['dataStatus']) { - // this.sendGeoCords(geoCoordinates) - // applicant_obj.controls[image_key].setValue(result['uri']); - // } - // else { - // applicant_obj.controls[image_key].setValue(""); - // console.log(result); - // this.toastProvider.pdTriggerappmessage("Something went wrong!!",'warning'); - // } - // },err=>{ - // applicant_obj.controls[image_key].setValue(""); - // console.log(err) - // this.toastProvider.pdTriggerappmessage("Network Error","danger") - // }) - // }) - // } - // }) - // } + // this.cameraProvider.getpicture().then(res => { + // this.cameraProvider.showImageDialog().then((res:any)=>{ + // console.log("g",res) + console.log("saveApplicantInfo",applicant_obj,image_key) + var reader = new FileReader(); + // let imagePath = event; + reader.readAsDataURL(event); + reader.onload = (_event) => { + // this.imageData = reader.result; + this.cameraService.getPosition().then(geoCords=>{ + let geoCoordinates + if(geoCords != 'error') { + geoCoordinates = geoCords + } + else { + geoCoordinates = null; + } + console.log(geoCords); + this.cameraService.addWatermarks(reader.result,geoCoordinates).then(watermarkedImage=> { + applicant_obj.controls[image_key].setValue(watermarkedImage); + let params = { + "pd_co_applicant_id":applicant_obj.value.pd_co_applicant_id, + "applicant_name":applicant_obj.value.applicant_name, + "is_person_met":applicant_obj.value.is_person_met, + "fk_pd_id":this.pdDetails.pd_id, + "link":geoCoordinates + } + params[image_key] = applicant_obj.value[image_key] + + this.quesService.saveApplicantImgFromVendorForm(params).subscribe(result=>{ + if(result['dataStatus']) { + this.sendGeoCords(geoCoordinates) + applicant_obj.controls[image_key].setValue(result['uri']); + } + else { + applicant_obj.controls[image_key].setValue(""); + console.log(result); + this.notifier.notify('warning',"Something went wrong!!",); + } + },err=>{ + applicant_obj.controls[image_key].setValue(""); + console.log(err) + this.notifier.notify("danger","Network Error") + }) + }) + }) + } + } public findInvalidControls() { const invalid = []; let msg='' @@ -1268,6 +1321,9 @@ export class EmployerInfoComponent implements OnInit { // this.myStepper.selectedIndex = 0; } + else { + msg = this.stepperInfo[index].form_name+" images are not taken" + } console.log("kkdd",group['controls'][name],firstInvalidField) @@ -1633,7 +1689,8 @@ records.questions = records.questions.filter(v=>v.form_id != '12.1' && v.form_id } if (general_controls.is_met_during_visit.value == 'yes') { general_controls.person_met_entered.setValidators(Validators.required); - // general_controls.person_met_entered_pic.setValidators(Validators.required); + general_controls.person_met_entered_pic.setValidators(Validators.required); + general_controls.person_met_entered_pic.updateValueAndValidity(); // FOR ADDING OFFICE PHOTO office_photo_controls.addControl('office_photographs', this._formBuilder.array([])) name_board_controls.addControl('nameboard_photographs', this._formBuilder.array([])) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts index 71793c6..75465c4 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts @@ -135,6 +135,10 @@ export class ViewPdComponent implements OnInit, OnDestroy { this.masterRandomString = temp[1] this.is_from_link = temp[2] == 'link' } + console.log("view pd ",this.viewID) + if(this.viewID == 'undefined'){ + this.router.navigate(['/error']) + } } }) } diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts index c055db5..a26b23c 100755 --- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts +++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts @@ -869,6 +869,18 @@ getBusinessDocsToVendorForm(editId) { return this._http.get(this.apiUrl+'getBusinessDocsToVendorForm',options) .pipe(catchError(this.handleError("getBusinessDocsToVendorForm",[]))) } +renewSatellite(params) { + return this._http.post(this.apiUrl+'renewSatellite',{records:params}) + .pipe(catchError(this.handleError("renewSatellite",[]))) + } + saveApplicantImgFromVendorForm(params) { + let userId= this._aws.getlocale(); + params.fk_createdby= userId + return this._http.post(this.apiUrl+'saveApplicantImgFromVendorForm',params) + .pipe(catchError(this.handleError("renewSatellite",[]))) + + } + } diff --git a/ng6-seed/src/app/session/login/login.component.ts b/ng6-seed/src/app/session/login/login.component.ts index a0cc813..22dfb26 100755 --- a/ng6-seed/src/app/session/login/login.component.ts +++ b/ng6-seed/src/app/session/login/login.component.ts @@ -77,7 +77,7 @@ export class LoginComponent implements OnInit{ this.getCommonSettings().then(()=>{ // local storage for validate user access localStorage.setItem('user_role',res.idToken.payload["custom:role_id"]); - if(this.pdTriggerService.customer_url_data && this.pdTriggerService.customer_url_data.pdid && this.pdTriggerService.customer_url_data.rdmstr) { + if(this.pdTriggerService.customer_url_data && this.pdTriggerService.customer_url_data.pdid && this.pdTriggerService.customer_url_data.rdmstr && this.pdTriggerService.customer_url_data.from == 'link') { let data= this.pdTriggerService.customer_url_data this.router.navigateByUrl('/personal_discussion/pdlist/viewpd?str='+data.pdid+'/'+data.rdmstr+'/link', {replaceUrl: true}); @@ -108,7 +108,7 @@ export class LoginComponent implements OnInit{ let auth = { 'Username': this.email, 'Password': this.password, 'newpassword': result }; this.aws.dologin(auth).subscribe(res => { this.getCommonSettings(); - if(this.pdTriggerService.customer_url_data && this.pdTriggerService.customer_url_data.pdid && this.pdTriggerService.customer_url_data.rdmstr) { + if(this.pdTriggerService.customer_url_data && this.pdTriggerService.customer_url_data.pdid && this.pdTriggerService.customer_url_data.rdmstr && this.pdTriggerService.customer_url_data.from == 'link') { let data= this.pdTriggerService.customer_url_data this.router.navigateByUrl('/personal_discussion/pdlist/viewpd?str='+data.pdid+'/'+data.rdmstr+'/link', {replaceUrl: true}); @@ -139,7 +139,7 @@ export class LoginComponent implements OnInit{ //alert(this.shared.isLoggedIn); if(this.shared.isLoggedIn){ // alert("if"); - if(this.pdTriggerService.customer_url_data) { + if(this.pdTriggerService.customer_url_data && this.pdTriggerService.customer_url_data.pdid && this.pdTriggerService.customer_url_data.rdmstr && this.pdTriggerService.customer_url_data.from == 'link') { let data= this.pdTriggerService.customer_url_data this.router.navigateByUrl('/personal_discussion/pdlist/viewpd?str='+data.pdid+'/'+data.rdmstr+'/link', {replaceUrl: true}); } diff --git a/ng6-seed/src/assets/images/PD_watermark.png b/ng6-seed/src/assets/images/PD_watermark.png new file mode 100755 index 0000000000000000000000000000000000000000..a3809e8792c63c3ca2478141f5754b9ead186220 GIT binary patch literal 2357 zcmV-53Ci|~P)rkRP8I;ORD)V?$4-1lKF*LRn<#8*7YKg9R$yWjcU^L^+0&bc}{Jtt;xT{I1q zi#m$B=V*WIVhG}c8b>os|B^_3L3loSrX58D8pzRN5DBYn?K2+j=Zlr2COfzjfP zi|RQ$;;Au`BgYo|Y4Nj)grtFohfCMNmF#G^92Wv3A+hi)O{1k?ygqevd!Ho)o1rWL zo2%6g++twMCKfkFarNf(rdt%Pi;;nFG$#(HYs!HX9j@YZ~r7u{B^G&sAyabl1X&F_@J zBp;LnoGV3GH5mJm4rExtoIeDXT$72G+4Zc}FoU-$f>Dako>jjIq1sV15GEPbD{_KF7GLM=eGqo#|To%2pW z(N%P+QqAC;spOCXtF;A;%^+E@l=ChwcX!Os(h7gb*4P5^4OtWhQ8QJ5^~r!$*$7ss z1V-J{tF#9Rpk6?wqh^a7oykrCw3o;hm9#H$G6&wg@Rm1i1gn<>Gngu3+DwOq8IOU@ z7T=6B6^4|}sNj290c-&$Q$SLQWCIjc^9SX?I@v#(1wRNhnA*mZ))!|g-``@6QN*5_ zrlRY!q@Z-VeqaagUs?&4g1RRGcF&1TK{)O1*^m^~Rp0BI^3|w^E6{=WqQ?KmrRX3p zfuk8LTEN!W3>hdoR3DcDqtgg0SSQUCl~8mpJuVe3)QHoTpx3^mqB2_B$5*qonRZ9y z880VC@HNcRH<-F#a*^VrKjBccVBPR4)oh2){JemsBXy_7bK~GjS|ndVpYvM+ zg<)?$#OppmHFBmxu#II&rBgg#m#OG zh`$#4bt~aamGS*oX6d}6Rc%8C@N^YL0(r*F0eL=3fq)*(yPN(sOc(L<^+ zi25{QutU@VrfB^=BLh-ny6pi)S(p0pPX;!a4gu8v|CfzW_t<@;p%~b)^vDjre|Rt_ zk5Bs(Yr{&Yb0{CF@z5bxmg%g4q76Dw7DyPe?8r90!Ryyy_f^}o_*hmN>YrH2&|95D76o-UC%p9Yi>*E z>l@hjbXKIE2(`(YSQaG+s<|ljQ+v!+^?*+UQUvK$R2^G~yVze!479&lb*?1Go0dhj z!+4e+4wRSk4bC)eC-etrG+FEHkHTm#OV)P%kHC&pmh)?j-jnr*WeqyoH=B&65%up0 z?8K{OkQo0ytkUg-c5U(3YS+t;(m2x_#=+6dSU9_}2yzlSAuqZO_QVv?dP{M%e>NEc zRL~w~D9eG8L@wf5Mb_5TETsK(N~?g9kSzg!*FU2fgN+SZ#LVJ z)Qmnl(Kp7`@?b|YmlN1cNBd>7ji%{lU&)BN^RBLxUuUOQW)j$4NBdINBGxS!-#dXK~i