Browse Source

chore: change a variable name

pull/5086/head
mehmet-erim 6 years ago
parent
commit
514208cbf6
  1. 2
      npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.html
  2. 8
      npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.ts

2
npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.html

@ -1,5 +1,5 @@
<form [formGroup]="form" (ngSubmit)="onSubmit()" [mapErrorsFn]="mapErrorsFn" validateOnSubmit> <form [formGroup]="form" (ngSubmit)="onSubmit()" [mapErrorsFn]="mapErrorsFn" validateOnSubmit>
<div *ngIf="!hideOldPassword" class="form-group"> <div *ngIf="!hideCurrentPassword" class="form-group">
<label for="current-password">{{ <label for="current-password">{{
'AbpIdentity::DisplayName:CurrentPassword' | abpLocalization 'AbpIdentity::DisplayName:CurrentPassword' | abpLocalization
}}</label }}</label

8
npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.ts

@ -23,7 +23,7 @@ export class ChangePasswordComponent
inProgress: boolean; inProgress: boolean;
hideOldPassword: boolean; hideCurrentPassword: boolean;
mapErrorsFn: Validation.MapErrorsFn = (errors, groupErrors, control) => { mapErrorsFn: Validation.MapErrorsFn = (errors, groupErrors, control) => {
if (PASSWORD_FIELDS.indexOf(String(control.name)) < 0) return errors; if (PASSWORD_FIELDS.indexOf(String(control.name)) < 0) return errors;
@ -38,7 +38,7 @@ export class ChangePasswordComponent
) {} ) {}
ngOnInit(): void { ngOnInit(): void {
this.hideOldPassword = !this.store.selectSnapshot(ProfileState.getProfile).hasPassword; this.hideCurrentPassword = !this.store.selectSnapshot(ProfileState.getProfile).hasPassword;
const passwordValidations = getPasswordValidators(this.store); const passwordValidations = getPasswordValidators(this.store);
@ -63,7 +63,7 @@ export class ChangePasswordComponent
}, },
); );
if (this.hideOldPassword) this.form.removeControl('password'); if (this.hideCurrentPassword) this.form.removeControl('password');
} }
onSubmit() { onSubmit() {
@ -72,7 +72,7 @@ export class ChangePasswordComponent
this.store this.store
.dispatch( .dispatch(
new ChangePassword({ new ChangePassword({
...(!this.hideOldPassword && { currentPassword: this.form.get('password').value }), ...(!this.hideCurrentPassword && { currentPassword: this.form.get('password').value }),
newPassword: this.form.get('newPassword').value, newPassword: this.form.get('newPassword').value,
}), }),
) )

Loading…
Cancel
Save