aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/users/user-edit
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin/users/user-edit')
-rw-r--r--client/src/app/+admin/users/user-edit/user-create.component.ts10
-rw-r--r--client/src/app/+admin/users/user-edit/user-password.component.ts12
-rw-r--r--client/src/app/+admin/users/user-edit/user-update.component.ts14
3 files changed, 13 insertions, 23 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 3fddb9c09..36d71a927 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
@@ -3,7 +3,6 @@ import { 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 { FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { UserCreate, UserRole } from '@shared/models' 6import { UserCreate, UserRole } from '@shared/models'
8import { UserEdit } from './user-edit' 7import { UserEdit } from './user-edit'
9 8
@@ -25,9 +24,8 @@ export class UserCreateComponent extends UserEdit implements OnInit {
25 private route: ActivatedRoute, 24 private route: ActivatedRoute,
26 private router: Router, 25 private router: Router,
27 private notifier: Notifier, 26 private notifier: Notifier,
28 private userService: UserService, 27 private userService: UserService
29 private i18n: I18n 28 ) {
30 ) {
31 super() 29 super()
32 30
33 this.buildQuotaOptions() 31 this.buildQuotaOptions()
@@ -67,7 +65,7 @@ export class UserCreateComponent extends UserEdit implements OnInit {
67 65
68 this.userService.addUser(userCreate).subscribe( 66 this.userService.addUser(userCreate).subscribe(
69 () => { 67 () => {
70 this.notifier.success(this.i18n('User {{username}} created.', { username: userCreate.username })) 68 this.notifier.success($localize`User ${userCreate.username} created.`)
71 this.router.navigate([ '/admin/users/list' ]) 69 this.router.navigate([ '/admin/users/list' ])
72 }, 70 },
73 71
@@ -85,6 +83,6 @@ export class UserCreateComponent extends UserEdit implements OnInit {
85 } 83 }
86 84
87 getFormButtonTitle () { 85 getFormButtonTitle () {
88 return this.i18n('Create user') 86 return $localize`Create user`
89 } 87 }
90} 88}
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 33c7de31f..25f13495a 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,7 +1,6 @@
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 { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
4import { I18n } from '@ngx-translate/i18n-polyfill'
5import { UserUpdate } from '@shared/models' 4import { UserUpdate } from '@shared/models'
6 5
7@Component({ 6@Component({
@@ -20,9 +19,8 @@ export class UserPasswordComponent extends FormReactive implements OnInit {
20 protected formValidatorService: FormValidatorService, 19 protected formValidatorService: FormValidatorService,
21 private userValidatorsService: UserValidatorsService, 20 private userValidatorsService: UserValidatorsService,
22 private notifier: Notifier, 21 private notifier: Notifier,
23 private userService: UserService, 22 private userService: UserService
24 private i18n: I18n 23 ) {
25 ) {
26 super() 24 super()
27 } 25 }
28 26
@@ -39,9 +37,7 @@ export class UserPasswordComponent extends FormReactive implements OnInit {
39 37
40 this.userService.updateUser(this.userId, userUpdate).subscribe( 38 this.userService.updateUser(this.userId, userUpdate).subscribe(
41 () => { 39 () => {
42 this.notifier.success( 40 this.notifier.success($localize`Password changed for user ${this.username}.`)
43 this.i18n('Password changed for user {{username}}.', { username: this.username })
44 )
45 }, 41 },
46 42
47 err => this.error = err.message 43 err => this.error = err.message
@@ -53,6 +49,6 @@ export class UserPasswordComponent extends FormReactive implements OnInit {
53 } 49 }
54 50
55 getFormButtonTitle () { 51 getFormButtonTitle () {
56 return this.i18n('Update user password') 52 return $localize`Update user password`
57 } 53 }
58} 54}
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 870880fee..55bc7290e 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
@@ -4,7 +4,6 @@ import { 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 { FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { User as UserType, UserAdminFlag, UserRole, UserUpdate } from '@shared/models' 7import { User as UserType, UserAdminFlag, UserRole, UserUpdate } from '@shared/models'
9import { UserEdit } from './user-edit' 8import { UserEdit } from './user-edit'
10 9
@@ -28,9 +27,8 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy {
28 private route: ActivatedRoute, 27 private route: ActivatedRoute,
29 private router: Router, 28 private router: Router,
30 private notifier: Notifier, 29 private notifier: Notifier,
31 private userService: UserService, 30 private userService: UserService
32 private i18n: I18n 31 ) {
33 ) {
34 super() 32 super()
35 33
36 this.buildQuotaOptions() 34 this.buildQuotaOptions()
@@ -79,7 +77,7 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy {
79 77
80 this.userService.updateUser(this.user.id, userUpdate).subscribe( 78 this.userService.updateUser(this.user.id, userUpdate).subscribe(
81 () => { 79 () => {
82 this.notifier.success(this.i18n('User {{username}} updated.', { username: this.user.username })) 80 this.notifier.success($localize`User ${this.user.username} updated.`)
83 this.router.navigate([ '/admin/users/list' ]) 81 this.router.navigate([ '/admin/users/list' ])
84 }, 82 },
85 83
@@ -96,15 +94,13 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy {
96 } 94 }
97 95
98 getFormButtonTitle () { 96 getFormButtonTitle () {
99 return this.i18n('Update user') 97 return $localize`Update user`
100 } 98 }
101 99
102 resetPassword () { 100 resetPassword () {
103 this.userService.askResetPassword(this.user.email).subscribe( 101 this.userService.askResetPassword(this.user.email).subscribe(
104 () => { 102 () => {
105 this.notifier.success( 103 this.notifier.success($localize`An email asking for password reset has been sent to ${this.user.username}.`)
106 this.i18n('An email asking for password reset has been sent to {{username}}.', { username: this.user.username })
107 )
108 }, 104 },
109 105
110 err => this.error = err.message 106 err => this.error = err.message