aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/package.json4
-rw-r--r--client/src/app/+admin/users/user-edit/user-edit.component.html10
-rw-r--r--client/src/app/+admin/users/user-edit/user-password.component.html4
-rw-r--r--client/src/app/+admin/users/user-edit/user-update.component.ts7
-rw-r--r--client/src/app/+admin/users/users.routes.ts3
5 files changed, 8 insertions, 20 deletions
diff --git a/client/package.json b/client/package.json
index 5f957bf75..9e5e87d4a 100644
--- a/client/package.json
+++ b/client/package.json
@@ -164,9 +164,7 @@
164 "webpack-cli": "^3.0.8", 164 "webpack-cli": "^3.0.8",
165 "webtorrent": "https://github.com/webtorrent/webtorrent#e9b209c7970816fc29e0cc871157a4918d66001d", 165 "webtorrent": "https://github.com/webtorrent/webtorrent#e9b209c7970816fc29e0cc871157a4918d66001d",
166 "whatwg-fetch": "^3.0.0", 166 "whatwg-fetch": "^3.0.0",
167 "zone.js": "~0.8.5" 167 "zone.js": "~0.8.5",
168 },
169 "dependencies": {
170 "generate-password-browser": "^1.0.2" 168 "generate-password-browser": "^1.0.2"
171 } 169 }
172} 170}
diff --git a/client/src/app/+admin/users/user-edit/user-edit.component.html b/client/src/app/+admin/users/user-edit/user-edit.component.html
index cbc06c157..b06c91ff3 100644
--- a/client/src/app/+admin/users/user-edit/user-edit.component.html
+++ b/client/src/app/+admin/users/user-edit/user-edit.component.html
@@ -82,12 +82,10 @@
82 <input type="submit" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid"> 82 <input type="submit" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
83</form> 83</form>
84 84
85<div *ngIf="isAdministration">
86 <div class="account-title" i18n>Danger Zone</div> 85 <div class="account-title" i18n>Danger Zone</div>
87 86
88 <p i18n>Send a link to reset the password by mail to the user.</p> 87<p i18n>Send a link to reset the password by mail to the user.</p>
89 <button (click)="resetPassword()" i18n>Ask for new password</button> 88<button (click)="resetPassword()" i18n>Ask for new password</button>
90 89
91 <p class="mt-4" i18n>Manually set the user password</p> 90<p class="mt-4" i18n>Manually set the user password</p>
92 <my-user-password></my-user-password> 91<my-user-password></my-user-password>
93</div> \ No newline at end of file
diff --git a/client/src/app/+admin/users/user-edit/user-password.component.html b/client/src/app/+admin/users/user-edit/user-password.component.html
index ee7d8dff5..267422bdd 100644
--- a/client/src/app/+admin/users/user-edit/user-password.component.html
+++ b/client/src/app/+admin/users/user-edit/user-password.component.html
@@ -8,7 +8,7 @@
8 </div> 8 </div>
9 </div> 9 </div>
10 <input id="passwordField" #passwordField 10 <input id="passwordField" #passwordField
11 [attr.type]="showPassword ? 'text' : 'password'" id="password" 11 [attr.type]="showPassword ? 'text' : 'password'" id="password"
12 formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }" 12 formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }"
13 > 13 >
14 <div class="input-group-append"> 14 <div class="input-group-append">
@@ -22,4 +22,4 @@
22 </div> 22 </div>
23 23
24 <input type="submit" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid"> 24 <input type="submit" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
25</form> \ No newline at end of file 25</form>
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 cb74897d0..4e4002a73 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
@@ -21,10 +21,8 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy {
21 userId: number 21 userId: number
22 userEmail: string 22 userEmail: string
23 username: string 23 username: string
24 isAdministration = false
25 24
26 private paramsSub: Subscription 25 private paramsSub: Subscription
27 private isAdministrationSub: Subscription
28 26
29 constructor ( 27 constructor (
30 protected formValidatorService: FormValidatorService, 28 protected formValidatorService: FormValidatorService,
@@ -59,15 +57,10 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy {
59 err => this.error = err.message 57 err => this.error = err.message
60 ) 58 )
61 }) 59 })
62
63 this.isAdministrationSub = this.route.data.subscribe(data => {
64 if (data.isAdministration) this.isAdministration = data.isAdministration
65 })
66 } 60 }
67 61
68 ngOnDestroy () { 62 ngOnDestroy () {
69 this.paramsSub.unsubscribe() 63 this.paramsSub.unsubscribe()
70 this.isAdministrationSub.unsubscribe()
71 } 64 }
72 65
73 formValidated () { 66 formValidated () {
diff --git a/client/src/app/+admin/users/users.routes.ts b/client/src/app/+admin/users/users.routes.ts
index 460ebd89e..8b3791bd3 100644
--- a/client/src/app/+admin/users/users.routes.ts
+++ b/client/src/app/+admin/users/users.routes.ts
@@ -44,8 +44,7 @@ export const UsersRoutes: Routes = [
44 data: { 44 data: {
45 meta: { 45 meta: {
46 title: 'Update a user' 46 title: 'Update a user'
47 }, 47 }
48 isAdministration: true
49 } 48 }
50 } 49 }
51 ] 50 ]