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:
Max Peintner 2022-10-19 15:18:44 +02:00 committed by GitHub
parent c8e1733b39
commit d2eb0b0d2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 101 additions and 59 deletions

View File

@ -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>

View File

@ -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' },
{

View File

@ -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);

View File

@ -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>

View File

@ -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>

View File

@ -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;
}

View File

@ -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) => {

View File

@ -212,10 +212,9 @@
"TITLE": "Einstellungen",
"GENERAL": "Allgemein",
"IDP": "Identity Provider",
"MFA": "Multifactor Authentication",
"SECURITY": "Passwort und Sicherheit",
"KEYS": "Schlüssel",
"PAT": "Personal Access Tokens",
"PASSWORDLESS": "Passwordless",
"USERGRANTS": "Authorizations",
"MEMBERSHIPS": "Memberships",
"METADATA": "Metadata"
@ -461,6 +460,7 @@
},
"PASSWORD": {
"TITLE": "Passwort",
"LABEL": "Ein sicheres Passwort trägt zum Schutz des Accounts bei.",
"DESCRIPTION": "Gebe das neue Passwort unter Einhaltung der Richtlinie für die Komplexität ein.",
"OLD": "Aktuelles Passwort",
"NEW": "Neues Passwort",
@ -482,9 +482,10 @@
"EMAILVERIFIED": "Email verifiziert",
"NOTVERIFIED": "nicht verifiziert",
"PREFERRED_LOGINNAME": "Bevorzugter Loginname",
"ISINITIAL": "Dieser Benutzer wurde noch nicht verifiziert.",
"LOGINMETHODS": {
"TITLE": "Kontaktinformationen",
"DESCRIPTION": "Die Kontaktinformationen werden benötigt, um Dir wichtige Informationen wie Verifikationsnachrichten und Links für das Zurücksetzen des Passworts per E-Mail zu senden.",
"DESCRIPTION": "Die Kontaktinformationen werden benötigt, um dir wichtige Informationen wie Verifikationsnachrichten und Links für das Zurücksetzen des Passworts per E-Mail zu senden.",
"EMAIL": {
"TITLE": "E-Mail",
"VALID": "Validiert",

View File

@ -212,10 +212,9 @@
"TITLE": "Settings",
"GENERAL": "General",
"IDP": "Identity Providers",
"MFA": "Multifactor Authentication",
"SECURITY": "Password and Security",
"KEYS": "Keys",
"PAT": "Personal Access Tokens",
"PASSWORDLESS": "Passwordless",
"USERGRANTS": "Authorizations",
"MEMBERSHIPS": "Memberships",
"METADATA": "Metadata"
@ -461,6 +460,7 @@
},
"PASSWORD": {
"TITLE": "Password",
"LABEL": "A secure password helps to protect the account",
"DESCRIPTION": "Enter the new password according to the policy below.",
"OLD": "Current Password",
"NEW": "New Password",
@ -482,6 +482,7 @@
"EMAILVERIFIED": "Email verified",
"NOTVERIFIED": "not verified",
"PREFERRED_LOGINNAME": "Preferred Loginname",
"ISINITIAL": "This users email is not verified yet.",
"LOGINMETHODS": {
"TITLE": "Contact Information",
"DESCRIPTION": "The provided information is used to send important information, like password reset e-mails to you.",
@ -565,7 +566,7 @@
"SAVED": "Profile saved successfully.",
"USERNAMECHANGED": "Username changed.",
"EMAILSAVED": "E-mail saved successfully.",
"INITEMAILSENT": "Initializing mail sent.",
"INITEMAILSENT": "Initialization mail sent.",
"PHONESAVED": "Phone saved successfully.",
"PHONEREMOVED": "Phone has been removed.",
"PHONEVERIFIED": "Phone verified successfully.",

View File

@ -212,10 +212,9 @@
"TITLE": "Paramètres",
"GENERAL": "Général",
"IDP": "Fournisseurs d'identité",
"MFA": "Authentification multifactorielle",
"SECURITY": "Mot de passe et sécurité",
"KEYS": "Clés",
"PAT": "Jetons d'accès personnels",
"PASSWORDLESS": "Sans mot de passe",
"USERGRANTS": "Autorisations",
"MEMBERSHIPS": "Adhésions",
"METADATA": "Métadonnées"
@ -461,6 +460,7 @@
},
"PASSWORD": {
"TITLE": "Mot de passe",
"LABEL": "Un mot de passe sécurisé permet de protéger le compte",
"DESCRIPTION": "Saisissez le nouveau mot de passe conformément à la politique ci-dessous.",
"OLD": "Mot de passe actuel",
"NEW": "Nouveau mot de passe",
@ -482,6 +482,7 @@
"EMAILVERIFIED": "Courriel vérifié",
"NOTVERIFIED": "non vérifié",
"PREFERRED_LOGINNAME": "Nom de connexion préféré",
"ISINITIAL": "Le mail de cet utilisateur n'a pas encore été vérifié.",
"LOGINMETHODS": {
"TITLE": "Informations sur le contact",
"DESCRIPTION": "Les informations fournies sont utilisées pour vous envoyer des informations importantes, comme des e-mails de réinitialisation de mot de passe.",

View File

@ -212,10 +212,9 @@
"TITLE": "Impostazioni",
"GENERAL": "Generale",
"IDP": "Identity Providers",
"MFA": "Autenticazione a più fattori",
"SECURITY": "Password e sicurezza",
"KEYS": "Chiavi",
"PAT": "Personal Access Tokens",
"PASSWORDLESS": "Passwordless",
"USERGRANTS": "Autorizzazioni",
"MEMBERSHIPS": "Memberships",
"METADATA": "Metadati"
@ -461,6 +460,7 @@
},
"PASSWORD": {
"TITLE": "Password",
"LABEL": "Una password sicura aiuta a proteggere l'account",
"DESCRIPTION": "Inserisci la nuova password secondo i requisiti.",
"OLD": "Password attuale",
"NEW": "Nuova password",
@ -482,6 +482,7 @@
"EMAILVERIFIED": "Email verificata",
"NOTVERIFIED": "non verificato",
"PREFERRED_LOGINNAME": "Loginname preferito",
"ISINITIAL": "L'e-mail di questo utente non è ancora stata verificata.",
"LOGINMETHODS": {
"TITLE": "Informazioni di contatto",
"DESCRIPTION": "Le informazioni fornite sono utilizzate per inviare informazioni importanti, come le e-mail di reset della password.",

View File

@ -212,10 +212,9 @@
"TITLE": "设置",
"GENERAL": "通用",
"IDP": "身份提供者",
"MFA": "多因素认证",
"SECURITY": "密码和安全",
"KEYS": "秘钥",
"PAT": "个人访问令牌",
"PASSWORDLESS": "无密码认证",
"USERGRANTS": "授权",
"MEMBERSHIPS": "成员身份",
"METADATA": "元数据"
@ -461,6 +460,7 @@
},
"PASSWORD": {
"TITLE": "密码",
"LABEL": "安全密码有助于保护帐户",
"DESCRIPTION": "根据以下策略输入新密码。",
"OLD": "当前密码",
"NEW": "新密码",
@ -482,6 +482,7 @@
"EMAILVERIFIED": "电子邮件已验证",
"NOTVERIFIED": "未验证",
"PREFERRED_LOGINNAME": "首选登录名",
"ISINITIAL": "此用户电子邮件尚未验证。",
"LOGINMETHODS": {
"TITLE": "联系信息",
"DESCRIPTION": "提供的信息用于向您发送重要信息,例如密码重置电子邮件。",