fix(console): phone, email, branding dialogs (#7539)

* fix: phone, email, branding dialogs

* use full width for phone number

* fix user create phone width

* reset width

---------

Co-authored-by: Elio Bischof <elio@zitadel.com>
This commit is contained in:
Max Peintner 2024-03-14 14:38:09 +01:00 committed by GitHub
parent 802b6c7fd1
commit 8be64f4991
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 44 additions and 28 deletions

View File

@ -1,6 +1,8 @@
<h1 class="title">{{ 'PROJECT.PAGES.PRIVATELABEL.DIALOG.TITLE' | translate }} {{ data?.number }}</h1> <h1 mat-dialog-title class="title">{{ 'PROJECT.PAGES.PRIVATELABEL.DIALOG.TITLE' | translate }} {{ data?.number }}</h1>
<p class="desc cnsl-secondary-text">{{ 'PROJECT.PAGES.PRIVATELABEL.DIALOG.DESCRIPTION' | translate }}</p>
<div mat-dialog-content> <div mat-dialog-content>
<p class="desc cnsl-secondary-text">{{ 'PROJECT.PAGES.PRIVATELABEL.DIALOG.DESCRIPTION' | translate }}</p>
<mat-radio-group class="project-radio-group" [(ngModel)]="setting"> <mat-radio-group class="project-radio-group" [(ngModel)]="setting">
<mat-radio-button class="radio-button" *ngFor="let selection of settings" [value]="selection"> <mat-radio-button class="radio-button" *ngFor="let selection of settings" [value]="selection">
<span class="label">{{ 'PROJECT.PAGES.PRIVATELABEL.' + selection + '.TITLE' | translate }}</span> <span class="label">{{ 'PROJECT.PAGES.PRIVATELABEL.' + selection + '.TITLE' | translate }}</span>

View File

@ -56,7 +56,6 @@
} }
.phone-grid { .phone-grid {
max-width: 22rem;
display: grid; display: grid;
grid-template-columns: auto 1fr; grid-template-columns: auto 1fr;
column-gap: 1rem; column-gap: 1rem;

View File

@ -1,18 +1,22 @@
<h1 mat-dialog-title> <h1 mat-dialog-title>
<span class="title">{{ data.titleKey | translate }}</span> <span class="title">{{ data.titleKey | translate }}</span>
</h1> </h1>
<p class="desc cnsl-secondary-text">{{ data.descriptionKey | translate }}</p>
<div mat-dialog-content> <div mat-dialog-content>
<form [formGroup]="dialogForm" (ngSubmit)="closeDialogWithValue()"> <p class="desc cnsl-secondary-text">{{ data.descriptionKey | translate }}</p>
<div class="phone-grid">
<cnsl-form-field *ngIf="isPhone"> <form class="edit-dialog-form" [formGroup]="dialogForm" (ngSubmit)="closeDialogWithValue()">
<div class="phone-grid" *ngIf="isPhone">
<cnsl-form-field class="edit-dialog-formfield">
<cnsl-label>{{ 'USER.PROFILE.COUNTRY' | translate }}</cnsl-label> <cnsl-label>{{ 'USER.PROFILE.COUNTRY' | translate }}</cnsl-label>
<mat-select [(value)]="selected" [compareWith]="compareCountries" (selectionChange)="setCountryCallingCode()"> <mat-select [(value)]="selected" [compareWith]="compareCountries" (selectionChange)="setCountryCallingCode()">
<mat-select-trigger> <span class="fi fi-{{ selected?.countryCode | lowercase }}"></span></mat-select-trigger> <mat-select-trigger>
<span class="fi fi-{{ selected?.countryCode | lowercase }}"></span>
<span class="edit-dialog-phone-country-name">{{ selected?.countryName }}</span>
</mat-select-trigger>
<mat-option *ngFor="let country of countryPhoneCodes" [value]="country"> <mat-option *ngFor="let country of countryPhoneCodes" [value]="country">
<span class="fi fi-{{ country.countryCode | lowercase }}"></span> <span class="fi fi-{{ country.countryCode | lowercase }}"></span>
<span class="phone-country-name">{{ country.countryName }}</span> <span class="edit-dialog-phone-country-name">{{ country.countryName }}</span>
<span class="phone-country-code">+{{ country.countryCallingCode }}</span> <span class="edit-dialog-phone-country-code">+{{ country.countryCallingCode }}</span>
</mat-option> </mat-option>
</mat-select> </mat-select>
</cnsl-form-field> </cnsl-form-field>
@ -26,6 +30,17 @@
/> />
</cnsl-form-field> </cnsl-form-field>
</div> </div>
<div *ngIf="!isPhone">
<cnsl-form-field>
<cnsl-label>{{ data.labelKey | translate }}</cnsl-label>
<input
cnslInput
[formControlName]="controlKey"
matTooltip="{{ 'USER.PROFILE.PHONE_HINT' | translate }}"
[matTooltipDisabled]="!isPhone"
/>
</cnsl-form-field>
</div>
<ng-container *ngIf="data.type === EditDialogType.EMAIL && data.isVerifiedTextKey"> <ng-container *ngIf="data.type === EditDialogType.EMAIL && data.isVerifiedTextKey">
<mat-checkbox class="verified-checkbox" [(ngModel)]="isVerified"> <mat-checkbox class="verified-checkbox" [(ngModel)]="isVerified">
@ -37,8 +52,8 @@
</ng-container> </ng-container>
</form> </form>
</div> </div>
<div mat-dialog-actions class="action"> <div mat-dialog-actions class="edit-dialog-actions">
<button mat-stroked-button class="ok-button" (click)="closeDialog()"> <button mat-stroked-button (click)="closeDialog()">
{{ data.cancelKey | translate }} {{ data.cancelKey | translate }}
</button> </button>

View File

@ -1,4 +1,4 @@
.formfield { .edit-dialog-formfield {
width: 100%; width: 100%;
} }
@ -10,34 +10,34 @@
font-size: 14px; font-size: 14px;
} }
.action { .edit-dialog-actions {
display: flex; display: flex;
justify-content: flex-end; justify-content: space-between;
.ok-button {
margin-left: 0.5rem;
}
button { button {
border-radius: 0.5rem; border-radius: 0.5rem;
} }
} }
.phone-grid { .edit-dialog-form {
max-width: 22rem; width: 100%;
display: grid;
grid-template-columns: auto 1fr;
column-gap: 1rem;
@media only screen and (max-width: 500px) { .phone-grid {
grid-template-columns: 1fr; display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
column-gap: 1rem;
@media only screen and (max-width: 500px) {
grid-template-columns: 1fr;
}
} }
} }
.phone-country-name { .edit-dialog-phone-country-name {
padding: 0 0.5em; padding: 0 0.5em;
margin-left: 1rem;
} }
.phone-country-code { .edit-dialog-phone-country-code {
color: darkgrey; color: darkgrey;
} }