11< div class ="console-app__user-details ">
2- @if(isNewUser) {
2+ @if(isEditing) {
3+ < h1 class ="mat-headline-4 "> Editing {{ userDetails().emailAddress }}</ h1 >
4+ < mat-divider > </ mat-divider >
5+ < div class ="console-app__user-details-controls ">
6+ < button
7+ mat-icon-button
8+ aria-label ="Back to view user "
9+ (click) ="isEditing = false "
10+ >
11+ < mat-icon > arrow_back</ mat-icon >
12+ </ button >
13+ </ div >
14+ < form (ngSubmit) ="saveEdit() ">
15+ < p >
16+ < mat-form-field appearance ="outline ">
17+ < mat-label
18+ > User Role:
19+ < mat-icon
20+ matTooltip ="Viewer role doesn't allow making updates; Editor role allows updates, like Contacts delete or SSL certificate change "
21+ > help_outline</ mat-icon
22+ > </ mat-label
23+ >
24+ < mat-select [(ngModel)] ="userRole " name ="userRole ">
25+ < mat-option value ="PRIMARY_CONTACT "> Editor</ mat-option >
26+ < mat-option value ="ACCOUNT_MANAGER "> Viewer</ mat-option >
27+ </ mat-select >
28+ </ mat-form-field >
29+ </ p >
30+ < button
31+ mat-flat-button
32+ color ="primary "
33+ aria-label ="Save user "
34+ type ="submit "
35+ >
36+ Save
37+ </ button >
38+ </ form >
39+ } @else { @if(isNewUser) {
340 < h1 class ="mat-headline-4 ">
4- {{ userDetails.emailAddress + " succesfully created" }}
41+ {{ userDetails() .emailAddress + " successfully created" }}
542 </ h1 >
643 } @else {
744 < h1 class ="mat-headline-4 "> User details</ h1 >
8- }
945 < mat-divider > </ mat-divider >
10- < div >
11- < div class ="console-app__user-details-controls ">
12- < button
13- mat-icon-button
14- aria-label ="Back to users list "
15- (click) ="goBack() "
16- >
17- < mat-icon > arrow_back</ mat-icon >
18- </ button >
19- < div class ="spacer "> </ div >
20- < button
21- mat-icon-button
22- aria-label ="Delete User "
23- (click) ="deleteUser() "
24- [disabled] ="isLoading "
25- >
26- < mat-icon > delete</ mat-icon >
27- </ button >
28- </ div >
46+ < div class ="console-app__user-details-controls ">
47+ < button mat-icon-button aria-label ="Back to users list " (click) ="goBack() ">
48+ < mat-icon > arrow_back</ mat-icon >
49+ </ button >
50+ < div class ="spacer "> </ div >
51+ < button
52+ mat-flat-button
53+ color ="primary "
54+ aria-label ="Edit User "
55+ (click) ="userRole = userDetails().role; isEditing = true "
56+ >
57+ < mat-icon > edit</ mat-icon >
58+ Edit
59+ </ button >
60+ < button
61+ mat-icon-button
62+ aria-label ="Delete User "
63+ (click) ="deleteUser() "
64+ [disabled] ="isLoading "
65+ >
66+ < mat-icon > delete</ mat-icon >
67+ </ button >
2968 </ div >
69+ < div *ngIf ="isNewUser " class ="console-app__user-details-save-password ">
70+ < mat-icon > priority_high</ mat-icon >
71+ Please save the password. For your security, we do not store passwords in a
72+ recoverable format.
73+ </ div >
74+
3075 < p *ngIf ="isLoading ">
3176 < mat-progress-bar mode ="query "> </ mat-progress-bar >
3277 </ p >
@@ -41,17 +86,17 @@ <h2>User details</h2>
4186 < mat-list-item role ="listitem ">
4287 < span class ="console-app__list-key "> User email</ span >
4388 < span class ="console-app__list-value "> {{
44- userDetails.emailAddress
89+ userDetails() .emailAddress
4590 }}</ span >
4691 </ mat-list-item >
4792 < mat-divider > </ mat-divider >
4893 < mat-list-item role ="listitem ">
4994 < span class ="console-app__list-key "> User role</ span >
5095 < span class ="console-app__list-value "> {{
51- roleToDescription(userDetails.role)
96+ roleToDescription(userDetails() .role)
5297 }}</ span >
5398 </ mat-list-item >
54- @if (userDetails.password) {
99+ @if (userDetails() .password) {
55100 < mat-divider > </ mat-divider >
56101 < mat-list-item role ="listitem ">
57102 < span class ="console-app__list-key "> Password</ span >
@@ -60,7 +105,7 @@ <h2>User details</h2>
60105 >
61106 < input
62107 [type] ="isPasswordVisible ? 'text' : 'password' "
63- [value] ="userDetails.password "
108+ [value] ="userDetails() .password "
64109 disabled
65110 />
66111 < button
@@ -76,4 +121,5 @@ <h2>User details</h2>
76121 </ mat-list >
77122 </ mat-card-content >
78123 </ mat-card >
124+ }}
79125</ div >
0 commit comments