diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-27 16:55:03 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-27 16:55:03 +0200 |
commit | 954605a804da399317ca62afa2fb9244afa11ebf (patch) | |
tree | de6ee69280bfb928bc01c29430e13d5b820e921a /client/src/app/+admin/users/user-edit/user-update.component.ts | |
parent | e02573ad67626210ed279bad321ee139094921a1 (diff) | |
download | PeerTube-954605a804da399317ca62afa2fb9244afa11ebf.tar.gz PeerTube-954605a804da399317ca62afa2fb9244afa11ebf.tar.zst PeerTube-954605a804da399317ca62afa2fb9244afa11ebf.zip |
Support roles with rights and add moderator role
Diffstat (limited to 'client/src/app/+admin/users/user-edit/user-update.component.ts')
-rw-r--r-- | client/src/app/+admin/users/user-edit/user-update.component.ts | 14 |
1 files changed, 11 insertions, 3 deletions
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 bd901e655..bcba78a35 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 | |||
@@ -6,11 +6,15 @@ import { Subscription } from 'rxjs/Subscription' | |||
6 | import { NotificationsService } from 'angular2-notifications' | 6 | import { NotificationsService } from 'angular2-notifications' |
7 | 7 | ||
8 | import { UserService } from '../shared' | 8 | import { UserService } from '../shared' |
9 | import { USER_EMAIL, USER_VIDEO_QUOTA } from '../../../shared' | 9 | import { |
10 | USER_EMAIL, | ||
11 | USER_VIDEO_QUOTA, | ||
12 | USER_ROLE, | ||
13 | User | ||
14 | } from '../../../shared' | ||
10 | import { ServerService } from '../../../core' | 15 | import { ServerService } from '../../../core' |
11 | import { UserUpdate } from '../../../../../../shared/models/users/user-update.model' | ||
12 | import { User } from '../../../shared/users/user.model' | ||
13 | import { UserEdit } from './user-edit' | 16 | import { UserEdit } from './user-edit' |
17 | import { UserUpdate, UserRole } from '../../../../../../shared' | ||
14 | 18 | ||
15 | @Component({ | 19 | @Component({ |
16 | selector: 'my-user-update', | 20 | selector: 'my-user-update', |
@@ -25,10 +29,12 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { | |||
25 | form: FormGroup | 29 | form: FormGroup |
26 | formErrors = { | 30 | formErrors = { |
27 | 'email': '', | 31 | 'email': '', |
32 | 'role': '', | ||
28 | 'videoQuota': '' | 33 | 'videoQuota': '' |
29 | } | 34 | } |
30 | validationMessages = { | 35 | validationMessages = { |
31 | 'email': USER_EMAIL.MESSAGES, | 36 | 'email': USER_EMAIL.MESSAGES, |
37 | 'role': USER_ROLE.MESSAGES, | ||
32 | 'videoQuota': USER_VIDEO_QUOTA.MESSAGES | 38 | 'videoQuota': USER_VIDEO_QUOTA.MESSAGES |
33 | } | 39 | } |
34 | 40 | ||
@@ -48,6 +54,7 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { | |||
48 | buildForm () { | 54 | buildForm () { |
49 | this.form = this.formBuilder.group({ | 55 | this.form = this.formBuilder.group({ |
50 | email: [ '', USER_EMAIL.VALIDATORS ], | 56 | email: [ '', USER_EMAIL.VALIDATORS ], |
57 | role: [ '', USER_ROLE.VALIDATORS ], | ||
51 | videoQuota: [ '-1', USER_VIDEO_QUOTA.VALIDATORS ] | 58 | videoQuota: [ '-1', USER_VIDEO_QUOTA.VALIDATORS ] |
52 | }) | 59 | }) |
53 | 60 | ||
@@ -103,6 +110,7 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { | |||
103 | 110 | ||
104 | this.form.patchValue({ | 111 | this.form.patchValue({ |
105 | email: userJson.email, | 112 | email: userJson.email, |
113 | role: userJson.role, | ||
106 | videoQuota: userJson.videoQuota | 114 | videoQuota: userJson.videoQuota |
107 | }) | 115 | }) |
108 | } | 116 | } |