|
|
|
|
@ -23,48 +23,55 @@ export class ForgotComponent implements OnInit {
|
|
|
|
|
public P_USER_NAME: string;
|
|
|
|
|
public logo = "assets/icon/login/lock.png";
|
|
|
|
|
public recentPasswordNote = {
|
|
|
|
|
yellowImg: '../assets/icon/yellow.svg',
|
|
|
|
|
yellowImg: '../assets/imgs/mohemm-action/info.png',
|
|
|
|
|
text: 'Do not user recent password'
|
|
|
|
|
};
|
|
|
|
|
public isLowerCase = {
|
|
|
|
|
blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
greenImg: '../assets/icon/green.svg',
|
|
|
|
|
redImg: '../assets/imgs/close.svg',
|
|
|
|
|
text: 'At least one lowercase',
|
|
|
|
|
isMatch: false
|
|
|
|
|
};
|
|
|
|
|
public isUpperCase = {
|
|
|
|
|
blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
greenImg: '../assets/icon/green.svg',
|
|
|
|
|
redImg: '../assets/imgs/close.svg',
|
|
|
|
|
text: 'At least one uppdercase',
|
|
|
|
|
isMatch: false
|
|
|
|
|
};
|
|
|
|
|
public isHasDigit = {
|
|
|
|
|
blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
greenImg: '../assets/icon/green.svg',
|
|
|
|
|
redImg: '../assets/imgs/close.svg',
|
|
|
|
|
text: 'At least one nomeric',
|
|
|
|
|
isMatch: false
|
|
|
|
|
};
|
|
|
|
|
public isMinLength = {
|
|
|
|
|
blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
greenImg: '../assets/icon/green.svg',
|
|
|
|
|
redImg: '../assets/imgs/close.svg',
|
|
|
|
|
text: 'Minimum 8 characters',
|
|
|
|
|
isMatch: false
|
|
|
|
|
};
|
|
|
|
|
public isRepeatedLetter = {
|
|
|
|
|
blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
greenImg: '../assets/icon/green.svg',
|
|
|
|
|
redImg: '../assets/imgs/close.svg',
|
|
|
|
|
text: 'Do not add repeating letters',
|
|
|
|
|
isMatch: false
|
|
|
|
|
};
|
|
|
|
|
public isContainSpecialChar = {
|
|
|
|
|
blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
greenImg: '../assets/icon/green.svg',
|
|
|
|
|
redImg: '../assets/imgs/close.svg',
|
|
|
|
|
text: 'It should contain special character',
|
|
|
|
|
isMatch: false
|
|
|
|
|
};
|
|
|
|
|
public confirmMatchNew = {
|
|
|
|
|
blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
greenImg: '../assets/icon/green.svg',
|
|
|
|
|
redImg: '../assets/imgs/close.svg',
|
|
|
|
|
text: 'Confirm Password does not match.',
|
|
|
|
|
isMatch: false
|
|
|
|
|
};
|
|
|
|
|
@ -157,7 +164,7 @@ export class ForgotComponent implements OnInit {
|
|
|
|
|
return this.isLowerCase.greenImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.isLowerCase.isMatch = false;
|
|
|
|
|
return this.isLowerCase.blankImg;
|
|
|
|
|
return this.isLowerCase.redImg;
|
|
|
|
|
}
|
|
|
|
|
case 2:
|
|
|
|
|
if (/[A-Z]/.test(this.P_NEW_PASSWORD)) {
|
|
|
|
|
@ -165,7 +172,7 @@ export class ForgotComponent implements OnInit {
|
|
|
|
|
return this.isUpperCase.greenImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.isUpperCase.isMatch = false;
|
|
|
|
|
return this.isUpperCase.blankImg;
|
|
|
|
|
return this.isUpperCase.redImg;
|
|
|
|
|
}
|
|
|
|
|
case 3:
|
|
|
|
|
if (/[0-9]/.test(this.P_NEW_PASSWORD)) {
|
|
|
|
|
@ -173,7 +180,7 @@ export class ForgotComponent implements OnInit {
|
|
|
|
|
return this.isHasDigit.greenImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.isHasDigit.isMatch = false;
|
|
|
|
|
return this.isHasDigit.blankImg;
|
|
|
|
|
return this.isHasDigit.redImg;
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
if (this.P_NEW_PASSWORD.length >= 8) {
|
|
|
|
|
@ -181,12 +188,12 @@ export class ForgotComponent implements OnInit {
|
|
|
|
|
return this.isMinLength.greenImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.isMinLength.isMatch = false;
|
|
|
|
|
return this.isMinLength.blankImg;
|
|
|
|
|
return this.isMinLength.redImg;
|
|
|
|
|
}
|
|
|
|
|
case 5:
|
|
|
|
|
if (/([a-z])\1/i.test(this.P_NEW_PASSWORD)) {
|
|
|
|
|
this.isRepeatedLetter.isMatch = false;
|
|
|
|
|
return this.isRepeatedLetter.blankImg;
|
|
|
|
|
return this.isRepeatedLetter.redImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.isRepeatedLetter.isMatch = true;
|
|
|
|
|
return this.isRepeatedLetter.greenImg;
|
|
|
|
|
@ -197,14 +204,14 @@ export class ForgotComponent implements OnInit {
|
|
|
|
|
return this.isContainSpecialChar.greenImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.isContainSpecialChar.isMatch = false;
|
|
|
|
|
return this.isContainSpecialChar.blankImg;
|
|
|
|
|
return this.isContainSpecialChar.redImg;
|
|
|
|
|
}
|
|
|
|
|
case 7:
|
|
|
|
|
if (this.P_NEW_PASSWORD !== this.P_Confirm_NEW_PASSWORD) {
|
|
|
|
|
this.confirmMatchNew.isMatch = true;
|
|
|
|
|
return this.confirmMatchNew.blankImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.confirmMatchNew.isMatch = false;
|
|
|
|
|
return this.confirmMatchNew.redImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.confirmMatchNew.isMatch = true;
|
|
|
|
|
return this.confirmMatchNew.greenImg;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -213,9 +220,9 @@ export class ForgotComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
disabledSubmitBtn() {
|
|
|
|
|
if (this.isLowerCase.isMatch && this.isUpperCase.isMatch && this.isHasDigit.isMatch && this.isMinLength.isMatch
|
|
|
|
|
&& this.isRepeatedLetter.isMatch && this.P_NEW_PASSWORD !== '' && this.P_NEW_PASSWORD
|
|
|
|
|
&& this.P_Confirm_NEW_PASSWORD && this.isContainSpecialChar) {
|
|
|
|
|
return false;
|
|
|
|
|
&& this.isRepeatedLetter.isMatch && this.P_NEW_PASSWORD !== '' && this.P_NEW_PASSWORD
|
|
|
|
|
&& this.P_Confirm_NEW_PASSWORD && this.isContainSpecialChar && this.confirmMatchNew.isMatch) {
|
|
|
|
|
return false;
|
|
|
|
|
} else { return true; }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|