Merge branch 'enad-pre-live' of https://gitlab.com/haroon6138/mohemmionic5 into enad-pre-live

MOE_DEV_NEW_TEMPORARY_DESIGN
Sultan Khan 4 years ago
commit 1be3babe65

@ -0,0 +1,17 @@
{
"name": "com.huawei.cordovahmsgmscheckplugin",
"version": "1.0.0",
"description": "Account Check Kit 4.0",
"cordova": {
"id": "com.huawei.cordovahmsgmscheckplugin",
"platforms": [
"android"
]
},
"keywords": [
"ecosystem:cordova",
"cordova-android"
],
"author": "",
"license": "ISC"
}

@ -0,0 +1,17 @@
{
"name": "com.huawei.cordovahmslocationplugin",
"version": "1.0.0",
"description": "Location Service",
"cordova": {
"id": "com.huawei.cordovahmslocationplugin",
"platforms": [
"android"
]
},
"keywords": [
"ecosystem:cordova",
"cordova-android"
],
"author": "",
"license": "ISC"
}

@ -0,0 +1,21 @@
{
"name": "cordovahmspushplugin",
"version": "1.0.0",
"description": "For Hms Push",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "test",
"license": "ISC",
"cordova": {
"id": "com.huawei.cordovahmspushplugin",
"platforms": [
"android"
]
},
"keywords": [
"ecosystem:cordova",
"cordova-android"
]
}

@ -254,4 +254,5 @@
"ios" "ios"
] ]
} }
} }

@ -159,6 +159,14 @@
{{ts.trPK('userProfile','title')}} {{ts.trPK('userProfile','title')}}
</ion-label> </ion-label>
</ion-item> </ion-item>
<ion-item (click)="performanceEvaluation()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 24px !important;" src="../assets/icon/bar-chart.svg" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{ts.trPK('userProfile','performance-evaluation')}}
</ion-label>
</ion-item>
<ion-item [hidden]="TeamFlag!='true'" (click)="openMyTeamPage()"> <ion-item [hidden]="TeamFlag!='true'" (click)="openMyTeamPage()">
<ion-thumbnail slot="start" class="menu-thumb"> <ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 14px !important;" src="../assets/imgs/my_team_icon.png" item-left> <img style= "height: 14px !important;" src="../assets/imgs/my_team_icon.png" item-left>

@ -51,7 +51,8 @@
</ion-grid> --> </ion-grid> -->
<div style="height: 320px; width: 320px; transform: rotate(90deg) !important;"> <div style="height: 320px; width: 320px; transform: rotate(90deg) !important;">
<img style="width: 100px; margin-left: 20px; margin-top: 26px;" [src]='userInfo.company_logo' alt="https://hmgwebservices.com/images/Moheem/CS.jpg"/> <img style="width: 100px; margin-left: 20px; margin-top: 26px;" [src]='userInfo.company_logo' alt="https://hmgwebservices.com/images/Moheem/CS.jpg"/>
<h1 class='font-text-style' style="font-size: 25px !important; margin-left: 20px; margin-top: 5px; margin-bottom: 0px;">{{userInfo.name_en}}</h1> <h1 *ngIf="direction === 'en'" class='font-text-style' style="font-size: 25px !important; margin-left: 20px; margin-top: 5px; margin-bottom: 0px;">{{userInfo.name_en}}</h1>
<h1 *ngIf="direction === 'ar'" class='font-text-style' style="font-size: 25px !important; margin-left: 20px; margin-top: 5px; margin-bottom: 0px;">{{userInfo.name_ar}}</h1>
<h5 class='font-text-style' style="margin-left: 20px; margin-top: 0px; ">{{jobName}}</h5> <h5 class='font-text-style' style="margin-left: 20px; margin-top: 0px; ">{{jobName}}</h5>
<h5 class='font-text-style' style="margin-left: 20px; font-size: 18px; margin-bottom: 0px;">{{userInfo.mobile}}</h5> <h5 class='font-text-style' style="margin-left: 20px; font-size: 18px; margin-bottom: 0px;">{{userInfo.mobile}}</h5>
<h5 class='font-text-style' style="margin-left: 20px; margin-top: 5px; font-size: 12px; margin-bottom: 5px; white-space: nowrap;">{{userInfo.email}}</h5> <h5 class='font-text-style' style="margin-left: 20px; margin-top: 5px; font-size: 12px; margin-bottom: 5px; white-space: nowrap;">{{userInfo.email}}</h5>

