From 20f0eed7e0b9da7f118cd78fbcbec20d94179a1f Mon Sep 17 00:00:00 2001 From: Sreejit-K Date: Thu, 7 Mar 2024 14:54:54 +0530 Subject: [PATCH] Esign Flow Changes in the demo donor UI --- .../src/app/forms/forms.component.ts | 76 ------------------- 1 file changed, 76 deletions(-) diff --git a/donor-registry/src/app/forms/forms.component.ts b/donor-registry/src/app/forms/forms.component.ts index 7d970c96..01e851d4 100644 --- a/donor-registry/src/app/forms/forms.component.ts +++ b/donor-registry/src/app/forms/forms.component.ts @@ -2359,43 +2359,6 @@ export class FormsComponent implements OnInit { this.checkOtherVal(); - await this.http.post(`${getDonorServiceHost()}/esign/init`, { data: this.model }).subscribe(async (res) => { - - let x = screen.width / 2 - 500; - let y = screen.height / 2 - 400; - const eSignWindow = window.open('', 'pledge esign', "location=no, height=800, width=1000, left=" + x + ",top=" + y); - eSignWindow.document.write(` -
-\t -\t -\t -
-\t`); - eSignWindow.focus(); - let checkESignStatus = true; - let count = 0; - while (checkESignStatus) { - try { - this.http.get(res.signUrl) - .subscribe((response) => { - checkESignStatus = false; - console.log(response) - }, (err) => { - console.log(err) - }); - } catch (e) { - console.log(e) - } - await new Promise(r => setTimeout(r, 3000)); - if (count++ === 400) { - checkESignStatus = false; - alert("Esign session expired. Please try again"); - } - } - eSignWindow.close(); - if (this.model.hasOwnProperty('emergencyDetails') && this.model['emergencyDetails']['relation'] == "") { this.model['emergencyDetails'] = {} } @@ -2428,7 +2391,6 @@ export class FormsComponent implements OnInit { }); localStorage.removeItem(this.model['identificationDetails']['abha']); localStorage.removeItem('isVerified'); - }); } else { this.callPostAPI(); } @@ -2480,42 +2442,6 @@ export class FormsComponent implements OnInit { this.routeNew = "/esign/init/" + this.entityName + "/" + this.identifier; - await this.http.put(`${getDonorServiceHost()}` + this.routeNew, { data: this.model }).subscribe(async (res) => { - - let x = screen.width / 2 - 500; - let y = screen.height / 2 - 400; - const eSignWindow = window.open('', 'pledge esign', "location=no, height=800, width=1000, left=" + x + ",top=" + y); - eSignWindow.document.write(` -
- \t - \t - \t -
- \t`); - eSignWindow.focus(); - let checkESignStatus = true; - let count = 0; - while (checkESignStatus) { - try { - this.http.get(`${getDonorServiceHost()}/esign/${this?.model['identificationDetails']['abha']}/status`) - .subscribe((res) => { - checkESignStatus = false; - console.log(res) - }, (err) => { - console.log(err) - }); - } catch (e) { - console.log(e) - } - await new Promise(r => setTimeout(r, 3000)); - if (count++ === 400) { - checkESignStatus = false; - alert("Esign session expired. Please try again"); - } - } - eSignWindow.close(); this.checkOtherVal(); if (this.model.hasOwnProperty('emergencyDetails') && this.model['emergencyDetails']['relation'] == "") { this.model['emergencyDetails'] = {} @@ -2554,8 +2480,6 @@ export class FormsComponent implements OnInit { localStorage.removeItem(this.model['identificationDetails']['abha']); localStorage.removeItem('isVerified'); }, 3000); - - }); } checkOtherVal() {