diff options
Diffstat (limited to 'client/src/app/+admin/users')
3 files changed, 32 insertions, 18 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' | |||
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { ConfigService } from '@app/+admin/config/shared/config.service' | 3 | import { ConfigService } from '@app/+admin/config/shared/config.service' |
4 | import { AuthService, Notifier, ScreenService, ServerService, UserService } from '@app/core' | 4 | import { AuthService, Notifier, ScreenService, ServerService, UserService } from '@app/core' |
5 | import { FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' | 5 | import { |
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' | ||
15 | import { FormValidatorService } from '@app/shared/shared-forms' | ||
6 | import { UserCreate, UserRole } from '@shared/models' | 16 | import { UserCreate, UserRole } from '@shared/models' |
7 | import { UserEdit } from './user-edit' | 17 | import { 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 | } |
diff --git a/client/src/app/+admin/users/user-edit/user-password.component.ts b/client/src/app/+admin/users/user-edit/user-password.component.ts index 25f13495a..05d52b17f 100644 --- a/client/src/app/+admin/users/user-edit/user-password.component.ts +++ b/client/src/app/+admin/users/user-edit/user-password.component.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { Component, Input, OnInit } from '@angular/core' | 1 | import { Component, Input, OnInit } from '@angular/core' |
2 | import { Notifier, UserService } from '@app/core' | 2 | import { Notifier, UserService } from '@app/core' |
3 | import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' | 3 | import { USER_PASSWORD_VALIDATOR } from '@app/shared/form-validators/user-validators' |
4 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' | ||
4 | import { UserUpdate } from '@shared/models' | 5 | import { UserUpdate } from '@shared/models' |
5 | 6 | ||
6 | @Component({ | 7 | @Component({ |
@@ -17,7 +18,6 @@ export class UserPasswordComponent extends FormReactive implements OnInit { | |||
17 | 18 | ||
18 | constructor ( | 19 | constructor ( |
19 | protected formValidatorService: FormValidatorService, | 20 | protected formValidatorService: FormValidatorService, |
20 | private userValidatorsService: UserValidatorsService, | ||
21 | private notifier: Notifier, | 21 | private notifier: Notifier, |
22 | private userService: UserService | 22 | private userService: UserService |
23 | ) { | 23 | ) { |
@@ -26,7 +26,7 @@ export class UserPasswordComponent extends FormReactive implements OnInit { | |||
26 | 26 | ||
27 | ngOnInit () { | 27 | ngOnInit () { |
28 | this.buildForm({ | 28 | this.buildForm({ |
29 | password: this.userValidatorsService.USER_PASSWORD | 29 | password: USER_PASSWORD_VALIDATOR |
30 | }) | 30 | }) |
31 | } | 31 | } |
32 | 32 | ||
diff --git a/client/src/app/+admin/users/user-edit/user-update.component.ts b/client/src/app/+admin/users/user-edit/user-update.component.ts index 55bc7290e..e16f66a2b 100644 --- a/client/src/app/+admin/users/user-edit/user-update.component.ts +++ b/client/src/app/+admin/users/user-edit/user-update.component.ts | |||
@@ -3,7 +3,13 @@ import { Component, OnDestroy, OnInit } from '@angular/core' | |||
3 | import { ActivatedRoute, Router } from '@angular/router' | 3 | import { ActivatedRoute, Router } from '@angular/router' |
4 | import { ConfigService } from '@app/+admin/config/shared/config.service' | 4 | import { ConfigService } from '@app/+admin/config/shared/config.service' |
5 | import { AuthService, Notifier, ScreenService, ServerService, User, UserService } from '@app/core' | 5 | import { AuthService, Notifier, ScreenService, ServerService, User, UserService } from '@app/core' |
6 | import { FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' | 6 | import { |
7 | USER_EMAIL_VALIDATOR, | ||
8 | USER_ROLE_VALIDATOR, | ||
9 | USER_VIDEO_QUOTA_DAILY_VALIDATOR, | ||
10 | USER_VIDEO_QUOTA_VALIDATOR | ||
11 | } from '@app/shared/form-validators/user-validators' | ||
12 | import { FormValidatorService } from '@app/shared/shared-forms' | ||
7 | import { User as UserType, UserAdminFlag, UserRole, UserUpdate } from '@shared/models' | 13 | import { User as UserType, UserAdminFlag, UserRole, UserUpdate } from '@shared/models' |
8 | import { UserEdit } from './user-edit' | 14 | import { UserEdit } from './user-edit' |
9 | 15 | ||
@@ -23,7 +29,6 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { | |||
23 | protected configService: ConfigService, | 29 | protected configService: ConfigService, |
24 | protected screenService: ScreenService, | 30 | protected screenService: ScreenService, |
25 | protected auth: AuthService, | 31 | protected auth: AuthService, |
26 | private userValidatorsService: UserValidatorsService, | ||
27 | private route: ActivatedRoute, | 32 | private route: ActivatedRoute, |
28 | private router: Router, | 33 | private router: Router, |
29 | private notifier: Notifier, | 34 | private notifier: Notifier, |
@@ -44,10 +49,10 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { | |||
44 | } | 49 | } |
45 | 50 | ||
46 | this.buildForm({ | 51 | this.buildForm({ |
47 | email: this.userValidatorsService.USER_EMAIL, | 52 | email: USER_EMAIL_VALIDATOR, |
48 | role: this.userValidatorsService.USER_ROLE, | 53 | role: USER_ROLE_VALIDATOR, |
49 | videoQuota: this.userValidatorsService.USER_VIDEO_QUOTA, | 54 | videoQuota: USER_VIDEO_QUOTA_VALIDATOR, |
50 | videoQuotaDaily: this.userValidatorsService.USER_VIDEO_QUOTA_DAILY, | 55 | videoQuotaDaily: USER_VIDEO_QUOTA_DAILY_VALIDATOR, |
51 | byPassAutoBlock: null | 56 | byPassAutoBlock: null |
52 | }, defaultValues) | 57 | }, defaultValues) |
53 | 58 | ||