diff options
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.ts | 21 |
1 files changed, 9 insertions, 12 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 2a9882cde..b91ffa115 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 | |||
@@ -1,20 +1,13 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { FormBuilder, FormGroup } from '@angular/forms' | 2 | import { FormBuilder, FormGroup } from '@angular/forms' |
3 | import { Router } from '@angular/router' | 3 | import { Router } from '@angular/router' |
4 | |||
5 | import { NotificationsService } from 'angular2-notifications' | 4 | import { NotificationsService } from 'angular2-notifications' |
6 | |||
7 | import { UserService } from '../shared' | 5 | import { UserService } from '../shared' |
8 | import { | 6 | import { USER_EMAIL, USER_PASSWORD, USER_ROLE, USER_USERNAME, USER_VIDEO_QUOTA } from '../../../shared' |
9 | USER_USERNAME, | ||
10 | USER_EMAIL, | ||
11 | USER_PASSWORD, | ||
12 | USER_VIDEO_QUOTA, | ||
13 | USER_ROLE | ||
14 | } from '../../../shared' | ||
15 | import { ServerService } from '../../../core' | 7 | import { ServerService } from '../../../core' |
16 | import { UserCreate, UserRole } from '../../../../../../shared' | 8 | import { UserCreate, UserRole } from '../../../../../../shared' |
17 | import { UserEdit } from './user-edit' | 9 | import { UserEdit } from './user-edit' |
10 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
18 | 11 | ||
19 | @Component({ | 12 | @Component({ |
20 | selector: 'my-user-create', | 13 | selector: 'my-user-create', |
@@ -45,7 +38,8 @@ export class UserCreateComponent extends UserEdit implements OnInit { | |||
45 | private formBuilder: FormBuilder, | 38 | private formBuilder: FormBuilder, |
46 | private router: Router, | 39 | private router: Router, |
47 | private notificationsService: NotificationsService, | 40 | private notificationsService: NotificationsService, |
48 | private userService: UserService | 41 | private userService: UserService, |
42 | private i18n: I18n | ||
49 | ) { | 43 | ) { |
50 | super() | 44 | super() |
51 | } | 45 | } |
@@ -76,7 +70,10 @@ export class UserCreateComponent extends UserEdit implements OnInit { | |||
76 | 70 | ||
77 | this.userService.addUser(userCreate).subscribe( | 71 | this.userService.addUser(userCreate).subscribe( |
78 | () => { | 72 | () => { |
79 | this.notificationsService.success('Success', `User ${userCreate.username} created.`) | 73 | this.notificationsService.success( |
74 | this.i18n('Success'), | ||
75 | this.i18n('User {{ username }} created.', { username: userCreate.username }) | ||
76 | ) | ||
80 | this.router.navigate([ '/admin/users/list' ]) | 77 | this.router.navigate([ '/admin/users/list' ]) |
81 | }, | 78 | }, |
82 | 79 | ||
@@ -89,6 +86,6 @@ export class UserCreateComponent extends UserEdit implements OnInit { | |||
89 | } | 86 | } |
90 | 87 | ||
91 | getFormButtonTitle () { | 88 | getFormButtonTitle () { |
92 | return 'Create user' | 89 | return this.i18n('Create user') |
93 | } | 90 | } |
94 | } | 91 | } |