@ -15,6 +15,7 @@ export class BusinessCardComponent implements OnInit {
public userInfo: any; public userInfo: any;
public userJobName: any; public userJobName: any;
public jobName: any; public jobName: any;
direction: string;
constructor( constructor(
public modalCtrl: ModalController, public modalCtrl: ModalController,
public ts: TranslatorService, public ts: TranslatorService,
@ -24,6 +25,8 @@ export class BusinessCardComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info')); this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info'));
this.direction = TranslatorService.getCurrentLanguageName();
console.log(this.userInfo);
this.authService this.authService
.loadAuthenticatedUser() .loadAuthenticatedUser()

@ -17,9 +17,11 @@
<ion-item class="item-input-login"> <ion-item class="item-input-login">
<img class="item-icon" src="assets/imgs/password.png" item-start /> <img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,currentPassword' | translate}}</ion-label> --> <!-- <ion-label>{{'changePassword,currentPassword' | translate}}</ion-label> -->
<ion-input class="login-input" required type="password" <ion-input class="login-input" required [type]="currentPasswordIcon"
placeholder="{{ts.trPK('changePassword','currentPassword')}}" [(ngModel)]="P_OLD_PASSWORD" minLength="8" placeholder="{{ts.trPK('changePassword','currentPassword')}}" [(ngModel)]="P_OLD_PASSWORD" minLength="8"
min="8" (ionChange)="onChangeOP()"></ion-input> min="8" (ionChange)="onChangeOP()"></ion-input>
<ion-icon *ngIf='currentPasswordIcon === "text"' name="ios-eye" (click)="showPassword(3)"></ion-icon>
<ion-icon *ngIf='currentPasswordIcon === "password"' name="ios-eye-off" (click)="hidePassword(3)"></ion-icon>
</ion-item> </ion-item>
<p class="headerTxt" color="light"> {{'changePassword,newPassword' | translate}}</p> <p class="headerTxt" color="light"> {{'changePassword,newPassword' | translate}}</p>
@ -27,52 +29,64 @@
<ion-item class="item-input-login"> <ion-item class="item-input-login">
<img class="item-icon" src="assets/imgs/password.png" item-start /> <img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,newPassword' | translate}}</ion-label> --> <!-- <ion-label>{{'changePassword,newPassword' | translate}}</ion-label> -->
<ion-input (ionChange)="onChangeNP()" class="login-input" required type="password" <ion-input (ionChange)="onChangeNP()" class="login-input" required [type]="newPasswordIcon"
placeholder="{{ts.trPK('changePassword','newPassword')}}" [(ngModel)]="P_NEW_PASSWORD" minLength="8" placeholder="{{ts.trPK('changePassword','newPassword')}}" [(ngModel)]="P_NEW_PASSWORD" minLength="8"
min="8"> min="8">
</ion-input> </ion-input>
<ion-icon *ngIf='newPasswordIcon === "text"' name="ios-eye" (click)="showPassword(1)"></ion-icon>
<ion-icon *ngIf='newPasswordIcon === "password"' name="ios-eye-off" (click)="hidePassword(1)"></ion-icon>
</ion-item> </ion-item>
<ion-item class="item-input-login"> <ion-item class="item-input-login">
<img class="item-icon" src="assets/imgs/password.png" item-start /> <img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,confirmPassword' | translate}}</ion-label> --> <!-- <ion-label>{{'changePassword,confirmPassword' | translate}}</ion-label> -->
<ion-input (ionChange)="onChangeCNP()" class="login-input" required type="password" <ion-input (ionChange)="onChangeCNP()" class="login-input" required [type]="confirmPasswordIcon"
placeholder="{{ts.trPK('changePassword','confirmPassword')}}" [(ngModel)]="P_Confirm_NEW_PASSWORD" placeholder="{{ts.trPK('changePassword','confirmPassword')}}" [(ngModel)]="P_Confirm_NEW_PASSWORD"
minLength="8" min="8"> minLength="8" min="8">
</ion-input> </ion-input>
<ion-icon *ngIf='confirmPasswordIcon === "text"' name="ios-eye" (click)="showPassword(2)"></ion-icon>
<ion-icon *ngIf='confirmPasswordIcon === "password"' name="ios-eye-off" (click)="hidePassword(2)"></ion-icon>
</ion-item> </ion-item>
<ion-item lines='none'> <ion-item lines='none'>
<img class="item-icon " src="../assets/imgs/req info.svg" item-start /> <img class="item-icon " src="../assets/imgs/req info.svg" item-start />
<ion-label><p class="info">{{recentPasswordNote.text}}</p></ion-label> <ion-label><p class="info">{{recentPasswordNote.text}}</p></ion-label>
</ion-item> </ion-item>
<ion-item lines='none'> <!-- <ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(1)" item-start /> <img class="item-icon" [src]="checkerFuncation(1)" item-start />
<ion-label><p>{{isLowerCase.text}}</p></ion-label> <ion-label><p>{{isLowerCase.text}}</p></ion-label>
</ion-item> </ion-item>
<ion-item lines='none'> <ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(2)" item-start /> <img class="item-icon" [src]="checkerFuncation(2)" item-start />
<ion-label><p>{{isUpperCase.text}}</p></ion-label> <ion-label><p>{{isUpperCase.text}}</p></ion-label>
</ion-item> -->
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(1)" item-start />
<ion-label><p style="white-space: pre-wrap;">{{isLetterCase.text}}</p></ion-label>
</ion-item> </ion-item>
<ion-item lines='none'> <ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(3)" item-start /> <img class="item-icon" [src]="checkerFuncation(3)" item-start />
<ion-label><p>{{isHasDigit.text}}</p></ion-label> <ion-label><p style="white-space: pre-wrap;">{{isHasDigit.text}}</p></ion-label>
</ion-item> </ion-item>
<ion-item lines='none'> <ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(4)" item-start /> <img class="item-icon" [src]="checkerFuncation(4)" item-start />
<ion-label><p>{{isMinLength.text}}</p></ion-label> <ion-label><p style="white-space: pre-wrap;">{{isMinLength.text}}</p></ion-label>
</ion-item> </ion-item>
<ion-item lines='none'> <ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(5)" item-start /> <img class="item-icon" [src]="checkerFuncation(5)" item-start />
<ion-label><p>{{isRepeatedLetter.text}}</p></ion-label> <ion-label><p style="white-space: pre-wrap;">{{isRepeatedLetter.text}}</p></ion-label>
</ion-item> </ion-item>
<ion-item lines='none'> <ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(6)" item-start /> <img class="item-icon" [src]="checkerFuncation(6)" item-start />
<ion-label><p>{{isContainSpecialChar.text}}</p></ion-label> <ion-label><p style="white-space: pre-wrap;">{{isContainSpecialChar.text}}</p></ion-label>
</ion-item> </ion-item>
<ion-item lines='none'> <ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(7)" item-start /> <img class="item-icon" [src]="checkerFuncation(7)" item-start />
<ion-label><p>{{confirmMatchNew.text}}</p></ion-label> <ion-label><p style="white-space: pre-wrap;">{{confirmMatchNew.text}}</p></ion-label>
</ion-item>
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(8)" item-start />
<ion-label><p style="white-space: pre-wrap;">{{userNameMatchNew.text}}</p></ion-label>
</ion-item> </ion-item>
</ion-grid> </ion-grid>

@ -33,61 +33,78 @@ export class ChangePasswordComponent implements OnInit {
public NEW_PASSWORD: boolean = false; public NEW_PASSWORD: boolean = false;
public Confirm_NEW_PASSWORD: boolean = false; public Confirm_NEW_PASSWORD: boolean = false;
public OLD_PASSWORD: boolean = false; public OLD_PASSWORD: boolean = false;
public currentPasswordIcon = 'password';
public newPasswordIcon = 'password';
public confirmPasswordIcon = 'password';
public recentPasswordNote = { public recentPasswordNote = {
yellowImg: '../assets/icon/yellow.svg', yellowImg: '../assets/imgs/mohemm-action/info.png',
text: 'Do not user recent password', text: this.ts.trPK('login', 'current-password-validation')
}; };
public isLowerCase = { public isLowerCase = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'At least one lowercase', text: this.ts.trPK('login', 'lowercase-password-validation'),
isMatch: false isMatch: false
}; };
public isUpperCase = { public isUpperCase = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'At least one uppdercase', text: this.ts.trPK('login', 'uppercase-password-validation'),
isMatch: false
};
public isLetterCase = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'letter-password-validation'),
isMatch: false isMatch: false
}; };
public isHasDigit = { public isHasDigit = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'At least one nomeric', text: this.ts.trPK('login', 'numerica-password-validation'),
isMatch: false isMatch: false
}; };
public isMinLength = { public isMinLength = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'Minimum 8 characters', text: this.ts.trPK('login', 'min-password-validation'),
isMatch: false isMatch: false
}; };
public isRepeatedLetter = { public isRepeatedLetter = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'Do not add repeating letters', text: this.ts.trPK('login', 'repeating-password-validation'),
isMatch: false isMatch: false
}; };
public isContainSpecialChar = { public isContainSpecialChar = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'It should contain special character', text: this.ts.trPK('login', 'special-character-password-validation'),
isMatch: false isMatch: false
}; };
public confirmMatchNew = { public confirmMatchNew = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'Confirm Password does not match.', text: this.ts.trPK('login', 'not-match-password-validation'),
isMatch: false
};
public userNameMatchNew = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'contain-username-password-validation'),
isMatch: false isMatch: false
}; };
public userId: string;
constructor( constructor(
public cs: CommonService, public cs: CommonService,
@ -230,9 +247,7 @@ export class ChangePasswordComponent implements OnInit {
if (this.P_NEW_PASSWORD === '') { if (this.P_NEW_PASSWORD === '') {
switch (val) { switch (val) {
case 1: case 1:
return this.isLowerCase.blankImg; return this.isLetterCase.blankImg;
case 2:
return this.isUpperCase.blankImg;
case 3: case 3:
return this.isHasDigit.blankImg; return this.isHasDigit.blankImg;
case 4: case 4:
@ -243,24 +258,34 @@ export class ChangePasswordComponent implements OnInit {
return this.isContainSpecialChar.blankImg; return this.isContainSpecialChar.blankImg;
case 7: case 7:
return this.confirmMatchNew.blankImg; return this.confirmMatchNew.blankImg;
case 8:
return this.userNameMatchNew.blankImg;
} }
} else { } else {
switch (val) { switch (val) {
// case 1:
// if (/[a-z]/.test(this.P_NEW_PASSWORD)) {
// this.isLowerCase.isMatch = true;
// return this.isLowerCase.greenImg;
// } else {
// this.isLowerCase.isMatch = false;
// return this.isLowerCase.redImg;
// }
// case 2:
// if (/[A-Z]/.test(this.P_NEW_PASSWORD)) {
// this.isUpperCase.isMatch = true;
// return this.isUpperCase.greenImg;
// } else {
// this.isUpperCase.isMatch = false;
// return this.isUpperCase.redImg;
// }
case 1: case 1:
if (/[a-z]/.test(this.P_NEW_PASSWORD)) { if (/[a-zA-Z]/.test(this.P_NEW_PASSWORD)) {
this.isLowerCase.isMatch = true; this.isLetterCase.isMatch = true;
return this.isLowerCase.greenImg; return this.isLetterCase.greenImg;
} else {
this.isLowerCase.isMatch = false;
return this.isLowerCase.redImg;
}
case 2:
if (/[A-Z]/.test(this.P_NEW_PASSWORD)) {
this.isUpperCase.isMatch = true;
return this.isUpperCase.greenImg;
} else { } else {
this.isUpperCase.isMatch = false; this.isLetterCase.isMatch = false;
return this.isUpperCase.redImg; return this.isLetterCase.redImg;
} }
case 3: case 3:
if (/[0-9]/.test(this.P_NEW_PASSWORD)) { if (/[0-9]/.test(this.P_NEW_PASSWORD)) {
@ -302,17 +327,47 @@ export class ChangePasswordComponent implements OnInit {
this.confirmMatchNew.isMatch = true; this.confirmMatchNew.isMatch = true;
return this.confirmMatchNew.greenImg; return this.confirmMatchNew.greenImg;
} }
case 8:
if (!this.P_NEW_PASSWORD.includes(this.P_USER_NAME)) {
this.userNameMatchNew.isMatch = true;
return this.userNameMatchNew.greenImg;
} else {
this.userNameMatchNew.isMatch = false;
return this.userNameMatchNew.redImg;
}
} }
} }
} }
disabledSubmitBtn() { disabledSubmitBtn() {
if (this.isLowerCase.isMatch && this.isUpperCase.isMatch && this.isHasDigit.isMatch && this.isMinLength.isMatch if (this.isLetterCase.isMatch && this.isHasDigit.isMatch && this.isMinLength.isMatch
&& this.isRepeatedLetter.isMatch && this.P_NEW_PASSWORD !== '' && this.NEW_PASSWORD && this.isRepeatedLetter.isMatch && this.P_NEW_PASSWORD !== '' && this.NEW_PASSWORD
&& this.Confirm_NEW_PASSWORD && this.OLD_PASSWORD && this.isContainSpecialChar.isMatch && this.confirmMatchNew.isMatch) { && this.Confirm_NEW_PASSWORD && this.OLD_PASSWORD && this.isContainSpecialChar.isMatch && this.confirmMatchNew.isMatch) {
return false; return false;
} else { return true; } } else { return true; }
} }
showPassword(val) {
if (val === 1)
this.newPasswordIcon = 'password';
else if (val === 2) {
this.confirmPasswordIcon = 'password'
}
else {
this.currentPasswordIcon = 'password';
}
}
hidePassword(val) {
if (val === 1)
this.newPasswordIcon = 'text';
else if (val === 2) {
this.confirmPasswordIcon = 'text'
}
else {
this.currentPasswordIcon = 'text';
}
}
} }

@ -25,52 +25,64 @@
<ion-item class="item-input-login"> <ion-item class="item-input-login">
<img class="item-icon" src="assets/imgs/password.png" item-start /> <img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,newPassword' | translate}}</ion-label> --> <!-- <ion-label>{{'changePassword,newPassword' | translate}}</ion-label> -->
<ion-input class="login-input" required type="password" <ion-input class="login-input" required [type]="newPasswordIcon"
placeholder="{{ts.trPK('changePassword','newPassword')}}" placeholder="{{ts.trPK('changePassword','newPassword')}}"
[(ngModel)]="P_NEW_PASSWORD"> [(ngModel)]="P_NEW_PASSWORD">
</ion-input> </ion-input>
<ion-icon *ngIf='newPasswordIcon === "text"' name="ios-eye" (click)="showPassword(1)"></ion-icon>
<ion-icon *ngIf='newPasswordIcon === "password"' name="ios-eye-off" (click)="hidePassword(1)"></ion-icon>
</ion-item> </ion-item>
<ion-item class="item-input-login"> <ion-item class="item-input-login">
<img class="item-icon" src="assets/imgs/password.png" item-start /> <img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,confirmPassword' | translate}}</ion-label> --> <!-- <ion-label>{{'changePassword,confirmPassword' | translate}}</ion-label> -->
<ion-input class="login-input" required type="password" <ion-input class="login-input" required [type]="confirmPasswordIcon"
placeholder="{{ts.trPK('changePassword','confirmPassword')}}" placeholder="{{ts.trPK('changePassword','confirmPassword')}}"
[(ngModel)]="P_Confirm_NEW_PASSWORD"> [(ngModel)]="P_Confirm_NEW_PASSWORD">
</ion-input> </ion-input>
<ion-icon *ngIf='confirmPasswordIcon === "text"' name="ios-eye" (click)="showPassword(2)"></ion-icon>
<ion-icon *ngIf='confirmPasswordIcon === "password"' name="ios-eye-off" (click)="hidePassword(2)"></ion-icon>
</ion-item> </ion-item>
<ion-item lines='none'> <ion-item lines='none'>
<img class="item-icon" src="../assets/imgs/req info.svg" item-start /> <img class="item-icon" src="../assets/imgs/req info.svg" item-start />
<ion-label><p class="info">{{recentPasswordNote.text}}</p></ion-label> <ion-label><p class="info">{{recentPasswordNote.text}}</p></ion-label>
</ion-item> </ion-item>
<ion-item lines='none'> <!-- <ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(1)" item-start /> <img class="item-icon" [src]="checkerFuncation(1)" item-start />
<ion-label><p>{{isLowerCase.text}}</p></ion-label> <ion-label><p>{{isLowerCase.text}}</p></ion-label>
</ion-item> </ion-item>
<ion-item lines='none'> <ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(2)" item-start /> <img class="item-icon" [src]="checkerFuncation(2)" item-start />
<ion-label><p>{{isUpperCase.text}}</p></ion-label> <ion-label><p>{{isUpperCase.text}}</p></ion-label>
</ion-item> -->
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(1)" item-start />
<ion-label><p>{{isLetterCase.text}}</p></ion-label>
</ion-item> </ion-item>
<ion-item lines='none'> <ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(3)" item-start /> <img class="item-icon" [src]="checkerFuncation(3)" item-start />
<ion-label><p>{{isHasDigit.text}}</p></ion-label> <ion-label><p style="white-space: pre-wrap;">{{isHasDigit.text}}</p></ion-label>
</ion-item> </ion-item>
<ion-item lines='none'> <ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(4)" item-start /> <img class="item-icon" [src]="checkerFuncation(4)" item-start />
<ion-label><p>{{isMinLength.text}}</p></ion-label> <ion-label><p style="white-space: pre-wrap;">{{isMinLength.text}}</p></ion-label>
</ion-item> </ion-item>
<ion-item lines='none'> <ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(5)" item-start /> <img class="item-icon" [src]="checkerFuncation(5)" item-start />
<ion-label><p>{{isRepeatedLetter.text}}</p></ion-label> <ion-label><p style="white-space: pre-wrap;">{{isRepeatedLetter.text}}</p></ion-label>
</ion-item> </ion-item>
<ion-item lines='none'> <ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(6)" item-start /> <img class="item-icon" [src]="checkerFuncation(6)" item-start />
<ion-label><p>{{isContainSpecialChar.text}}</p></ion-label> <ion-label><p style="white-space: pre-wrap;">{{isContainSpecialChar.text}}</p></ion-label>
</ion-item> </ion-item>
<ion-item lines='none'> <ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(7)" item-start /> <img class="item-icon" [src]="checkerFuncation(7)" item-start />
<ion-label><p>{{confirmMatchNew.text}}</p></ion-label> <ion-label><p style="white-space: pre-wrap;">{{confirmMatchNew.text}}</p></ion-label>
</ion-item>
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(8)" item-start />
<ion-label><p style="white-space: pre-wrap;">{{userNameMatchNew.text}}</p></ion-label>
</ion-item> </ion-item>
</ion-grid> </ion-grid>
<page-trailer [small]="true"></page-trailer> <page-trailer [small]="true"></page-trailer>

@ -9,7 +9,6 @@ import { SmsReaderService } from 'src/app/hmg-common/services/sms/sms-reader.ser
import { ForgetPassword } from '../models/forget.password'; import { ForgetPassword } from '../models/forget.password';
import { LoginModel } from '../models/LoginModel'; import { LoginModel } from '../models/LoginModel';
import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
import { LoginComponent } from "src/app/authentication/login/login.component";
@Component({ @Component({
selector: 'app-forgot', selector: 'app-forgot',
templateUrl: './forgot.component.html', templateUrl: './forgot.component.html',
@ -18,63 +17,81 @@ import { LoginComponent } from "src/app/authentication/login/login.component";
export class ForgotComponent implements OnInit { export class ForgotComponent implements OnInit {
private loginData = new LoginModel(); private loginData = new LoginModel();
public P_NEW_PASSWORD: string = ''; public P_NEW_PASSWORD = '';
public P_Confirm_NEW_PASSWORD: string = ''; // tslint:disable-next-line: variable-name
public P_Confirm_NEW_PASSWORD = '';
public P_USER_NAME: string; public P_USER_NAME: string;
public logo = "assets/icon/login/lock.png"; public logo = 'assets/icon/login/lock.png';
public newPasswordIcon = "password";
public confirmPasswordIcon = "password";
public recentPasswordNote = { public recentPasswordNote = {
yellowImg: '../assets/imgs/mohemm-action/info.png', yellowImg: '../assets/imgs/mohemm-action/info.png',
text: 'Do not user recent password' text: this.ts.trPK('login', 'current-password-validation')
}; };
public isLowerCase = { public isLowerCase = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'At least one lowercase', text: this.ts.trPK('login', 'lowercase-password-validation'),
isMatch: false isMatch: false
}; };
public isUpperCase = { public isUpperCase = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'At least one uppdercase', text: this.ts.trPK('login', 'uppercase-password-validation'),
isMatch: false
};
public isLetterCase = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'letter-password-validation'),
isMatch: false isMatch: false
}; };
public isHasDigit = { public isHasDigit = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'At least one nomeric', text: this.ts.trPK('login', 'numerica-password-validation'),
isMatch: false isMatch: false
}; };
public isMinLength = { public isMinLength = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'Minimum 8 characters', text: this.ts.trPK('login', 'min-password-validation'),
isMatch: false isMatch: false
}; };
public isRepeatedLetter = { public isRepeatedLetter = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'Do not add repeating letters', text: this.ts.trPK('login', 'repeating-password-validation'),
isMatch: false isMatch: false
}; };
public isContainSpecialChar = { public isContainSpecialChar = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'It should contain special character', text: this.ts.trPK('login', 'special-character-password-validation'),
isMatch: false isMatch: false
}; };
public confirmMatchNew = { public confirmMatchNew = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'Confirm Password does not match.', text: this.ts.trPK('login', 'not-match-password-validation'),
isMatch: false isMatch: false
}; };
public userNameMatchNew = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'contain-username-password-validation'),
isMatch: false
};
public userId: string;
constructor( constructor(
public cs: CommonService, public cs: CommonService,
@ -88,16 +105,22 @@ export class ForgotComponent implements OnInit {
) { ) {
} }
ngOnInit() { } ngOnInit() {
console.log('ENAD >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>');
this.userId = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false).P_USER_NAME;
console.log(this.userId);
}
public onForgot() { public onForgot() {
this.sendSMSForForgotPassword(); this.sendSMSForForgotPassword();
} }
// tslint:disable-next-line: member-ordering
private checkUserResult: CheckUserAuthenticationResponse; private checkUserResult: CheckUserAuthenticationResponse;
private sendSMSForForgotPassword() { private sendSMSForForgotPassword() {
const request = new ForgetPassword(); const request = new ForgetPassword();
console.log(request);
this.authService.sendForgetPassword( this.authService.sendForgetPassword(
request, request,
() => { () => {
@ -117,7 +140,7 @@ export class ForgotComponent implements OnInit {
forgetPasswordTokenID = forgetPasswordTokenResult.ForgetPasswordTokenID; forgetPasswordTokenID = forgetPasswordTokenResult.ForgetPasswordTokenID;
} }
this.loginData.P_USER_NAME = this.P_USER_NAME; this.loginData.P_USER_NAME = this.P_USER_NAME;
let request: any = {}; const request: any = {};
request.P_Confirm_NEW_PASSWORD = this.P_NEW_PASSWORD; request.P_Confirm_NEW_PASSWORD = this.P_NEW_PASSWORD;
request.P_NEW_PASSWORD = this.P_Confirm_NEW_PASSWORD; request.P_NEW_PASSWORD = this.P_Confirm_NEW_PASSWORD;
request.P_USER_NAME = data.P_USER_NAME; request.P_USER_NAME = data.P_USER_NAME;
@ -126,12 +149,11 @@ export class ForgotComponent implements OnInit {
this.authService.submitForgetPassword( this.authService.submitForgetPassword(
request, request,
() => { () => {
//this.sendSMSForForgotPassword();
}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => { }, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
this.checkUserResult = result; this.checkUserResult = result;
console.log(result); console.log(result);
this.cs.toastPK("changePassword", "successChange"); this.cs.toastPK('changePassword', 'successChange');
this.cs.openLogin(); this.cs.openLogin();
} }
}); });
@ -141,10 +163,12 @@ export class ForgotComponent implements OnInit {
checkerFuncation(val) { checkerFuncation(val) {
if (this.P_NEW_PASSWORD === '') { if (this.P_NEW_PASSWORD === '') {
switch (val) { switch (val) {
// case 1:
// return this.isLowerCase.blankImg;
// case 2:
// return this.isUpperCase.blankImg;
case 1: case 1:
return this.isLowerCase.blankImg; return this.isLetterCase.blankImg;
case 2:
return this.isUpperCase.blankImg;
case 3: case 3:
return this.isHasDigit.blankImg; return this.isHasDigit.blankImg;
case 4: case 4:
@ -155,24 +179,34 @@ export class ForgotComponent implements OnInit {
return this.isContainSpecialChar.blankImg; return this.isContainSpecialChar.blankImg;
case 7: case 7:
return this.confirmMatchNew.blankImg; return this.confirmMatchNew.blankImg;
case 8:
return this.userNameMatchNew.blankImg;
} }
} else { } else {
switch (val) { switch (val) {
// case 1:
// if (/[a-z]/.test(this.P_NEW_PASSWORD)) {
// this.isLowerCase.isMatch = true;
// return this.isLowerCase.greenImg;
// } else {
// this.isLowerCase.isMatch = false;
// return this.isLowerCase.redImg;
// }
// case 2:
// if (/[A-Z]/.test(this.P_NEW_PASSWORD)) {
// this.isUpperCase.isMatch = true;
// return this.isUpperCase.greenImg;
// } else {
// this.isUpperCase.isMatch = false;
// return this.isUpperCase.redImg;
// }
case 1: case 1:
if (/[a-z]/.test(this.P_NEW_PASSWORD)) { if (/[a-zA-Z]/.test(this.P_NEW_PASSWORD)) {
this.isLowerCase.isMatch = true; this.isLetterCase.isMatch = true;
return this.isLowerCase.greenImg; return this.isLetterCase.greenImg;
} else { } else {
this.isLowerCase.isMatch = false; this.isLetterCase.isMatch = false;
return this.isLowerCase.redImg; return this.isLetterCase.redImg;
}
case 2:
if (/[A-Z]/.test(this.P_NEW_PASSWORD)) {
this.isUpperCase.isMatch = true;
return this.isUpperCase.greenImg;
} else {
this.isUpperCase.isMatch = false;
return this.isUpperCase.redImg;
} }
case 3: case 3:
if (/[0-9]/.test(this.P_NEW_PASSWORD)) { if (/[0-9]/.test(this.P_NEW_PASSWORD)) {
@ -214,15 +248,40 @@ export class ForgotComponent implements OnInit {
this.confirmMatchNew.isMatch = true; this.confirmMatchNew.isMatch = true;
return this.confirmMatchNew.greenImg; return this.confirmMatchNew.greenImg;
} }
case 8:
if (!this.P_NEW_PASSWORD.includes(this.userId)) {
this.userNameMatchNew.isMatch = true;
return this.userNameMatchNew.greenImg;
} else {
this.userNameMatchNew.isMatch = false;
return this.userNameMatchNew.redImg;
}
} }
} }
} }
disabledSubmitBtn() { disabledSubmitBtn() {
if (this.isLowerCase.isMatch && this.isUpperCase.isMatch && this.isHasDigit.isMatch && this.isMinLength.isMatch if (this.isLetterCase.isMatch && this.isHasDigit.isMatch && this.isMinLength.isMatch
&& this.isRepeatedLetter.isMatch && this.P_NEW_PASSWORD !== '' && this.P_NEW_PASSWORD && this.isRepeatedLetter.isMatch && this.P_NEW_PASSWORD !== '' && this.P_NEW_PASSWORD
&& this.P_Confirm_NEW_PASSWORD && this.isContainSpecialChar && this.confirmMatchNew.isMatch) { && this.P_Confirm_NEW_PASSWORD && this.isContainSpecialChar.isMatch && this.confirmMatchNew.isMatch) {
return false; return false;
} else { return true; } } else { return true; }
} }
showPassword(val) {
if (val == 1)
this.newPasswordIcon = 'password';
else {
this.confirmPasswordIcon = 'password'
}
}
hidePassword(val) {
if (val == 1)
this.newPasswordIcon = 'text';
else {
this.confirmPasswordIcon = 'text'
}
}
} }

@ -176,6 +176,46 @@
"check-user-text3": { "check-user-text3": {
"en": "will be sent to your mobile number", "en": "will be sent to your mobile number",
"ar": "سيتم ارساله الى رقم هاتفك" "ar": "سيتم ارساله الى رقم هاتفك"
},
"current-password-validation":{
"en":"Do not use a current password.",
"ar":"لا تستخدم كلمة المرور الحالية."
},
"lowercase-password-validation":{
"en":"At least one lowercase.",
"ar":"حرف صغير واحد على الأقل."
},
"uppercase-password-validation":{
"en":"At least one uppercase.",
"ar":"حرف كبير واحد على الأقل."
},
"letter-password-validation":{
"en":"At least one Letter.",
"ar":"حرف واحد على الأقل."
},
"numerica-password-validation":{
"en":"At least one numeric.",
"ar":"رقم واحد على الأقل."
},
"min-password-validation":{
"en":"Minimum 8 characters.",
"ar":"8 أحرف على الأقل."
},
"repeating-password-validation":{
"en":"Do not add repeating letters.",
"ar":"لا تقم بإضافة أحرف متكررة."
},
"special-character-password-validation":{
"en":"It should contain a special character.",
"ar":"يجب أن يحتوي على طابع خاص."
},
"not-match-password-validation":{
"en":"Confirm Password does not match.",
"ar":"تأكيد كلمة المرور لا يتطابق."
},
"contain-username-password-validation":{
"en":"The password should not contain the user name.",
"ar":"يجب ألا تحتوي كلمة المرور على اسم المستخدم."
} }
}, },
"verificationcode": { "verificationcode": {

Loading…
Cancel
Save