cleanup and remove paramSubs
authorRigel Kent <sendmemail@rigelk.eu>
Sat, 8 Dec 2018 14:37:36 +0000 (15:37 +0100)
committerChocobozzz <me@florianbigard.com>
Mon, 11 Feb 2019 08:26:40 +0000 (09:26 +0100)
client/src/app/+admin/users/user-edit/user-edit.component.html
client/src/app/+admin/users/user-edit/user-password.component.html
client/src/app/+admin/users/user-edit/user-password.component.ts

index 6944ec4358804044f2cd493aab4e144c01c86802..3ce246771327211a7f377a4b884be266974cf70f 100644 (file)
   <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
index 267422bdd9f02f84e6903f9b2c1a11024e5650ee..822e4688eae03d8701e8ea382a76f2fa5d4a7893 100644 (file)
@@ -1,4 +1,4 @@
-<form role="form" (ngSubmit)="formValidated()" [formGroup]="form">  
+<form role="form" (ngSubmit)="formValidated()" [formGroup]="form">
   <div class="form-group">
 
     <div class="input-group mb-3">
@@ -12,7 +12,7 @@
         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>
index 99c4c8a59998fd242e2043a943ed1510e25a91d8..30cd21ccd5d68f9f402548505861e371be646038 100644 (file)
@@ -1,6 +1,5 @@
 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'
@@ -24,8 +23,6 @@ export class UserPasswordComponent extends FormReactive implements OnInit, OnDes
 
   @Input() userId: number
 
-  private paramsSub: Subscription
-
   constructor (
     protected formValidatorService: FormValidatorService,
     protected serverService: ServerService,
@@ -47,7 +44,7 @@ export class UserPasswordComponent extends FormReactive implements OnInit, OnDes
   }
 
   ngOnDestroy () {
-    this.paramsSub.unsubscribe()
+    //
   }
 
   formValidated () {