import { Validators } from '@angular/forms';
import { Router } from '@angular/router';
-import { I18n } from '@ngx-translate/i18n-polyfill';
-import * as _ from 'lodash';
+import _ from 'lodash';
-import { UserService } from '../../../shared/api/user.service';
-import { ActionLabelsI18n } from '../../../shared/constants/app.constants';
-import { Icons } from '../../../shared/enum/icons.enum';
-import { NotificationType } from '../../../shared/enum/notification-type.enum';
-import { CdFormBuilder } from '../../../shared/forms/cd-form-builder';
-import { CdFormGroup } from '../../../shared/forms/cd-form-group';
-import { CdValidators } from '../../../shared/forms/cd-validators';
-import { AuthStorageService } from '../../../shared/services/auth-storage.service';
-import { NotificationService } from '../../../shared/services/notification.service';
-import { PasswordPolicyService } from '../../../shared/services/password-policy.service';
+import { UserService } from '~/app/shared/api/user.service';
+import { ActionLabelsI18n } from '~/app/shared/constants/app.constants';
+import { Icons } from '~/app/shared/enum/icons.enum';
+import { NotificationType } from '~/app/shared/enum/notification-type.enum';
+import { CdFormBuilder } from '~/app/shared/forms/cd-form-builder';
+import { CdFormGroup } from '~/app/shared/forms/cd-form-group';
+import { CdValidators } from '~/app/shared/forms/cd-validators';
+import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
+import { NotificationService } from '~/app/shared/services/notification.service';
+import { PasswordPolicyService } from '~/app/shared/services/password-policy.service';
@Component({
selector: 'cd-user-password-form',
icons = Icons;
constructor(
- public i18n: I18n,
public actionLabels: ActionLabelsI18n,
public notificationService: NotificationService,
public userService: UserService,
public passwordPolicyService: PasswordPolicyService
) {
this.action = this.actionLabels.CHANGE;
- this.resource = this.i18n('password');
+ this.resource = $localize`password`;
this.createForm();
}
* Override this in derived classes to change the behaviour.
*/
onPasswordChange() {
- this.notificationService.show(NotificationType.success, this.i18n('Updated user password"'));
+ this.notificationService.show(NotificationType.success, $localize`Updated user password"`);
this.router.navigate(['/login']);
}
}