-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #438 from ncats/awb042_changepasswordbutton
WIP: Make change password button configurable in user profile self-edit
- Loading branch information
Showing
3 changed files
with
106 additions
and
83 deletions.
There are no files selected for viewing
167 changes: 84 additions & 83 deletions
167
src/app/core/auth/user-profile/user-profile.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,94 @@ | ||
<div mat-dialog-title> | ||
<h2 >User Profile</h2> | ||
<div class = "username"> | ||
{{ user.user.username}} | ||
</div> | ||
</div> | ||
<mat-dialog-content *ngIf = "user" > | ||
<div class = "user-container"> | ||
|
||
|
||
<div class = "left-side"> | ||
<div *ngIf = "user.user.email && user.user.email !== ''" class = "label-value"> | ||
<div class = "label">Email: </div> | ||
<div class = "value">{{user.user.email}}</div> | ||
</div> | ||
<div class = "label-value"> | ||
<div class = "label"> | ||
Roles: | ||
</div> | ||
<div class = "value"> | ||
<span *ngFor = "let role of user.roles; last as islast"> | ||
{{role}}{{!islast? ', ':''}} | ||
</span> | ||
</div> | ||
</div> | ||
<div class = "label-value"> | ||
<div class = "label"> | ||
Groups: | ||
</div> | ||
<div class = "value"> | ||
<span *ngFor = "let group of user.groups; last as islast"> | ||
{{group.name}}{{!islast? ', ':''}} | ||
</span> | ||
</div> | ||
<h2 >User Profile</h2> | ||
<div class = "username"> | ||
{{ user.user.username}} | ||
</div> | ||
|
||
|
||
|
||
</div> | ||
</div> | ||
<mat-dialog-content *ngIf = "user" > | ||
<div class = "user-container"> | ||
|
||
<div class = "password-column" *ngIf = "!newUser "> | ||
<div class = "spinner-container"> | ||
<button (click) = "changePassword = !changePassword" mat-button class = " mat-flat-button" [disabled] = "loading"> | ||
{{!changePassword?"Change Password":"Cancel"}} | ||
</button> | ||
<div *ngIf = "loading" class = "password-column"> | ||
<mat-progress-spinner | ||
class="spinner" | ||
color="primary" | ||
mode="indeterminate" | ||
diameter = "30" | ||
> | ||
</mat-progress-spinner> | ||
|
||
<div class = "left-side"> | ||
<div *ngIf = "user.user.email && user.user.email !== ''" class = "label-value"> | ||
<div class = "label">Email: </div> | ||
<div class = "value">{{user.user.email}}</div> | ||
</div> | ||
<div class = "label-value"> | ||
<div class = "label"> | ||
Roles: | ||
</div> | ||
<div class = "value"> | ||
<span *ngFor = "let role of user.roles; last as islast"> | ||
{{role}}{{!islast? ', ':''}} | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
<span *ngIf = "changePassword === true" > | ||
<div> | ||
<mat-form-field> | ||
<input [disabled] = "loading" matInput type = "password" [(ngModel)] = "oldPassword" placeholder="old password" required name="Password" /> | ||
</mat-form-field> | ||
<div class = "label-value"> | ||
<div class = "label"> | ||
Groups: | ||
</div> | ||
<div class = "value"> | ||
<span *ngFor = "let group of user.groups; last as islast"> | ||
{{group.name}}{{!islast? ', ':''}} | ||
</span> | ||
</div> | ||
<div> | ||
<mat-form-field> | ||
<input [disabled] = "loading" matInput type = "password" [(ngModel)] = "newPassword" placeholder="new password" required name="Password" /> | ||
</mat-form-field> | ||
</div> | ||
|
||
|
||
|
||
</div> | ||
<div *ngIf = "showChangeUserPasswordButton"> | ||
<div class = "password-column" *ngIf = "!newUser "> | ||
<div class = "spinner-container"> | ||
<button (click) = "changePassword = !changePassword" mat-button class = " mat-flat-button" [disabled] = "loading"> | ||
{{!changePassword?"Change Password":"Cancel"}} | ||
</button> | ||
<div *ngIf = "loading" class = "password-column"> | ||
<mat-progress-spinner | ||
class="spinner" | ||
color="primary" | ||
mode="indeterminate" | ||
diameter = "30" | ||
> | ||
</mat-progress-spinner> | ||
</div> | ||
</div> | ||
<span *ngIf = "changePassword === true" > | ||
<div> | ||
<mat-form-field> | ||
<input [disabled] = "loading" matInput type = "password" [(ngModel)] = "newPasswordConfirm" placeholder="confirm new password" required name="Password" /> | ||
</mat-form-field> | ||
<mat-form-field> | ||
<input [disabled] = "loading" matInput type = "password" [(ngModel)] = "oldPassword" placeholder="old password" required name="Password" /> | ||
</mat-form-field> | ||
</div> | ||
|
||
|
||
<div> | ||
<button [disabled] = "loading" mat-button class = " mat-primary mat-flat-button" (click) = "validatePassword()">Submit Change</button> | ||
</div> | ||
</span> | ||
</div> | ||
<mat-form-field> | ||
<input [disabled] = "loading" matInput type = "password" [(ngModel)] = "newPassword" placeholder="new password" required name="Password" /> | ||
</mat-form-field> | ||
</div> | ||
<div> | ||
<mat-form-field> | ||
<input [disabled] = "loading" matInput type = "password" [(ngModel)] = "newPasswordConfirm" placeholder="confirm new password" required name="Password" /> | ||
</mat-form-field> | ||
</div> | ||
|
||
|
||
<div> | ||
<button [disabled] = "loading" mat-button class = " mat-primary mat-flat-button" (click) = "validatePassword()">Submit Change</button> | ||
</div> | ||
</span> | ||
</div> | ||
</div> | ||
<div class = "message" *ngIf = "changePassword"> | ||
{{this.message}} | ||
</div> | ||
</div> | ||
<div class = "message" *ngIf = "changePassword"> | ||
{{this.message}} | ||
</div> | ||
</mat-dialog-content> | ||
<mat-dialog-actions> | ||
<button mat-button (click) = "viewDownloads()" [disabled] = "loading"> | ||
View Downloads | ||
</button> | ||
<button mat-button (click) = "viewDrafts()" [disabled] = "loading"> | ||
View Edit Drafts | ||
</button> | ||
<span class = "middle-fill"></span> | ||
<button mat-button mat-dialog-close [disabled] = "loading">Close</button> | ||
</mat-dialog-actions> | ||
</mat-dialog-content> | ||
<mat-dialog-actions> | ||
<button mat-button (click) = "viewDownloads()" [disabled] = "loading"> | ||
View Downloads | ||
</button> | ||
<button mat-button (click) = "viewDrafts()" [disabled] = "loading"> | ||
View Edit Drafts | ||
</button> | ||
<span class = "middle-fill"></span> | ||
<button mat-button mat-dialog-close [disabled] = "loading">Close</button> | ||
</mat-dialog-actions> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters