diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-05 15:01:45 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-05 15:02:27 +0200 |
commit | e309822b93d9b69f30cbe830ef3d09dfdb2c13b2 (patch) | |
tree | 41dbc3b3108ced7fdba4062974e568695c30e486 /client/src/app/+admin/users/user-edit | |
parent | d4d5853e65e584ca51c718f8df590b987f981047 (diff) | |
download | PeerTube-e309822b93d9b69f30cbe830ef3d09dfdb2c13b2.tar.gz PeerTube-e309822b93d9b69f30cbe830ef3d09dfdb2c13b2.tar.zst PeerTube-e309822b93d9b69f30cbe830ef3d09dfdb2c13b2.zip |
Add form validator translations
Diffstat (limited to 'client/src/app/+admin/users/user-edit')
-rw-r--r-- | client/src/app/+admin/users/user-edit/user-create.component.ts | 13 | ||||
-rw-r--r-- | client/src/app/+admin/users/user-edit/user-update.component.ts | 10 |
2 files changed, 13 insertions, 10 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 e5f0903b6..c15cfb267 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,12 +2,12 @@ import { Component, OnInit } from '@angular/core' | |||
2 | import { Router } from '@angular/router' | 2 | import { Router } from '@angular/router' |
3 | import { NotificationsService } from 'angular2-notifications' | 3 | import { NotificationsService } from 'angular2-notifications' |
4 | import { UserService } from '../shared' | 4 | import { UserService } from '../shared' |
5 | import { USER_EMAIL, USER_PASSWORD, USER_ROLE, USER_USERNAME, USER_VIDEO_QUOTA } from '../../../shared' | ||
6 | import { ServerService } from '../../../core' | 5 | import { ServerService } from '../../../core' |
7 | import { UserCreate, UserRole } from '../../../../../../shared' | 6 | import { UserCreate, UserRole } from '../../../../../../shared' |
8 | import { UserEdit } from './user-edit' | 7 | import { UserEdit } from './user-edit' |
9 | import { I18n } from '@ngx-translate/i18n-polyfill' | 8 | import { I18n } from '@ngx-translate/i18n-polyfill' |
10 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 9 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' |
10 | import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service' | ||
11 | 11 | ||
12 | @Component({ | 12 | @Component({ |
13 | selector: 'my-user-create', | 13 | selector: 'my-user-create', |
@@ -20,6 +20,7 @@ export class UserCreateComponent extends UserEdit implements OnInit { | |||
20 | constructor ( | 20 | constructor ( |
21 | protected serverService: ServerService, | 21 | protected serverService: ServerService, |
22 | protected formValidatorService: FormValidatorService, | 22 | protected formValidatorService: FormValidatorService, |
23 | private userValidatorsService: UserValidatorsService, | ||
23 | private router: Router, | 24 | private router: Router, |
24 | private notificationsService: NotificationsService, | 25 | private notificationsService: NotificationsService, |
25 | private userService: UserService, | 26 | private userService: UserService, |
@@ -35,11 +36,11 @@ export class UserCreateComponent extends UserEdit implements OnInit { | |||
35 | } | 36 | } |
36 | 37 | ||
37 | this.buildForm({ | 38 | this.buildForm({ |
38 | username: USER_USERNAME, | 39 | username: this.userValidatorsService.USER_USERNAME, |
39 | email: USER_EMAIL, | 40 | email: this.userValidatorsService.USER_EMAIL, |
40 | password: USER_PASSWORD, | 41 | password: this.userValidatorsService.USER_PASSWORD, |
41 | role: USER_ROLE, | 42 | role: this.userValidatorsService.USER_ROLE, |
42 | videoQuota: USER_VIDEO_QUOTA | 43 | videoQuota: this.userValidatorsService.USER_VIDEO_QUOTA |
43 | }, defaultValues) | 44 | }, defaultValues) |
44 | } | 45 | } |
45 | 46 | ||
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 f8073c928..3e60991d2 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,12 +3,13 @@ import { ActivatedRoute, Router } from '@angular/router' | |||
3 | import { Subscription } from 'rxjs' | 3 | import { Subscription } from 'rxjs' |
4 | import { NotificationsService } from 'angular2-notifications' | 4 | import { NotificationsService } from 'angular2-notifications' |
5 | import { UserService } from '../shared' | 5 | import { UserService } from '../shared' |
6 | import { User, USER_EMAIL, USER_ROLE, USER_VIDEO_QUOTA } from '../../../shared' | 6 | import { User } from '../../../shared' |
7 | import { ServerService } from '../../../core' | 7 | import { ServerService } from '../../../core' |
8 | import { UserEdit } from './user-edit' | 8 | import { UserEdit } from './user-edit' |
9 | import { UserUpdate } from '../../../../../../shared' | 9 | import { UserUpdate } from '../../../../../../shared' |
10 | import { I18n } from '@ngx-translate/i18n-polyfill' | 10 | import { I18n } from '@ngx-translate/i18n-polyfill' |
11 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 11 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' |
12 | import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service' | ||
12 | 13 | ||
13 | @Component({ | 14 | @Component({ |
14 | selector: 'my-user-update', | 15 | selector: 'my-user-update', |
@@ -25,6 +26,7 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { | |||
25 | constructor ( | 26 | constructor ( |
26 | protected formValidatorService: FormValidatorService, | 27 | protected formValidatorService: FormValidatorService, |
27 | protected serverService: ServerService, | 28 | protected serverService: ServerService, |
29 | private userValidatorsService: UserValidatorsService, | ||
28 | private route: ActivatedRoute, | 30 | private route: ActivatedRoute, |
29 | private router: Router, | 31 | private router: Router, |
30 | private notificationsService: NotificationsService, | 32 | private notificationsService: NotificationsService, |
@@ -37,9 +39,9 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { | |||
37 | ngOnInit () { | 39 | ngOnInit () { |
38 | const defaultValues = { videoQuota: '-1' } | 40 | const defaultValues = { videoQuota: '-1' } |
39 | this.buildForm({ | 41 | this.buildForm({ |
40 | email: USER_EMAIL, | 42 | email: this.userValidatorsService.USER_EMAIL, |
41 | role: USER_ROLE, | 43 | role: this.userValidatorsService.USER_ROLE, |
42 | videoQuota: USER_VIDEO_QUOTA | 44 | videoQuota: this.userValidatorsService.USER_VIDEO_QUOTA |
43 | }, defaultValues) | 45 | }, defaultValues) |
44 | 46 | ||
45 | this.paramsSub = this.route.params.subscribe(routeParams => { | 47 | this.paramsSub = this.route.params.subscribe(routeParams => { |