<input type="submit" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
</form>
+<div *ngIf="!isCreation()">
<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 style="margin-top:0;" (click)="resetPassword()" i18n>Ask for new password</button>
-<p class="mt-4" i18n>Manually set the user password</p>
-<my-user-password userId="userId"></my-user-password>
+ <p class="mt-4" i18n>Manually set the user password</p>
+ <my-user-password userId="userId"></my-user-password>
+</div>
\ No newline at end of file
-<form role="form" (ngSubmit)="formValidated()" [formGroup]="form">
+<form role="form" (ngSubmit)="formValidated()" [formGroup]="form">
<div class="form-group">
<div class="input-group mb-3">
formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }"
>
<div class="input-group-append">
- <button class="btn btn-sm btn-outline-secondary" (click)="generatePassword() "
+ <button class="btn btn-sm btn-outline-secondary" (click)="generatePassword() "
type="button">Generate</button>
</div>
</div>
import { Component, OnDestroy, OnInit, Input } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
-import { Subscription } from 'rxjs'
import * as generator from 'generate-password-browser'
import { NotificationsService } from 'angular2-notifications'
import { UserService } from '@app/shared/users/user.service'
@Input() userId: number
- private paramsSub: Subscription
-
constructor (
protected formValidatorService: FormValidatorService,
protected serverService: ServerService,
}
ngOnDestroy () {
- this.paramsSub.unsubscribe()
+ //
}
formValidated () {