From cc393c02a18f0cbc3d8ccb10843e8e474c739b4c Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Wed, 18 Nov 2020 16:19:26 +0530 Subject: [PATCH] Fairoj : pin reset feature introduced with related validation are added --- config.xml | 2 +- src/app/pages/authentication/auth/auth.html | 8 ++++-- src/app/pages/authentication/auth/auth.scss | 2 +- src/app/pages/authentication/auth/auth.ts | 31 +++++++++++++++++++-- 4 files changed, 36 insertions(+), 7 deletions(-) diff --git a/config.xml b/config.xml index 1bc4608..074bd0f 100755 --- a/config.xml +++ b/config.xml @@ -1,5 +1,5 @@ - + PD Genie Field Visit info@pdgenie.com PD Genie diff --git a/src/app/pages/authentication/auth/auth.html b/src/app/pages/authentication/auth/auth.html index f015cf0..ec2914c 100755 --- a/src/app/pages/authentication/auth/auth.html +++ b/src/app/pages/authentication/auth/auth.html @@ -16,16 +16,17 @@

PIN

+ Should be 4 digit
- +
- + @@ -63,6 +64,9 @@
+ + +

diff --git a/src/app/pages/authentication/auth/auth.scss b/src/app/pages/authentication/auth/auth.scss index a81b64b..a6b0079 100755 --- a/src/app/pages/authentication/auth/auth.scss +++ b/src/app/pages/authentication/auth/auth.scss @@ -5,7 +5,7 @@ .mat-card{ width: 80%; margin-left: 10%; - margin-top: 35%; + margin-top: 33%; border-radius: 10px; box-shadow: 0 16px 38px -12px rgba(0,0,0,.56), 0 4px 25px 0 rgba(0,0,0,.12), 0 8px 10px -5px rgba(0,0,0,.2) !important; } diff --git a/src/app/pages/authentication/auth/auth.ts b/src/app/pages/authentication/auth/auth.ts index ac71e06..e9ee2db 100755 --- a/src/app/pages/authentication/auth/auth.ts +++ b/src/app/pages/authentication/auth/auth.ts @@ -83,16 +83,41 @@ pin:any; this.loadingCtrl.dismissLoader(); }); } - setnewpin(newpin) + resetPin() { + this.mpinaccess = true + } + setnewpin(newpin,confirmPin) { - console.log("set Pin") - this.aws.userpinupdate(newpin).subscribe(res=> + console.log("set Pin",newpin,newpin.checkValidity(),newpin.value,newpin.validationMessage) + if(!newpin.checkValidity()) { + alert(newpin.validationMessage) + return; + } + // let confirmPin:any = document.getElementById('confirmPassword') + console.log(confirmPin) + if(newpin.value != confirmPin.value) { + this.toast.pdTriggerappmessage("Confirm Pin does not match.") + return; + } + this.aws.userpinupdate(newpin.value).subscribe(res=> { this.newpindetails = res; if(this.newpindetails.dataStatus == true) { + if(this.userDetails[0].mpin == null) { this.navCtrl.navigateRoot('/pd'); + } + else{ + this.toast.pdTriggerappmessage("Pin Reset Successfully") + this.userDetails[0].mpin = newpin.value + this.mpinaccess = false + } } + else{ + this.toast.pdTriggerappmessage("Something went wrong") + } + },err=>{ + this.toast.pdTriggerappmessage("Network Error!!") }) } /**Finger print */