From 7ed1edbbe4ffbef28093e4f5630751cb652814e4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 17 Aug 2020 11:47:04 +0200 Subject: We don't need services anymore for validators --- .../my-account-change-email.component.ts | 10 +++++----- .../my-account-change-password.component.ts | 10 +++++----- .../my-account-profile/my-account-profile.component.ts | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) (limited to 'client/src/app/+my-account/my-account-settings') diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts b/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts index 396936ef3..b2b7849c2 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts @@ -2,7 +2,8 @@ import { forkJoin } from 'rxjs' import { tap } from 'rxjs/operators' import { Component, OnInit } from '@angular/core' import { AuthService, ServerService, UserService } from '@app/core' -import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' +import { USER_EMAIL_VALIDATOR, USER_PASSWORD_VALIDATOR } from '@app/shared/form-validators/user-validators' +import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' import { User } from '@shared/models' @Component({ @@ -17,18 +18,17 @@ export class MyAccountChangeEmailComponent extends FormReactive implements OnIni constructor ( protected formValidatorService: FormValidatorService, - private userValidatorsService: UserValidatorsService, private authService: AuthService, private userService: UserService, private serverService: ServerService - ) { + ) { super() } ngOnInit () { this.buildForm({ - 'new-email': this.userValidatorsService.USER_EMAIL, - 'password': this.userValidatorsService.USER_PASSWORD + 'new-email': USER_EMAIL_VALIDATOR, + 'password': USER_PASSWORD_VALIDATOR }) this.user = this.authService.getUser() diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts index 91fe4ec72..ba68bab32 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts @@ -1,7 +1,8 @@ import { filter } from 'rxjs/operators' import { Component, OnInit } from '@angular/core' import { AuthService, Notifier, UserService } from '@app/core' -import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' +import { USER_CONFIRM_PASSWORD_VALIDATOR, USER_PASSWORD_VALIDATOR } from '@app/shared/form-validators/user-validators' +import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' import { User } from '@shared/models' @Component({ @@ -15,7 +16,6 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On constructor ( protected formValidatorService: FormValidatorService, - private userValidatorsService: UserValidatorsService, private notifier: Notifier, private authService: AuthService, private userService: UserService @@ -25,9 +25,9 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On ngOnInit () { this.buildForm({ - 'current-password': this.userValidatorsService.USER_PASSWORD, - 'new-password': this.userValidatorsService.USER_PASSWORD, - 'new-confirmed-password': this.userValidatorsService.USER_CONFIRM_PASSWORD + 'current-password': USER_PASSWORD_VALIDATOR, + 'new-password': USER_PASSWORD_VALIDATOR, + 'new-confirmed-password': USER_CONFIRM_PASSWORD_VALIDATOR }) this.user = this.authService.getUser() diff --git a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts index ed0984bf7..000a2c0ac 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts @@ -1,7 +1,8 @@ import { Subject } from 'rxjs' import { Component, Input, OnInit } from '@angular/core' import { Notifier, User, UserService } from '@app/core' -import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' +import { USER_DESCRIPTION_VALIDATOR, USER_DISPLAY_NAME_REQUIRED_VALIDATOR } from '@app/shared/form-validators/user-validators' +import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' @Component({ selector: 'my-account-profile', @@ -16,17 +17,16 @@ export class MyAccountProfileComponent extends FormReactive implements OnInit { constructor ( protected formValidatorService: FormValidatorService, - private userValidatorsService: UserValidatorsService, private notifier: Notifier, private userService: UserService - ) { + ) { super() } ngOnInit () { this.buildForm({ - 'display-name': this.userValidatorsService.USER_DISPLAY_NAME_REQUIRED, - description: this.userValidatorsService.USER_DESCRIPTION + 'display-name': USER_DISPLAY_NAME_REQUIRED_VALIDATOR, + description: USER_DESCRIPTION_VALIDATOR }) this.userInformationLoaded.subscribe(() => { -- cgit v1.2.3