mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-13 17:02:11 +00:00
fix(console): split password from contact information, initialization mail on top (#4380)
* chore(console): split password from contact information * change user detail, initialization mail * fix translation * Update console/src/assets/i18n/de.json Co-authored-by: Elio Bischof <eliobischof@gmail.com> * Update console/src/assets/i18n/de.json Co-authored-by: Elio Bischof <eliobischof@gmail.com> * Update console/src/assets/i18n/en.json Co-authored-by: Elio Bischof <eliobischof@gmail.com> * Update console/src/assets/i18n/fr.json Co-authored-by: Elio Bischof <eliobischof@gmail.com> * Update console/src/assets/i18n/fr.json Co-authored-by: Elio Bischof <eliobischof@gmail.com> * Update console/src/assets/i18n/it.json Co-authored-by: Elio Bischof <eliobischof@gmail.com> * Update console/src/assets/i18n/en.json Co-authored-by: Elio Bischof <eliobischof@gmail.com> * i18n Co-authored-by: Elio Bischof <eliobischof@gmail.com>
This commit is contained in:
@@ -85,11 +85,28 @@
|
||||
<cnsl-external-idps *ngIf="user && user.id" [userId]="user.id" [service]="userService"></cnsl-external-idps>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="currentSetting === 'passwordless'">
|
||||
<cnsl-auth-passwordless *ngIf="user" #mfaComponent></cnsl-auth-passwordless>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="currentSetting === 'security'">
|
||||
<cnsl-card *ngIf="user && user.human" title="{{ 'USER.PASSWORD.TITLE' | translate }}">
|
||||
<div class="contact-method-col">
|
||||
<div class="contact-method-row">
|
||||
<div class="left">
|
||||
<span class="label cnsl-secondary-text">{{ 'USER.PASSWORD.LABEL' | translate }}</span>
|
||||
<span>*********</span>
|
||||
|
||||
<ng-content select="[pwdAction]"></ng-content>
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<a matTooltip="{{ 'USER.PASSWORD.SET' | translate }}" [routerLink]="['password']" mat-icon-button>
|
||||
<i class="las la-pen"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</cnsl-card>
|
||||
|
||||
<cnsl-auth-passwordless *ngIf="user" #mfaComponent></cnsl-auth-passwordless>
|
||||
|
||||
<ng-container *ngIf="currentSetting === 'mfa'">
|
||||
<cnsl-auth-user-mfa *ngIf="user" #mfaComponent></cnsl-auth-user-mfa>
|
||||
</ng-container>
|
||||
|
||||
|
||||
@@ -47,9 +47,8 @@ export class AuthUserDetailComponent implements OnDestroy {
|
||||
|
||||
public settingsList: SidenavSetting[] = [
|
||||
{ id: 'general', i18nKey: 'USER.SETTINGS.GENERAL' },
|
||||
{ id: 'security', i18nKey: 'USER.SETTINGS.SECURITY' },
|
||||
{ id: 'idp', i18nKey: 'USER.SETTINGS.IDP' },
|
||||
{ id: 'passwordless', i18nKey: 'USER.SETTINGS.PASSWORDLESS' },
|
||||
{ id: 'mfa', i18nKey: 'USER.SETTINGS.MFA' },
|
||||
{ id: 'grants', i18nKey: 'USER.SETTINGS.USERGRANTS' },
|
||||
{ id: 'memberships', i18nKey: 'USER.SETTINGS.MEMBERSHIPS' },
|
||||
{
|
||||
|
||||
@@ -8,7 +8,11 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
})
|
||||
export class ResendEmailDialogComponent {
|
||||
public email: string = '';
|
||||
constructor(public dialogRef: MatDialogRef<ResendEmailDialogComponent>, @Inject(MAT_DIALOG_DATA) public data: any) {}
|
||||
constructor(public dialogRef: MatDialogRef<ResendEmailDialogComponent>, @Inject(MAT_DIALOG_DATA) public data: any) {
|
||||
if (data.email) {
|
||||
this.email = data.email;
|
||||
}
|
||||
}
|
||||
|
||||
closeDialog(email: string = ''): void {
|
||||
this.dialogRef.close(email);
|
||||
|
||||
@@ -1,24 +1,4 @@
|
||||
<div class="contact-method-col" *ngIf="human">
|
||||
<div class="contact-method-row">
|
||||
<div class="left">
|
||||
<span class="label cnsl-secondary-text">{{ 'USER.PROFILE.PASSWORD' | translate }}</span>
|
||||
<span class="name">*********</span>
|
||||
|
||||
<ng-content select="[pwdAction]"></ng-content>
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<a
|
||||
matTooltip="{{ 'USER.PASSWORD.SET' | translate }}"
|
||||
[disabled]="!canWrite"
|
||||
[routerLink]="['password']"
|
||||
mat-icon-button
|
||||
>
|
||||
<i class="las la-pen"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="contact-method-row">
|
||||
<div class="left">
|
||||
<span class="label cnsl-secondary-text">{{ 'USER.EMAIL' | translate }}</span>
|
||||
|
||||
@@ -59,6 +59,17 @@
|
||||
>
|
||||
<span *ngIf="!loading && !user">{{ 'USER.PAGES.NOUSER' | translate }}</span>
|
||||
|
||||
<div *ngIf="user && user.state === UserState.USER_STATE_INITIAL">
|
||||
<cnsl-info-section class="is-initial-info-section" [type]="InfoSectionType.ALERT">
|
||||
<div class="is-initial-row">
|
||||
<span>{{ 'USER.ISINITIAL' | translate }}</span>
|
||||
<button [disabled]="(canWrite$ | async) === false" mat-stroked-button (click)="resendInitEmail()">
|
||||
{{ 'USER.RESENDINITIALEMAIL' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
</cnsl-info-section>
|
||||
</div>
|
||||
|
||||
<ng-container *ngIf="currentSetting === 'general'">
|
||||
<ng-template cnslHasRole [hasRole]="['user.read$', 'user.read:' + user.id]">
|
||||
<cnsl-card *ngIf="user.human" title="{{ 'USER.PROFILE.TITLE' | translate }}">
|
||||
@@ -113,16 +124,6 @@
|
||||
>
|
||||
{{ 'USER.PASSWORD.RESENDNOTIFICATION' | translate }}
|
||||
</button>
|
||||
<button
|
||||
emailAction
|
||||
[disabled]="(canWrite$ | async) === false"
|
||||
class="resendemail"
|
||||
*ngIf="user.state === UserState.USER_STATE_INITIAL"
|
||||
mat-stroked-button
|
||||
(click)="resendInitEmail()"
|
||||
>
|
||||
{{ 'USER.RESENDINITIALEMAIL' | translate }}
|
||||
</button>
|
||||
</cnsl-contact>
|
||||
</cnsl-card>
|
||||
</ng-template>
|
||||
@@ -169,12 +170,34 @@
|
||||
</ng-template>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="currentSetting && currentSetting === 'passwordless'">
|
||||
<ng-container *ngIf="currentSetting && currentSetting === 'security'">
|
||||
<cnsl-card *ngIf="user.human" title="{{ 'USER.PASSWORD.TITLE' | translate }}">
|
||||
<div class="contact-method-col">
|
||||
<div class="contact-method-row">
|
||||
<div class="left">
|
||||
<span class="label cnsl-secondary-text">{{ 'USER.PASSWORD.LABEL' | translate }}</span>
|
||||
<span>*********</span>
|
||||
|
||||
<ng-content select="[pwdAction]"></ng-content>
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<a
|
||||
matTooltip="{{ 'USER.PASSWORD.SET' | translate }}"
|
||||
[disabled]="(['user.write:' + user.id, 'user.write$'] | hasRole | async) === false"
|
||||
[routerLink]="['password']"
|
||||
mat-icon-button
|
||||
>
|
||||
<i class="las la-pen"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</cnsl-card>
|
||||
|
||||
<cnsl-passwordless *ngIf="user && !!user.human" [user]="user" [disabled]="(canWrite$ | async) === false">
|
||||
</cnsl-passwordless>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="currentSetting && currentSetting === 'mfa'">
|
||||
<cnsl-user-mfa *ngIf="user && user.human" [user]="user"></cnsl-user-mfa>
|
||||
</ng-container>
|
||||
|
||||
|
||||
@@ -18,6 +18,22 @@
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
.is-initial-info-section {
|
||||
margin-top: 1rem;
|
||||
display: block;
|
||||
|
||||
.is-initial-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
|
||||
button {
|
||||
display: block;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.icon-button {
|
||||
.icon {
|
||||
font-size: 1.2rem;
|
||||
@@ -39,10 +55,6 @@
|
||||
padding-top: 1rem;
|
||||
}
|
||||
|
||||
.resendemail {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.sp-wrapper {
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
@@ -25,8 +25,7 @@ const GENERAL: SidenavSetting = { id: 'general', i18nKey: 'USER.SETTINGS.GENERAL
|
||||
const GRANTS: SidenavSetting = { id: 'grants', i18nKey: 'USER.SETTINGS.USERGRANTS' };
|
||||
const METADATA: SidenavSetting = { id: 'metadata', i18nKey: 'USER.SETTINGS.METADATA' };
|
||||
const IDP: SidenavSetting = { id: 'idp', i18nKey: 'USER.SETTINGS.IDP' };
|
||||
const PASSWORDLESS: SidenavSetting = { id: 'passwordless', i18nKey: 'USER.SETTINGS.PASSWORDLESS' };
|
||||
const MFA: SidenavSetting = { id: 'mfa', i18nKey: 'USER.SETTINGS.MFA' };
|
||||
const SECURITY: SidenavSetting = { id: 'security', i18nKey: 'USER.SETTINGS.SECURITY' };
|
||||
const PERSONALACCESSTOKEN: SidenavSetting = { id: 'pat', i18nKey: 'USER.SETTINGS.PAT' };
|
||||
const KEYS: SidenavSetting = { id: 'keys', i18nKey: 'USER.SETTINGS.KEYS' };
|
||||
const MEMBERSHIPS: SidenavSetting = { id: 'memberships', i18nKey: 'USER.SETTINGS.MEMBERSHIPS' };
|
||||
@@ -122,7 +121,7 @@ export class UserDetailComponent implements OnInit {
|
||||
this.user = resp.user;
|
||||
|
||||
if (this.user.human) {
|
||||
this.settingsList = [GENERAL, MFA, PASSWORDLESS, IDP, GRANTS, MEMBERSHIPS, METADATA];
|
||||
this.settingsList = [GENERAL, SECURITY, IDP, GRANTS, MEMBERSHIPS, METADATA];
|
||||
} else if (this.user.machine) {
|
||||
this.settingsList = [GENERAL, GRANTS, MEMBERSHIPS, PERSONALACCESSTOKEN, KEYS, METADATA];
|
||||
}
|
||||
@@ -378,6 +377,9 @@ export class UserDetailComponent implements OnInit {
|
||||
public resendInitEmail(): void {
|
||||
const dialogRef = this.dialog.open(ResendEmailDialogComponent, {
|
||||
width: '400px',
|
||||
data: {
|
||||
email: this.user.human?.email?.email ?? '',
|
||||
},
|
||||
});
|
||||
|
||||
dialogRef.afterClosed().subscribe((resp) => {
|
||||
|
||||
Reference in New Issue
Block a user