remove isAdministration

This commit is contained in:
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", "webpack-cli": "^3.0.8",
"webtorrent": "https://github.com/webtorrent/webtorrent#e9b209c7970816fc29e0cc871157a4918d66001d", "webtorrent": "https://github.com/webtorrent/webtorrent#e9b209c7970816fc29e0cc871157a4918d66001d",
"whatwg-fetch": "^3.0.0", "whatwg-fetch": "^3.0.0",
"zone.js": "~0.8.5" "zone.js": "~0.8.5",
},
"dependencies": {
"generate-password-browser": "^1.0.2" "generate-password-browser": "^1.0.2"
} }
} }

View File

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

View File

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

View File

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