Fairoj : pin reset feature introduced with related validation are added

This commit is contained in:
venbatechnologies@gmail.com 2020-11-18 16:19:26 +05:30
parent 93b2911394
commit cc393c02a1
4 changed files with 36 additions and 7 deletions

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.sineedge.pdgvendor" version="0.0.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="com.sineedge.pdgvendor" version="0.0.5" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>PD Genie Field Visit</name>
<description>info@pdgenie.com</description>
<author email="info@pdgenie.com" href="https://pdgenie.com">PD Genie</author>

View File

@ -16,16 +16,17 @@
<ion-row>
<ion-col class="ion-text-center">
<h4>PIN</h4>
<span style="color: red;">Should be 4 digit</span>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="ion-text-center">
<mat-form-field>
<input matInput type="password" placeholder="New PIN" #newpassword pattern="[0-9]{4}" maxlength="4" style="width: 100%;" required>
</mat-form-field>
<br/>
<mat-form-field>
<input matInput type="ext-centerpassword" placeholder="Confirm PIN" #confirmPassword pattern="[0-9]{4}" maxlength="4" style="width: 100%;" required
@ -36,7 +37,7 @@
</mat-card-content>
<mat-card-footer>
<mat-card-actions class="ion-text-center">
<button mat-raised-button color="primary" (click)="setnewpin(newpassword.value)">UNLOCK</button>
<button mat-raised-button color="primary" (click)="setnewpin(newpassword,confirmPassword)">UNLOCK</button>
</mat-card-actions>
</mat-card-footer>
@ -63,6 +64,9 @@
</mat-form-field>
</ion-col>
</ion-row>
<ion-row class="ion-float-right">
<button class="ion-float-right" mat-button style="color: blue;font-style:italic;text-decoration: underline;" (click)="resetPin()">Forgot Pin</button>
</ion-row><br/><br/>
</mat-card-content>
<mat-card-footer>
<mat-card-actions class="ion-text-center">

View File

@ -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;
}

View File

@ -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 */