mekawy-issues
ashwaq 6 years ago
parent 23059e2fcc
commit 2397fc1482

@ -27,33 +27,42 @@
<img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,currentPassword' | translate}}</ion-label> -->
<ion-input class="login-input" required type="password" placeholder="{{ts.trPK('changePassword','currentPassword')}}"[(ngModel)]="P_OLD_PASSWORD"></ion-input>
<ion-input class="login-input" required type="password"
placeholder="{{ts.trPK('changePassword','currentPassword')}}"
[(ngModel)]="P_OLD_PASSWORD"
minLength="8" min="8"
(ionChange)="onChangeOP()"
></ion-input>
</ion-item>
<p class="headerTxt" color="light" > {{'changePassword,newPassword' | translate}}</p>
<ion-item class="item-input-login" >
<img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,newPassword' | translate}}</ion-label> -->
<ion-input class="login-input" required type="password" placeholder="{{ts.trPK('changePassword','newPassword')}}"
[(ngModel)]="P_NEW_PASSWORD">
<ion-input (ionChange)="onChangeNP()" class="login-input" required type="password" placeholder="{{ts.trPK('changePassword','newPassword')}}"
[(ngModel)]="P_NEW_PASSWORD" minLength="8" min="8" >
</ion-input>
</ion-item>
<ion-item class="item-input-login" >
<img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,confirmPassword' | translate}}</ion-label> -->
<ion-input class="login-input" required type="password" placeholder="{{ts.trPK('changePassword','confirmPassword')}}"
[(ngModel)]="P_Confirm_NEW_PASSWORD">
<ion-input (ionChange)="onChangeCNP()" class="login-input" required type="password" placeholder="{{ts.trPK('changePassword','confirmPassword')}}"
[(ngModel)]="P_Confirm_NEW_PASSWORD" minLength="8" min="8">
</ion-input>
</ion-item>
</ion-grid>
<page-trailer [small]="true"></page-trailer>
<!-- [disabled]="NEW_PASSWORD && Confirm_NEW_PASSWORD" [disabled]="true"-->
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button class="button-login" ion-button (click)="submit()">{{ts.trPK('login','changepassword')}}</ion-button>
<button [disabled]="!(NEW_PASSWORD && Confirm_NEW_PASSWORD && OLD_PASSWORD)" [ngClass]=" !(NEW_PASSWORD && Confirm_NEW_PASSWORD && OLD_PASSWORD) ? 'disabledButton' : '' " class="button-login" ion-button (click)="submit()">{{ts.trPK('login','changepassword')}}</button>
</div>
</ion-footer>

@ -29,3 +29,7 @@
width: 315px;
}
.disabledButton{
opacity:.5;
}

@ -12,6 +12,7 @@ import { SharedDataService } from 'src/app/hmg-common/services/shared-data-servi
import {LoginComponent} from "src/app/authentication/login/login.component";
import { Password } from '../models/password';
import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user";
//import { FormBuilder, FormGroup, Validators } from '@angular/forms';
@Component({
selector: 'app-change-password',
@ -28,6 +29,11 @@ export class ChangePasswordComponent implements OnInit {
userData: any = {};
public isExpiredPwd: boolean = false;
public NEW_PASSWORD: boolean = false;
public Confirm_NEW_PASSWORD: boolean = false;
public OLD_PASSWORD: boolean = false;
//public profile_form: FormGroup;
constructor(
public cs: CommonService,
public authService: AuthenticationService,
@ -36,7 +42,9 @@ export class ChangePasswordComponent implements OnInit {
public ts: TranslatorService,
public smsService: SmsReaderService,
public changeDetector: ChangeDetectorRef,
public sharedData: SharedDataService) {
public sharedData: SharedDataService,
// public formBuilder: FormBuilder,
) {
console.log("change password constructor");
}
@ -48,6 +56,11 @@ export class ChangePasswordComponent implements OnInit {
this.P_USER_NAME =data.P_USER_NAME;
console.log(this.isExpiredPwd);
console.log(this.P_USER_NAME);
// this.profile_form = this.formBuilder.group({
// password: ['', Validators.compose([Validators.minLength(8)])]
// });
// this.authService
// .loadAuthenticatedUser()
// .subscribe((user: AuthenticatedUser) => {
@ -119,6 +132,43 @@ export class ChangePasswordComponent implements OnInit {
}
});
}
onChangeCNP(){
// in UAT Alow to the length of password less than 8
// so if we ready to go life change it to >= 8
if (this.P_Confirm_NEW_PASSWORD.length >= 3) {
this.Confirm_NEW_PASSWORD=true;
}else{
this.Confirm_NEW_PASSWORD=false;
}
}
onChangeNP(){
// in UAT Alow to the length of password less than 8
// so if we ready to go life change it to >= 8
if (this.P_NEW_PASSWORD.length >= 3) {
this.NEW_PASSWORD=true;
}else{
this.NEW_PASSWORD=false;
}
}
onChangeOP(){
// in UAT Alow to the length of password less than 8
// so if we ready to go life change it to >= 8
if (this.P_OLD_PASSWORD.length >= 3) {
this.OLD_PASSWORD=true;
}else{
this.OLD_PASSWORD=false;
}
}
}

@ -1211,6 +1211,10 @@ public getMonthNameAr(value: number): string {
public openPerformanceevaluation() {
this.nav.navigateForward(["/profile/performanceevaluation"]);
}
public eitUpdate() {
this.nav.navigateForward(["/eit/eit-update-list"]);
}
public navigatePage(path) {

@ -542,6 +542,7 @@ export class WorklistMainComponent implements OnInit {
EITNotificatonBodyResponse.NOT_WORKLIST
);
// this.navCtrl.push("EitUpdateListPage");
this.common.eitUpdate();// must be test
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") {
this.common.sharedService.setSharedData(
this.notificationBodyRes,

Loading…
Cancel
Save