aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/users/user-edit/user-create.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-17 11:47:04 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-08-17 15:12:55 +0200
commit7ed1edbbe4ffbef28093e4f5630751cb652814e4 (patch)
tree831862165dbfce593447a517c2294a7a4c28d840 /client/src/app/+admin/users/user-edit/user-create.component.ts
parent1a95f0b9627f8016767a5a386620cbc3335d5f93 (diff)
downloadPeerTube-7ed1edbbe4ffbef28093e4f5630751cb652814e4.tar.gz
PeerTube-7ed1edbbe4ffbef28093e4f5630751cb652814e4.tar.zst
PeerTube-7ed1edbbe4ffbef28093e4f5630751cb652814e4.zip
We don't need services anymore for validators
Diffstat (limited to 'client/src/app/+admin/users/user-edit/user-create.component.ts')
-rw-r--r--client/src/app/+admin/users/user-edit/user-create.component.ts27
1 files changed, 18 insertions, 9 deletions
diff --git a/client/src/app/+admin/users/user-edit/user-create.component.ts b/client/src/app/+admin/users/user-edit/user-create.component.ts
index 36d71a927..d0aac1cb9 100644
--- a/client/src/app/+admin/users/user-edit/user-create.component.ts
+++ b/client/src/app/+admin/users/user-edit/user-create.component.ts
@@ -2,7 +2,17 @@ import { Component, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { ConfigService } from '@app/+admin/config/shared/config.service' 3import { ConfigService } from '@app/+admin/config/shared/config.service'
4import { AuthService, Notifier, ScreenService, ServerService, UserService } from '@app/core' 4import { AuthService, Notifier, ScreenService, ServerService, UserService } from '@app/core'
5import { FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' 5import {
6 USER_CHANNEL_NAME_VALIDATOR,
7 USER_EMAIL_VALIDATOR,
8 USER_PASSWORD_OPTIONAL_VALIDATOR,
9 USER_PASSWORD_VALIDATOR,
10 USER_ROLE_VALIDATOR,
11 USER_USERNAME_VALIDATOR,
12 USER_VIDEO_QUOTA_DAILY_VALIDATOR,
13 USER_VIDEO_QUOTA_VALIDATOR
14} from '@app/shared/form-validators/user-validators'
15import { FormValidatorService } from '@app/shared/shared-forms'
6import { UserCreate, UserRole } from '@shared/models' 16import { UserCreate, UserRole } from '@shared/models'
7import { UserEdit } from './user-edit' 17import { UserEdit } from './user-edit'
8 18
@@ -20,7 +30,6 @@ export class UserCreateComponent extends UserEdit implements OnInit {
20 protected configService: ConfigService, 30 protected configService: ConfigService,
21 protected screenService: ScreenService, 31 protected screenService: ScreenService,
22 protected auth: AuthService, 32 protected auth: AuthService,
23 private userValidatorsService: UserValidatorsService,
24 private route: ActivatedRoute, 33 private route: ActivatedRoute,
25 private router: Router, 34 private router: Router,
26 private notifier: Notifier, 35 private notifier: Notifier,
@@ -41,13 +50,13 @@ export class UserCreateComponent extends UserEdit implements OnInit {
41 } 50 }
42 51
43 this.buildForm({ 52 this.buildForm({
44 username: this.userValidatorsService.USER_USERNAME, 53 username: USER_USERNAME_VALIDATOR,
45 channelName: this.userValidatorsService.USER_CHANNEL_NAME, 54 channelName: USER_CHANNEL_NAME_VALIDATOR,
46 email: this.userValidatorsService.USER_EMAIL, 55 email: USER_EMAIL_VALIDATOR,
47 password: this.isPasswordOptional() ? this.userValidatorsService.USER_PASSWORD_OPTIONAL : this.userValidatorsService.USER_PASSWORD, 56 password: this.isPasswordOptional() ? USER_PASSWORD_OPTIONAL_VALIDATOR : USER_PASSWORD_VALIDATOR,
48 role: this.userValidatorsService.USER_ROLE, 57 role: USER_ROLE_VALIDATOR,
49 videoQuota: this.userValidatorsService.USER_VIDEO_QUOTA, 58 videoQuota: USER_VIDEO_QUOTA_VALIDATOR,
50 videoQuotaDaily: this.userValidatorsService.USER_VIDEO_QUOTA_DAILY, 59 videoQuotaDaily: USER_VIDEO_QUOTA_DAILY_VALIDATOR,
51 byPassAutoBlock: null 60 byPassAutoBlock: null
52 }, defaultValues) 61 }, defaultValues)
53 } 62 }