aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin')
-rw-r--r--client/src/app/+admin/config/config.routes.ts2
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts45
-rw-r--r--client/src/app/+admin/follows/follows.routes.ts4
-rw-r--r--client/src/app/+admin/moderation/moderation.routes.ts8
-rw-r--r--client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html33
-rw-r--r--client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.scss16
-rw-r--r--client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts3
-rw-r--r--client/src/app/+admin/plugins/plugins.routes.ts6
-rw-r--r--client/src/app/+admin/system/system.routes.ts8
-rw-r--r--client/src/app/+admin/users/user-edit/user-create.component.ts27
-rw-r--r--client/src/app/+admin/users/user-edit/user-password.component.ts6
-rw-r--r--client/src/app/+admin/users/user-edit/user-update.component.ts17
-rw-r--r--client/src/app/+admin/users/users.routes.ts6
13 files changed, 76 insertions, 105 deletions
diff --git a/client/src/app/+admin/config/config.routes.ts b/client/src/app/+admin/config/config.routes.ts
index 7c1a1a166..1b76b29cc 100644
--- a/client/src/app/+admin/config/config.routes.ts
+++ b/client/src/app/+admin/config/config.routes.ts
@@ -23,7 +23,7 @@ export const ConfigRoutes: Routes = [
23 component: EditCustomConfigComponent, 23 component: EditCustomConfigComponent,
24 data: { 24 data: {
25 meta: { 25 meta: {
26 title: 'Edit custom configuration' 26 title: $localize`Edit custom configuration`
27 } 27 }
28 } 28 }
29 } 29 }
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
index 3a60b144f..78e9dd5e5 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
@@ -5,12 +5,19 @@ import { ConfigService } from '@app/+admin/config/shared/config.service'
5import { Notifier } from '@app/core' 5import { Notifier } from '@app/core'
6import { ServerService } from '@app/core/server/server.service' 6import { ServerService } from '@app/core/server/server.service'
7import { 7import {
8 CustomConfigValidatorsService, 8 ADMIN_EMAIL_VALIDATOR,
9 FormReactive, 9 CACHE_CAPTIONS_SIZE_VALIDATOR,
10 FormValidatorService, 10 CACHE_PREVIEWS_SIZE_VALIDATOR,
11 SelectOptionsItem, 11 INDEX_URL_VALIDATOR,
12 UserValidatorsService 12 INSTANCE_NAME_VALIDATOR,
13} from '@app/shared/shared-forms' 13 INSTANCE_SHORT_DESCRIPTION_VALIDATOR,
14 SEARCH_INDEX_URL_VALIDATOR,
15 SERVICES_TWITTER_USERNAME_VALIDATOR,
16 SIGNUP_LIMIT_VALIDATOR,
17 TRANSCODING_THREADS_VALIDATOR
18} from '@app/shared/form-validators/custom-config-validators'
19import { USER_VIDEO_QUOTA_DAILY_VALIDATOR, USER_VIDEO_QUOTA_VALIDATOR } from '@app/shared/form-validators/user-validators'
20import { FormReactive, FormValidatorService, SelectOptionsItem } from '@app/shared/shared-forms'
14import { NgbNav } from '@ng-bootstrap/ng-bootstrap' 21import { NgbNav } from '@ng-bootstrap/ng-bootstrap'
15import { CustomConfig, ServerConfig } from '@shared/models' 22import { CustomConfig, ServerConfig } from '@shared/models'
16 23
@@ -37,8 +44,6 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
37 constructor ( 44 constructor (
38 private viewportScroller: ViewportScroller, 45 private viewportScroller: ViewportScroller,
39 protected formValidatorService: FormValidatorService, 46 protected formValidatorService: FormValidatorService,
40 private customConfigValidatorsService: CustomConfigValidatorsService,
41 private userValidatorsService: UserValidatorsService,
42 private notifier: Notifier, 47 private notifier: Notifier,
43 private configService: ConfigService, 48 private configService: ConfigService,
44 private serverService: ServerService 49 private serverService: ServerService
@@ -110,8 +115,8 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
110 115
111 const formGroupData: { [key in keyof CustomConfig ]: any } = { 116 const formGroupData: { [key in keyof CustomConfig ]: any } = {
112 instance: { 117 instance: {
113 name: this.customConfigValidatorsService.INSTANCE_NAME, 118 name: INSTANCE_NAME_VALIDATOR,
114 shortDescription: this.customConfigValidatorsService.INSTANCE_SHORT_DESCRIPTION, 119 shortDescription: INSTANCE_SHORT_DESCRIPTION_VALIDATOR,
115 description: null, 120 description: null,
116 121
117 isNSFW: false, 122 isNSFW: false,
@@ -143,21 +148,21 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
143 }, 148 },
144 services: { 149 services: {
145 twitter: { 150 twitter: {
146 username: this.customConfigValidatorsService.SERVICES_TWITTER_USERNAME, 151 username: SERVICES_TWITTER_USERNAME_VALIDATOR,
147 whitelisted: null 152 whitelisted: null
148 } 153 }
149 }, 154 },
150 cache: { 155 cache: {
151 previews: { 156 previews: {
152 size: this.customConfigValidatorsService.CACHE_PREVIEWS_SIZE 157 size: CACHE_PREVIEWS_SIZE_VALIDATOR
153 }, 158 },
154 captions: { 159 captions: {
155 size: this.customConfigValidatorsService.CACHE_CAPTIONS_SIZE 160 size: CACHE_CAPTIONS_SIZE_VALIDATOR
156 } 161 }
157 }, 162 },
158 signup: { 163 signup: {
159 enabled: null, 164 enabled: null,
160 limit: this.customConfigValidatorsService.SIGNUP_LIMIT, 165 limit: SIGNUP_LIMIT_VALIDATOR,
161 requiresEmailVerification: null 166 requiresEmailVerification: null
162 }, 167 },
163 import: { 168 import: {
@@ -171,18 +176,18 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
171 } 176 }
172 }, 177 },
173 admin: { 178 admin: {
174 email: this.customConfigValidatorsService.ADMIN_EMAIL 179 email: ADMIN_EMAIL_VALIDATOR
175 }, 180 },
176 contactForm: { 181 contactForm: {
177 enabled: null 182 enabled: null
178 }, 183 },
179 user: { 184 user: {
180 videoQuota: this.userValidatorsService.USER_VIDEO_QUOTA, 185 videoQuota: USER_VIDEO_QUOTA_VALIDATOR,
181 videoQuotaDaily: this.userValidatorsService.USER_VIDEO_QUOTA_DAILY 186 videoQuotaDaily: USER_VIDEO_QUOTA_DAILY_VALIDATOR
182 }, 187 },
183 transcoding: { 188 transcoding: {
184 enabled: null, 189 enabled: null,
185 threads: this.customConfigValidatorsService.TRANSCODING_THREADS, 190 threads: TRANSCODING_THREADS_VALIDATOR,
186 allowAdditionalExtensions: null, 191 allowAdditionalExtensions: null,
187 allowAudioFiles: null, 192 allowAudioFiles: null,
188 resolutions: {}, 193 resolutions: {},
@@ -213,7 +218,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
213 }, 218 },
214 autoFollowIndex: { 219 autoFollowIndex: {
215 enabled: null, 220 enabled: null,
216 indexUrl: this.customConfigValidatorsService.INDEX_URL 221 indexUrl: INDEX_URL_VALIDATOR
217 } 222 }
218 } 223 }
219 }, 224 },
@@ -230,7 +235,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
230 }, 235 },
231 searchIndex: { 236 searchIndex: {
232 enabled: null, 237 enabled: null,
233 url: this.customConfigValidatorsService.SEARCH_INDEX_URL, 238 url: SEARCH_INDEX_URL_VALIDATOR,
234 disableLocalSearch: null, 239 disableLocalSearch: null,
235 isDefaultSearch: null 240 isDefaultSearch: null
236 } 241 }
diff --git a/client/src/app/+admin/follows/follows.routes.ts b/client/src/app/+admin/follows/follows.routes.ts
index 817074536..cd70daf77 100644
--- a/client/src/app/+admin/follows/follows.routes.ts
+++ b/client/src/app/+admin/follows/follows.routes.ts
@@ -25,7 +25,7 @@ export const FollowsRoutes: Routes = [
25 component: FollowingListComponent, 25 component: FollowingListComponent,
26 data: { 26 data: {
27 meta: { 27 meta: {
28 title: 'Following list' 28 title: $localize`Following list`
29 } 29 }
30 } 30 }
31 }, 31 },
@@ -34,7 +34,7 @@ export const FollowsRoutes: Routes = [
34 component: FollowersListComponent, 34 component: FollowersListComponent,
35 data: { 35 data: {
36 meta: { 36 meta: {
37 title: 'Followers list' 37 title: $localize`Followers list`
38 } 38 }
39 } 39 }
40 }, 40 },
diff --git a/client/src/app/+admin/moderation/moderation.routes.ts b/client/src/app/+admin/moderation/moderation.routes.ts
index 8a31a54dc..b60dd5334 100644
--- a/client/src/app/+admin/moderation/moderation.routes.ts
+++ b/client/src/app/+admin/moderation/moderation.routes.ts
@@ -33,7 +33,7 @@ export const ModerationRoutes: Routes = [
33 data: { 33 data: {
34 userRight: UserRight.MANAGE_ABUSES, 34 userRight: UserRight.MANAGE_ABUSES,
35 meta: { 35 meta: {
36 title: 'Reports' 36 title: $localize`Reports`
37 } 37 }
38 } 38 }
39 }, 39 },
@@ -64,7 +64,7 @@ export const ModerationRoutes: Routes = [
64 data: { 64 data: {
65 userRight: UserRight.MANAGE_VIDEO_BLACKLIST, 65 userRight: UserRight.MANAGE_VIDEO_BLACKLIST,
66 meta: { 66 meta: {
67 title: 'Videos blocked' 67 title: $localize`Videos blocked`
68 } 68 }
69 } 69 }
70 }, 70 },
@@ -75,7 +75,7 @@ export const ModerationRoutes: Routes = [
75 data: { 75 data: {
76 userRight: UserRight.MANAGE_ACCOUNTS_BLOCKLIST, 76 userRight: UserRight.MANAGE_ACCOUNTS_BLOCKLIST,
77 meta: { 77 meta: {
78 title: 'Muted accounts' 78 title: $localize`Muted accounts`
79 } 79 }
80 } 80 }
81 }, 81 },
@@ -86,7 +86,7 @@ export const ModerationRoutes: Routes = [
86 data: { 86 data: {
87 userRight: UserRight.MANAGE_SERVERS_BLOCKLIST, 87 userRight: UserRight.MANAGE_SERVERS_BLOCKLIST,
88 meta: { 88 meta: {
89 title: 'Muted instances' 89 title: $localize`Muted instances`
90 } 90 }
91 } 91 }
92 } 92 }
diff --git a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html
index f3fc429ff..cb2894568 100644
--- a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html
+++ b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html
@@ -7,38 +7,7 @@
7 7
8 <form *ngIf="hasRegisteredSettings()" role="form" (ngSubmit)="formValidated()" [formGroup]="form"> 8 <form *ngIf="hasRegisteredSettings()" role="form" (ngSubmit)="formValidated()" [formGroup]="form">
9 <div class="form-group" *ngFor="let setting of registeredSettings"> 9 <div class="form-group" *ngFor="let setting of registeredSettings">
10 <label *ngIf="setting.type !== 'input-checkbox'" [attr.for]="setting.name" [innerHTML]="setting.label"></label> 10 <my-dynamic-form-field [form]="form" [setting]="setting" [formErrors]="formErrors"></my-dynamic-form-field>
11
12 <input *ngIf="setting.type === 'input'" type="text" [id]="setting.name" [formControlName]="setting.name" />
13
14 <textarea *ngIf="setting.type === 'input-textarea'" type="text" [id]="setting.name" [formControlName]="setting.name"></textarea>
15
16 <my-help *ngIf="setting.type === 'markdown-text'" helpType="markdownText"></my-help>
17
18 <my-help *ngIf="setting.type === 'markdown-enhanced'" helpType="markdownEnhanced"></my-help>
19
20 <my-markdown-textarea
21 *ngIf="setting.type === 'markdown-text'"
22 markdownType="text" [id]="setting.name" [formControlName]="setting.name" textareaWidth="500px"
23 [classes]="{ 'input-error': formErrors['settings.name'] }"
24 ></my-markdown-textarea>
25
26 <my-markdown-textarea
27 *ngIf="setting.type === 'markdown-enhanced'"
28 markdownType="enhanced" [id]="setting.name" [formControlName]="setting.name" textareaWidth="500px"
29 [classes]="{ 'input-error': formErrors['settings.name'] }"
30 ></my-markdown-textarea>
31
32 <my-peertube-checkbox
33 *ngIf="setting.type === 'input-checkbox'"
34 [id]="setting.name"
35 [formControlName]="setting.name"
36 [labelInnerHTML]="setting.label"
37 ></my-peertube-checkbox>
38
39 <div *ngIf="formErrors[setting.name]" class="form-error">
40 {{ formErrors[setting.name] }}
41 </div>
42 </div> 11 </div>
43 12
44 <input type="submit" i18n value="Update plugin settings" [disabled]="!form.valid"> 13 <input type="submit" i18n value="Update plugin settings" [disabled]="!form.valid">
diff --git a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.scss b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.scss
index cc35aec57..5ab6e5f1b 100644
--- a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.scss
+++ b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.scss
@@ -5,22 +5,6 @@ h2 {
5 margin-bottom: 20px; 5 margin-bottom: 20px;
6} 6}
7 7
8input:not([type=submit]) {
9 @include peertube-input-text(340px);
10
11 display: block;
12}
13
14textarea {
15 @include peertube-textarea(340px, 200px);
16
17 display: block;
18}
19
20.peertube-select-container {
21 @include peertube-select-container(340px);
22}
23
24input[type=submit], button { 8input[type=submit], button {
25 @include peertube-button; 9 @include peertube-button;
26 @include orange-button; 10 @include orange-button;
diff --git a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts
index a33f01691..1acaf9674 100644
--- a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts
+++ b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts
@@ -3,7 +3,8 @@ import { map, switchMap } from 'rxjs/operators'
3import { Component, OnDestroy, OnInit } from '@angular/core' 3import { Component, OnDestroy, OnInit } from '@angular/core'
4import { ActivatedRoute } from '@angular/router' 4import { ActivatedRoute } from '@angular/router'
5import { Notifier } from '@app/core' 5import { Notifier } from '@app/core'
6import { BuildFormArgument, FormReactive, FormValidatorService } from '@app/shared/shared-forms' 6import { BuildFormArgument } from '@app/shared/form-validators'
7import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
7import { PeerTubePlugin, RegisterServerSettingOptions } from '@shared/models' 8import { PeerTubePlugin, RegisterServerSettingOptions } from '@shared/models'
8import { PluginApiService } from '../shared/plugin-api.service' 9import { PluginApiService } from '../shared/plugin-api.service'
9 10
diff --git a/client/src/app/+admin/plugins/plugins.routes.ts b/client/src/app/+admin/plugins/plugins.routes.ts
index 4bef27be3..4cf55dda2 100644
--- a/client/src/app/+admin/plugins/plugins.routes.ts
+++ b/client/src/app/+admin/plugins/plugins.routes.ts
@@ -25,7 +25,7 @@ export const PluginsRoutes: Routes = [
25 component: PluginListInstalledComponent, 25 component: PluginListInstalledComponent,
26 data: { 26 data: {
27 meta: { 27 meta: {
28 title: 'List installed plugins' 28 title: $localize`List installed plugins`
29 } 29 }
30 } 30 }
31 }, 31 },
@@ -34,7 +34,7 @@ export const PluginsRoutes: Routes = [
34 component: PluginSearchComponent, 34 component: PluginSearchComponent,
35 data: { 35 data: {
36 meta: { 36 meta: {
37 title: 'Search plugins' 37 title: $localize`Search plugins`
38 } 38 }
39 } 39 }
40 }, 40 },
@@ -43,7 +43,7 @@ export const PluginsRoutes: Routes = [
43 component: PluginShowInstalledComponent, 43 component: PluginShowInstalledComponent,
44 data: { 44 data: {
45 meta: { 45 meta: {
46 title: 'Show plugin' 46 title: $localize`Show plugin`
47 } 47 }
48 } 48 }
49 } 49 }
diff --git a/client/src/app/+admin/system/system.routes.ts b/client/src/app/+admin/system/system.routes.ts
index 0e8d98519..72ab6705a 100644
--- a/client/src/app/+admin/system/system.routes.ts
+++ b/client/src/app/+admin/system/system.routes.ts
@@ -10,8 +10,6 @@ export const SystemRoutes: Routes = [
10 { 10 {
11 path: 'system', 11 path: 'system',
12 component: SystemComponent, 12 component: SystemComponent,
13 data: {
14 },
15 children: [ 13 children: [
16 { 14 {
17 path: '', 15 path: '',
@@ -25,7 +23,7 @@ export const SystemRoutes: Routes = [
25 data: { 23 data: {
26 meta: { 24 meta: {
27 userRight: UserRight.MANAGE_JOBS, 25 userRight: UserRight.MANAGE_JOBS,
28 title: 'Jobs' 26 title: $localize`Jobs`
29 } 27 }
30 } 28 }
31 }, 29 },
@@ -36,7 +34,7 @@ export const SystemRoutes: Routes = [
36 data: { 34 data: {
37 meta: { 35 meta: {
38 userRight: UserRight.MANAGE_LOGS, 36 userRight: UserRight.MANAGE_LOGS,
39 title: 'Logs' 37 title: $localize`Logs`
40 } 38 }
41 } 39 }
42 }, 40 },
@@ -47,7 +45,7 @@ export const SystemRoutes: Routes = [
47 data: { 45 data: {
48 meta: { 46 meta: {
49 userRight: UserRight.MANAGE_DEBUG, 47 userRight: UserRight.MANAGE_DEBUG,
50 title: 'Debug' 48 title: $localize`Debug`
51 } 49 }
52 } 50 }
53 } 51 }
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 }
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 @@
1import { Component, Input, OnInit } from '@angular/core' 1import { Component, Input, OnInit } from '@angular/core'
2import { Notifier, UserService } from '@app/core' 2import { Notifier, UserService } from '@app/core'
3import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' 3import { USER_PASSWORD_VALIDATOR } from '@app/shared/form-validators/user-validators'
4import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
4import { UserUpdate } from '@shared/models' 5import { 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'
3import { ActivatedRoute, Router } from '@angular/router' 3import { ActivatedRoute, Router } from '@angular/router'
4import { ConfigService } from '@app/+admin/config/shared/config.service' 4import { ConfigService } from '@app/+admin/config/shared/config.service'
5import { AuthService, Notifier, ScreenService, ServerService, User, UserService } from '@app/core' 5import { AuthService, Notifier, ScreenService, ServerService, User, UserService } from '@app/core'
6import { FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' 6import {
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'
12import { FormValidatorService } from '@app/shared/shared-forms'
7import { User as UserType, UserAdminFlag, UserRole, UserUpdate } from '@shared/models' 13import { User as UserType, UserAdminFlag, UserRole, UserUpdate } from '@shared/models'
8import { UserEdit } from './user-edit' 14import { 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
diff --git a/client/src/app/+admin/users/users.routes.ts b/client/src/app/+admin/users/users.routes.ts
index 6560f0260..5183498d6 100644
--- a/client/src/app/+admin/users/users.routes.ts
+++ b/client/src/app/+admin/users/users.routes.ts
@@ -24,7 +24,7 @@ export const UsersRoutes: Routes = [
24 component: UserListComponent, 24 component: UserListComponent,
25 data: { 25 data: {
26 meta: { 26 meta: {
27 title: 'Users list' 27 title: $localize`Users list`
28 } 28 }
29 } 29 }
30 }, 30 },
@@ -33,7 +33,7 @@ export const UsersRoutes: Routes = [
33 component: UserCreateComponent, 33 component: UserCreateComponent,
34 data: { 34 data: {
35 meta: { 35 meta: {
36 title: 'Create a user' 36 title: $localize`Create a user`
37 } 37 }
38 }, 38 },
39 resolve: { 39 resolve: {
@@ -45,7 +45,7 @@ export const UsersRoutes: Routes = [
45 component: UserUpdateComponent, 45 component: UserUpdateComponent,
46 data: { 46 data: {
47 meta: { 47 meta: {
48 title: 'Update a user' 48 title: $localize`Update a user`
49 } 49 }
50 } 50 }
51 } 51 }