+
@@ -27,6 +24,8 @@
-
{{ 'AbpIdentity::Save' | abpLocalization }}
+
{{
+ 'AbpIdentity::Save' | abpLocalization
+ }}
diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/change-password/change-password.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/change-password/change-password.component.ts
index 00d285b3c5..1f7dcab4af 100644
--- a/npm/ng-packs/packages/theme-shared/src/lib/components/change-password/change-password.component.ts
+++ b/npm/ng-packs/packages/theme-shared/src/lib/components/change-password/change-password.component.ts
@@ -11,7 +11,7 @@ import {
ViewChild,
} from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
-import { comparePasswords } from '@ngx-validate/core';
+import { comparePasswords, Validation } from '@ngx-validate/core';
import { Store } from '@ngxs/store';
import snq from 'snq';
import { finalize } from 'rxjs/operators';
@@ -19,6 +19,8 @@ import { ToasterService } from '../../services/toaster.service';
const { minLength, required } = Validators;
+const PASSWORD_FIELDS = ['newPassword', 'repeatNewPassword'];
+
@Component({
selector: 'abp-change-password',
templateUrl: './change-password.component.html',
@@ -46,6 +48,12 @@ export class ChangePasswordComponent implements OnInit, OnChanges {
modalBusy: boolean = false;
+ mapErrorsFn: Validation.MapErrorsFn = function(errors, groupErrors, control) {
+ if (PASSWORD_FIELDS.indexOf(control.name) < 0) return errors;
+
+ return errors.concat(groupErrors.filter(({ key }) => key === 'passwordMismatch'));
+ };
+
constructor(private fb: FormBuilder, private store: Store, private toasterService: ToasterService) {}
ngOnInit(): void {
@@ -56,7 +64,7 @@ export class ChangePasswordComponent implements OnInit, OnChanges {
repeatNewPassword: ['', required],
},
{
- validators: [comparePasswords(['newPassword', 'repeatNewPassword'])],
+ validators: [comparePasswords(PASSWORD_FIELDS)],
},
);
}
diff --git a/npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts b/npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts
index 40f09d6c5f..c6dddaa04f 100644
--- a/npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts
+++ b/npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts
@@ -18,6 +18,7 @@ import styles from './contants/styles';
import { ErrorHandler } from './handlers/error.handler';
import { chartJsLoaded$ } from './utils/widget-utils';
import { TableEmptyMessageComponent } from './components/table-empty-message/table-empty-message.component';
+import { NgxValidateCoreModule } from '@ngx-validate/core';
export function appendScript(injector: Injector) {
const fn = function() {
@@ -40,7 +41,7 @@ export function appendScript(injector: Injector) {
}
@NgModule({
- imports: [CoreModule, ToastModule],
+ imports: [CoreModule, ToastModule, NgxValidateCoreModule],
declarations: [
BreadcrumbComponent,
ButtonComponent,