remove isAdministration

pull/1625/head
Rigel Kent 2018-10-08 15:56:56 +02:00 committed by Chocobozzz
parent 328c78bc4a
commit a3342ce250
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
5 changed files with 8 additions and 20 deletions

View File

@ -164,9 +164,7 @@
"webpack-cli": "^3.0.8",
"webtorrent": "https://github.com/webtorrent/webtorrent#e9b209c7970816fc29e0cc871157a4918d66001d",
"whatwg-fetch": "^3.0.0",
"zone.js": "~0.8.5"
},
"dependencies": {
"zone.js": "~0.8.5",
"generate-password-browser": "^1.0.2"
}
}

View File

@ -82,12 +82,10 @@
<input type="submit" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
</form>
<div *ngIf="isAdministration">
<div class="account-title" i18n>Danger Zone</div>
<p i18n>Send a link to reset the password by mail to the user.</p>
<button (click)="resetPassword()" i18n>Ask for new password</button>
<p i18n>Send a link to reset the password by mail to the user.</p>
<button (click)="resetPassword()" i18n>Ask for new password</button>
<p class="mt-4" i18n>Manually set the user password</p>
<my-user-password></my-user-password>
</div>
<p class="mt-4" i18n>Manually set the user password</p>
<my-user-password></my-user-password>

View File

@ -8,7 +8,7 @@
</div>
</div>
<input id="passwordField" #passwordField
[attr.type]="showPassword ? 'text' : 'password'" id="password"
[attr.type]="showPassword ? 'text' : 'password'" id="password"
formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }"
>
<div class="input-group-append">
@ -22,4 +22,4 @@
</div>
<input type="submit" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
</form>
</form>

View File

@ -21,10 +21,8 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy {
userId: number
userEmail: string
username: string
isAdministration = false
private paramsSub: Subscription
private isAdministrationSub: Subscription
constructor (
protected formValidatorService: FormValidatorService,
@ -59,15 +57,10 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy {
err => this.error = err.message
)
})
this.isAdministrationSub = this.route.data.subscribe(data => {
if (data.isAdministration) this.isAdministration = data.isAdministration
})
}
ngOnDestroy () {
this.paramsSub.unsubscribe()
this.isAdministrationSub.unsubscribe()
}
formValidated () {

View File

@ -44,8 +44,7 @@ export const UsersRoutes: Routes = [
data: {
meta: {
title: 'Update a user'
},
isAdministration: true
}
}
}
]