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 --- .../+register/register-step-channel.component.ts | 10 +++++----- .../+register/register-step-user.component.ts | 22 ++++++++++++++-------- .../verify-account-ask-send-email.component.ts | 6 +++--- 3 files changed, 22 insertions(+), 16 deletions(-) (limited to 'client/src/app/+signup') diff --git a/client/src/app/+signup/+register/register-step-channel.component.ts b/client/src/app/+signup/+register/register-step-channel.component.ts index 8a0120840..d965a7865 100644 --- a/client/src/app/+signup/+register/register-step-channel.component.ts +++ b/client/src/app/+signup/+register/register-step-channel.component.ts @@ -3,7 +3,8 @@ import { pairwise } from 'rxjs/operators' import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' import { FormGroup } from '@angular/forms' import { UserService } from '@app/core' -import { FormReactive, FormValidatorService, VideoChannelValidatorsService } from '@app/shared/shared-forms' +import { VIDEO_CHANNEL_DISPLAY_NAME_VALIDATOR, VIDEO_CHANNEL_NAME_VALIDATOR } from '@app/shared/form-validators/video-channel-validators' +import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' @Component({ selector: 'my-register-step-channel', @@ -16,8 +17,7 @@ export class RegisterStepChannelComponent extends FormReactive implements OnInit constructor ( protected formValidatorService: FormValidatorService, - private userService: UserService, - private videoChannelValidatorsService: VideoChannelValidatorsService + private userService: UserService ) { super() } @@ -28,8 +28,8 @@ export class RegisterStepChannelComponent extends FormReactive implements OnInit ngOnInit () { this.buildForm({ - displayName: this.videoChannelValidatorsService.VIDEO_CHANNEL_DISPLAY_NAME, - name: this.videoChannelValidatorsService.VIDEO_CHANNEL_NAME + displayName: VIDEO_CHANNEL_DISPLAY_NAME_VALIDATOR, + name: VIDEO_CHANNEL_NAME_VALIDATOR }) setTimeout(() => this.formBuilt.emit(this.form)) diff --git a/client/src/app/+signup/+register/register-step-user.component.ts b/client/src/app/+signup/+register/register-step-user.component.ts index 3d9ab8b6b..65536568b 100644 --- a/client/src/app/+signup/+register/register-step-user.component.ts +++ b/client/src/app/+signup/+register/register-step-user.component.ts @@ -3,7 +3,14 @@ import { pairwise } from 'rxjs/operators' import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' import { FormGroup } from '@angular/forms' import { UserService } from '@app/core' -import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' +import { + USER_DISPLAY_NAME_REQUIRED_VALIDATOR, + USER_EMAIL_VALIDATOR, + USER_PASSWORD_VALIDATOR, + USER_TERMS_VALIDATOR, + USER_USERNAME_VALIDATOR +} from '@app/shared/form-validators/user-validators' +import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' @Component({ selector: 'my-register-step-user', @@ -19,8 +26,7 @@ export class RegisterStepUserComponent extends FormReactive implements OnInit { constructor ( protected formValidatorService: FormValidatorService, - private userService: UserService, - private userValidatorsService: UserValidatorsService + private userService: UserService ) { super() } @@ -31,11 +37,11 @@ export class RegisterStepUserComponent extends FormReactive implements OnInit { ngOnInit () { this.buildForm({ - displayName: this.userValidatorsService.USER_DISPLAY_NAME_REQUIRED, - username: this.userValidatorsService.USER_USERNAME, - password: this.userValidatorsService.USER_PASSWORD, - email: this.userValidatorsService.USER_EMAIL, - terms: this.userValidatorsService.USER_TERMS + displayName: USER_DISPLAY_NAME_REQUIRED_VALIDATOR, + username: USER_USERNAME_VALIDATOR, + password: USER_PASSWORD_VALIDATOR, + email: USER_EMAIL_VALIDATOR, + terms: USER_TERMS_VALIDATOR }) setTimeout(() => this.formBuilt.emit(this.form)) diff --git a/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts index b26581d2b..830dd9962 100644 --- a/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts +++ b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from '@angular/core' import { Notifier, RedirectService, ServerService, UserService } from '@app/core' -import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' +import { USER_EMAIL_VALIDATOR } from '@app/shared/form-validators/user-validators' +import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' import { ServerConfig } from '@shared/models' @Component({ @@ -14,7 +15,6 @@ export class VerifyAccountAskSendEmailComponent extends FormReactive implements constructor ( protected formValidatorService: FormValidatorService, - private userValidatorsService: UserValidatorsService, private userService: UserService, private serverService: ServerService, private notifier: Notifier, @@ -33,7 +33,7 @@ export class VerifyAccountAskSendEmailComponent extends FormReactive implements .subscribe(config => this.serverConfig = config) this.buildForm({ - 'verify-email-email': this.userValidatorsService.USER_EMAIL + 'verify-email-email': USER_EMAIL_VALIDATOR }) } -- cgit v1.2.3