feat(console): v2 feature cleanup, fix styling issues, instance naming (#3530)

* new console

* move npm ci to angular build

* rel path for assets

* local grpc copy

* login policy, rm clear views, features rel path

* login_hint param

* edit default color values

* remove features, zitadel-tier, contact styles

* html formatter

* rm feature restrictions, fix theming issues

* instance naming

* statehandler

* rm class

* rm class

* update footer links

* statehandler

* stroked color

Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
Max Peintner
2022-04-29 10:25:12 +02:00
committed by GitHub
co-authored by Livio Amstutz
parent f9e79ef8fe
commit 41e60b3d8a
93 changed files with 5256 additions and 13100 deletions
@@ -1,18 +1,14 @@
<cnsl-detail-layout [hasBackButton]="true" [title]="'POLICY.PRIVATELABELING.TITLE' | translate">
<p class="policy-applied-to" sub>{{'POLICY.APPLIEDTO' | translate}}:
<strong *ngIf="org; else iam">{{org.name}}</strong>
<ng-template #iam><strong>{{'MENU.SYSTEM' | translate}}</strong>
<p class="policy-applied-to" sub>
{{ 'POLICY.APPLIEDTO' | translate }}:
<strong *ngIf="org; else iam">{{ org.name }}</strong>
<ng-template #iam
><strong>{{ 'MENU.INSTANCE' | translate }}</strong>
</ng-template>
</p>
<div class="privatelabeling-policy">
<cnsl-info-section *ngIf="isDefault"> {{'POLICY.DEFAULTLABEL' | translate}}</cnsl-info-section>
<cnsl-info-section
*ngIf="serviceType === PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async) === false"
[featureLink]="['/org/features']" class="info" [type]="InfoSectionType.WARN">
<span [innerHTML]="'FEATURES.NOTAVAILABLE' | translate: ({value: 'label_policy.private_label'})"></span>
</cnsl-info-section>
<cnsl-info-section *ngIf="isDefault"> {{ 'POLICY.DEFAULTLABEL' | translate }}</cnsl-info-section>
<div class="spinner-wr">
<mat-spinner diameter="30" *ngIf="loading" color="primary"></mat-spinner>
@@ -23,30 +19,35 @@
<mat-button-toggle [value]="Theme.LIGHT">
<div class="toggle-row">
<i class="icon las la-sun"></i>
<span>{{'POLICY.PRIVATELABELING.LIGHT' | translate}}</span>
<span>{{ 'POLICY.PRIVATELABELING.LIGHT' | translate }}</span>
<div *ngIf="theme === Theme.LIGHT" class="current-dot"></div>
</div>
</mat-button-toggle>
<mat-button-toggle [value]=" Theme.DARK">
<mat-button-toggle [value]="Theme.DARK">
<div class="toggle-row">
<i class="icon las la-moon"></i>
<span> {{'POLICY.PRIVATELABELING.DARK' | translate}}</span>
<span> {{ 'POLICY.PRIVATELABELING.DARK' | translate }}</span>
<div *ngIf="theme === Theme.DARK" class="current-dot"></div>
</div>
</mat-button-toggle>
</mat-button-toggle-group>
<mat-button-toggle-group class="theme-toggle" class="buttongroup" [(ngModel)]="view" name="displayview"
aria-label="Display View">
<mat-button-toggle-group
class="theme-toggle"
class="buttongroup"
[(ngModel)]="view"
name="displayview"
aria-label="Display View"
>
<mat-button-toggle [value]="View.PREVIEW">
<div class="toggle-row">
<span>{{'POLICY.PRIVATELABELING.VIEWS.PREVIEW' | translate}}</span>
<span>{{ 'POLICY.PRIVATELABELING.VIEWS.PREVIEW' | translate }}</span>
<div *ngIf="view === View.PREVIEW" class="current-dot"></div>
</div>
</mat-button-toggle>
<mat-button-toggle [value]="View.CURRENT">
<div class="toggle-row">
<span> {{'POLICY.PRIVATELABELING.VIEWS.CURRENT' | translate}}</span>
<span> {{ 'POLICY.PRIVATELABELING.VIEWS.CURRENT' | translate }}</span>
<div *ngIf="view === View.CURRENT" class="current-dot"></div>
</div>
</mat-button-toggle>
@@ -55,22 +56,31 @@
<span class="fill-space"></span>
<ng-template cnslHasRole [hasRole]="['policy.delete']">
<button class="pl-action-button"
<button
class="pl-action-button"
*ngIf="view === View.CURRENT && serviceType === PolicyComponentServiceType.MGMT && !isDefault"
matTooltip="{{'POLICY.RESET' | translate}}" color="warn" (click)="removePolicy()" mat-stroked-button>
{{'POLICY.RESET' | translate}}
matTooltip="{{ 'POLICY.RESET' | translate }}"
color="warn"
(click)="removePolicy()"
mat-stroked-button
>
{{ 'POLICY.RESET' | translate }}
</button>
</ng-template>
<button *ngIf="view === View.PREVIEW" class="pl-action-button"
[disabled]="(serviceType === PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async) === false)"
mat-raised-button color="primary" (click)="activatePolicy()">
{{'POLICY.PRIVATELABELING.ACTIVATEPREVIEW' | translate}}
<button
*ngIf="view === View.PREVIEW"
class="pl-action-button"
mat-raised-button
color="primary"
(click)="activatePolicy()"
>
{{ 'POLICY.PRIVATELABELING.ACTIVATEPREVIEW' | translate }}
</button>
</div>
<cnsl-info-section *ngIf="view === View.PREVIEW" class="desc cnsl-secondary-text">
{{'POLICY.PRIVATELABELING.PREVIEW_DESCRIPTION' | translate}}
{{ 'POLICY.PRIVATELABELING.PREVIEW_DESCRIPTION' | translate }}
</cnsl-info-section>
<div *ngIf="previewData && data" class="lab-policy-content">
@@ -82,42 +92,67 @@
<i class="icon las la-image"></i>
<span>Logos</span>
<span class="space"></span>
<small class="cnsl-secondary-text" *ngIf="theme === Theme.DARK">({{'POLICY.PRIVATELABELING.DARK' |
translate}})</small>
<small class="cnsl-secondary-text" *ngIf="theme === Theme.LIGHT">({{'POLICY.PRIVATELABELING.LIGHT' |
translate}})</small>
<small class="cnsl-secondary-text" *ngIf="theme === Theme.DARK"
>({{ 'POLICY.PRIVATELABELING.DARK' | translate }})</small
>
<small class="cnsl-secondary-text" *ngIf="theme === Theme.LIGHT"
>({{ 'POLICY.PRIVATELABELING.LIGHT' | translate }})</small
>
</div>
</mat-panel-title>
</mat-expansion-panel-header>
<div>
<p class="cnsl-secondary-button">{{'POLICY.PRIVATELABELING.USEOFLOGO' | translate}}</p>
<p class="cnsl-secondary-button">{{ 'POLICY.PRIVATELABELING.USEOFLOGO' | translate }}</p>
<cnsl-info-section *ngIf="view !== View.CURRENT" class="max-size-desc"> {{'POLICY.PRIVATELABELING.MAXSIZE' |
translate}}
<cnsl-info-section *ngIf="view !== View.CURRENT" class="max-size-desc">
{{ 'POLICY.PRIVATELABELING.MAXSIZE' | translate }}
</cnsl-info-section>
<cnsl-info-section *ngIf="view !== View.CURRENT" class="max-size-desc">
{{'POLICY.PRIVATELABELING.EMAILNOSVG' | translate}}
{{ 'POLICY.PRIVATELABELING.EMAILNOSVG' | translate }}
</cnsl-info-section>
<div class="logo-view" [attr.data-e2e]="'image-part-logo'">
<span class="label cnsl-secondary-text">Logo</span>
<div class="img-wrapper">
<ng-container
*ngIf="view === View.PREVIEW ? (theme === Theme.DARK ? previewData.logoUrlDark : previewData.logoUrl): (theme === Theme.DARK ? data.logoUrlDark : data.logoUrl) as logoSrc; else addLogoButton">
*ngIf="
view === View.PREVIEW
? theme === Theme.DARK
? previewData.logoUrlDark
: previewData.logoUrl
: theme === Theme.DARK
? data.logoUrlDark
: data.logoUrl as logoSrc;
else addLogoButton
"
>
<img [src]="logoSrc" alt="logo" />
<button class="dl-btn" mat-icon-button color="warn" (click)="deleteAsset(AssetType.LOGO, theme)"
[disabled]="view === View.CURRENT || (serviceType === PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async) === false)"
matTooltip="{{'ACTIONS.DELETE' | translate}}">
<button
class="dl-btn"
mat-icon-button
color="warn"
(click)="deleteAsset(AssetType.LOGO, theme)"
[disabled]="view === View.CURRENT"
matTooltip="{{ 'ACTIONS.DELETE' | translate }}"
>
<i class="las la-ban"></i>
</button>
</ng-container>
<ng-template #addLogoButton>
<input #selectedFile style="display: none;" class="file-input" type="file"
(change)="onDropLogo(theme, $any($event.target).files)">
<button mat-icon-button matTooltip="{{'POLICY.PRIVATELABELING.BTN' | translate}}"
*ngIf="view !== View.CURRENT && (serviceType === PolicyComponentServiceType.ADMIN || (serviceType === PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async)))"
(click)="$event.preventDefault(); selectedFile.click();">
<input
#selectedFile
style="display: none"
class="file-input"
type="file"
(change)="onDropLogo(theme, $any($event.target).files)"
/>
<button
mat-icon-button
matTooltip="{{ 'POLICY.PRIVATELABELING.BTN' | translate }}"
*ngIf="view !== View.CURRENT"
(click)="$event.preventDefault(); selectedFile.click()"
>
<mat-icon>add</mat-icon>
</button>
</ng-template>
@@ -128,20 +163,43 @@
<span class="label cnsl-secondary-text">Icon</span>
<div class="img-wrapper icon">
<ng-container
*ngIf="view === View.PREVIEW ? (theme === Theme.DARK ? previewData.iconUrlDark : previewData.iconUrl): (theme === Theme.DARK ? data.iconUrlDark : data.iconUrl) as iconSrc; else addIconButton">
*ngIf="
view === View.PREVIEW
? theme === Theme.DARK
? previewData.iconUrlDark
: previewData.iconUrl
: theme === Theme.DARK
? data.iconUrlDark
: data.iconUrl as iconSrc;
else addIconButton
"
>
<img [src]="iconSrc" alt="icon" />
<button class="dl-btn" mat-icon-button color="warn" (click)="deleteAsset(AssetType.ICON, theme)"
[disabled]="view === View.CURRENT || (serviceType === PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async) === false)"
matTooltip="{{'ACTIONS.DELETE' | translate}}">
<button
class="dl-btn"
mat-icon-button
color="warn"
(click)="deleteAsset(AssetType.ICON, theme)"
[disabled]="view === View.CURRENT"
matTooltip="{{ 'ACTIONS.DELETE' | translate }}"
>
<i class="las la-ban"></i>
</button>
</ng-container>
<ng-template #addIconButton>
<input #selectedIconFile style="display: none;" class="file-input" type="file"
(change)="onDropIcon(theme, $any($event.target).files)">
<button mat-icon-button matTooltip="{{'POLICY.PRIVATELABELING.BTN' | translate}}"
*ngIf="view !== View.CURRENT && (serviceType === PolicyComponentServiceType.ADMIN || (serviceType === PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async)))"
(click)="$event.preventDefault(); selectedIconFile.click();">
<input
#selectedIconFile
style="display: none"
class="file-input"
type="file"
(change)="onDropIcon(theme, $any($event.target).files)"
/>
<button
mat-icon-button
matTooltip="{{ 'POLICY.PRIVATELABELING.BTN' | translate }}"
*ngIf="view !== View.CURRENT"
(click)="$event.preventDefault(); selectedIconFile.click()"
>
<mat-icon>add</mat-icon>
</button>
</ng-template>
@@ -155,12 +213,14 @@
<mat-panel-title>
<div class="panel-title">
<i class="icon las la-palette"></i>
<span>{{'POLICY.PRIVATELABELING.COLORS' | translate}}</span>
<span>{{ 'POLICY.PRIVATELABELING.COLORS' | translate }}</span>
<span class="space"></span>
<small class="cnsl-secondary-text" *ngIf="theme === Theme.DARK">({{'POLICY.PRIVATELABELING.DARK' |
translate}})</small>
<small class="cnsl-secondary-text" *ngIf="theme === Theme.LIGHT">({{'POLICY.PRIVATELABELING.LIGHT' |
translate}})</small>
<small class="cnsl-secondary-text" *ngIf="theme === Theme.DARK"
>({{ 'POLICY.PRIVATELABELING.DARK' | translate }})</small
>
<small class="cnsl-secondary-text" *ngIf="theme === Theme.LIGHT"
>({{ 'POLICY.PRIVATELABELING.LIGHT' | translate }})</small
>
</div>
</mat-panel-title>
</mat-expansion-panel-header>
@@ -168,29 +228,49 @@
<ng-container *ngIf="theme === Theme.DARK">
<div class="colors" *ngIf="data && previewData">
<div class="color">
<cnsl-color [disabled]="view === View.CURRENT" [colorType]="ColorType.BACKGROUNDDARK"
(previewChanged)="previewData.backgroundColorDark = $event; savePolicy()" name="Background Color"
[color]="data.backgroundColorDark" [previewColor]="previewData.backgroundColorDark"></cnsl-color>
<cnsl-color
[disabled]="view === View.CURRENT"
[colorType]="ColorType.BACKGROUNDDARK"
(previewChanged)="previewData.backgroundColorDark = $event; savePolicy()"
name="Background Color"
[color]="data.backgroundColorDark"
[previewColor]="previewData.backgroundColorDark"
></cnsl-color>
</div>
<div class="color">
<cnsl-color [disabled]="view === View.CURRENT" [colorType]="ColorType.PRIMARY"
(previewChanged)="previewData.primaryColorDark = $event; savePolicy()" name="Primary Color"
[color]="data.primaryColorDark" [previewColor]="previewData.primaryColorDark">
<cnsl-color
[disabled]="view === View.CURRENT"
[colorType]="ColorType.PRIMARY"
(previewChanged)="previewData.primaryColorDark = $event; savePolicy()"
name="Primary Color"
[color]="data.primaryColorDark"
[previewColor]="previewData.primaryColorDark"
>
</cnsl-color>
</div>
<div class="color">
<cnsl-color [disabled]="view === View.CURRENT" [colorType]="ColorType.WARN"
(previewChanged)="previewData.warnColorDark = $event; savePolicy()" name="Warn Color"
[color]="data.warnColorDark" [previewColor]="previewData.warnColorDark">
<cnsl-color
[disabled]="view === View.CURRENT"
[colorType]="ColorType.WARN"
(previewChanged)="previewData.warnColorDark = $event; savePolicy()"
name="Warn Color"
[color]="data.warnColorDark"
[previewColor]="previewData.warnColorDark"
>
</cnsl-color>
</div>
<div class="color">
<cnsl-color [disabled]="view === View.CURRENT" [colorType]="ColorType.FONTDARK"
(previewChanged)="previewData.fontColorDark = $event; savePolicy()" name="Font Color"
[color]="data.fontColorDark" [previewColor]="previewData.fontColorDark">
<cnsl-color
[disabled]="view === View.CURRENT"
[colorType]="ColorType.FONTDARK"
(previewChanged)="previewData.fontColorDark = $event; savePolicy()"
name="Font Color"
[color]="data.fontColorDark"
[previewColor]="previewData.fontColorDark"
>
</cnsl-color>
</div>
</div>
@@ -199,28 +279,48 @@
<ng-container *ngIf="theme === Theme.LIGHT">
<div class="colors" *ngIf="data && previewData">
<div class="color">
<cnsl-color [disabled]="view === View.CURRENT" [colorType]="ColorType.BACKGROUNDLIGHT"
(previewChanged)="previewData.backgroundColor = $event; savePolicy()" name="Background Color"
[color]="data.backgroundColor" [previewColor]="previewData.backgroundColor"></cnsl-color>
<cnsl-color
[disabled]="view === View.CURRENT"
[colorType]="ColorType.BACKGROUNDLIGHT"
(previewChanged)="previewData.backgroundColor = $event; savePolicy()"
name="Background Color"
[color]="data.backgroundColor"
[previewColor]="previewData.backgroundColor"
></cnsl-color>
</div>
<div class="color">
<cnsl-color [disabled]="view === View.CURRENT" [colorType]="ColorType.PRIMARY"
(previewChanged)="previewData.primaryColor = $event; savePolicy()" name="Primary Color"
[color]="data.primaryColor" [previewColor]="previewData.primaryColor">
<cnsl-color
[disabled]="view === View.CURRENT"
[colorType]="ColorType.PRIMARY"
(previewChanged)="previewData.primaryColor = $event; savePolicy()"
name="Primary Color"
[color]="data.primaryColor"
[previewColor]="previewData.primaryColor"
>
</cnsl-color>
</div>
<div class="color">
<cnsl-color [disabled]="view === View.CURRENT" [colorType]="ColorType.WARN" name="Warn Color"
(previewChanged)="previewData.warnColor= $event; savePolicy()" [color]="data.warnColor"
[previewColor]="previewData.warnColor"></cnsl-color>
<cnsl-color
[disabled]="view === View.CURRENT"
[colorType]="ColorType.WARN"
name="Warn Color"
(previewChanged)="previewData.warnColor = $event; savePolicy()"
[color]="data.warnColor"
[previewColor]="previewData.warnColor"
></cnsl-color>
</div>
<div class="color">
<cnsl-color [disabled]="view === View.CURRENT" [colorType]="ColorType.FONTLIGHT"
(previewChanged)="previewData.fontColor = $event; savePolicy()" name="Font Color"
[color]="data.fontColor" [previewColor]="previewData.fontColor"></cnsl-color>
<cnsl-color
[disabled]="view === View.CURRENT"
[colorType]="ColorType.FONTLIGHT"
(previewChanged)="previewData.fontColor = $event; savePolicy()"
name="Font Color"
[color]="data.fontColor"
[previewColor]="previewData.fontColor"
></cnsl-color>
</div>
</div>
</ng-container>
@@ -231,33 +331,53 @@
<mat-panel-title>
<div class="panel-title">
<i class="icon las la-font"></i>
{{'POLICY.PRIVATELABELING.FONT' | translate}}
{{ 'POLICY.PRIVATELABELING.FONT' | translate }}
</div>
</mat-panel-title>
</mat-expansion-panel-header>
<div class="fonts">
<cnsl-info-section class="info-section">{{'POLICY.PRIVATELABELING.FONTINLOGINONLY' | translate}}
<cnsl-info-section class="info-section"
>{{ 'POLICY.PRIVATELABELING.FONTINLOGINONLY' | translate }}
</cnsl-info-section>
<div class="font-preview" *ngIf="previewData.fontUrl; else addFontButton">
<mat-icon class="icon">text_fields</mat-icon>
<span class="fill-space"></span>
<button class="dl-btn"
[disabled]="view === View.CURRENT || (serviceType === PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async) === false)"
mat-icon-button color="warn" (click)="deleteFont()" matTooltip="{{'ACTIONS.DELETE' | translate}}">
<button
class="dl-btn"
[disabled]="view === View.CURRENT"
mat-icon-button
color="warn"
(click)="deleteFont()"
matTooltip="{{ 'ACTIONS.DELETE' | translate }}"
>
<i class="las la-ban"></i>
</button>
</div>
<ng-template #addFontButton>
<div class="font-add" cnslDropzone (hovered)="toggleHoverFont($event)" (dropped)="onDropFont($event)"
[class.hovering]="isHoveringOverFont">
<input #selectedFontFile style="display: none;" class="file-input" type="file"
(change)="onDropFont($any($event.target).files)">
<a class="btn" mat-icon-button
*ngIf="view !== View.CURRENT && (serviceType === PolicyComponentServiceType.ADMIN || (serviceType === PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async)))"
(click)="selectedFontFile.click()" matTooltip="{{'POLICY.PRIVATELABELING.BTN' | translate}}">
<div
class="font-add"
cnslDropzone
(hovered)="toggleHoverFont($event)"
(dropped)="onDropFont($event)"
[class.hovering]="isHoveringOverFont"
>
<input
#selectedFontFile
style="display: none"
class="file-input"
type="file"
(change)="onDropFont($any($event.target).files)"
/>
<a
class="btn"
mat-icon-button
*ngIf="view !== View.CURRENT"
(click)="selectedFontFile.click()"
matTooltip="{{ 'POLICY.PRIVATELABELING.BTN' | translate }}"
>
<mat-icon>add</mat-icon>
</a>
</div>
@@ -270,37 +390,31 @@
<mat-panel-title>
<div class="panel-title">
<i class="icon las la-universal-access"></i>
{{'POLICY.PRIVATELABELING.ADVANCEDBEHAVIOR' | translate}}
{{ 'POLICY.PRIVATELABELING.ADVANCEDBEHAVIOR' | translate }}
</div>
</mat-panel-title>
</mat-expansion-panel-header>
<div class="adv-container" *ngIf="previewData">
<ng-container
*ngIf="view !== View.CURRENT && serviceType === PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async) === false">
<cnsl-info-section [featureLink]="['/org/features']" class="info" [type]="InfoSectionType.WARN">
<span [innerHTML]="'FEATURES.NOTAVAILABLE' | translate: ({value: 'label_policy.private_label'})"></span>
</cnsl-info-section>
</ng-container>
<mat-slide-toggle class="toggle" color="primary" ngDefaultControl
[disabled]="view === View.CURRENT || (serviceType === PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async) === false)"
<mat-slide-toggle
class="toggle"
color="primary"
ngDefaultControl
[disabled]="view === View.CURRENT"
[(ngModel)]="view === View.CURRENT ? data.hideLoginNameSuffix : previewData.hideLoginNameSuffix"
(change)="savePolicy()">
{{'POLICY.DATA.HIDELOGINNAMESUFFIX' | translate}}
(change)="savePolicy()"
>
{{ 'POLICY.DATA.HIDELOGINNAMESUFFIX' | translate }}
</mat-slide-toggle>
<ng-container
*ngIf="view !== View.CURRENT && serviceType === PolicyComponentServiceType.MGMT && (['label_policy.watermark'] | hasFeature | async) === false">
<cnsl-info-section [featureLink]="['/org/features']" class="info" type]="InfoSectionType.WARN">
<span [innerHTML]="'FEATURES.NOTAVAILABLE' | translate: ({value: 'label_policy.watermark'})"></span>
</cnsl-info-section>
</ng-container>
<mat-slide-toggle class="toggle" color="primary" ngDefaultControl
[disabled]="view === View.CURRENT || (serviceType === PolicyComponentServiceType.MGMT && (['label_policy.watermark'] | hasFeature | async) === false)"
<mat-slide-toggle
class="toggle"
color="primary"
ngDefaultControl
[disabled]="view === View.CURRENT"
[(ngModel)]="view === View.CURRENT ? data.disableWatermark : previewData.disableWatermark"
(change)="savePolicy()">
{{'POLICY.DATA.DISABLEWATERMARK' | translate}}
(change)="savePolicy()"
>
{{ 'POLICY.DATA.DISABLEWATERMARK' | translate }}
</mat-slide-toggle>
</div>
</mat-expansion-panel>
@@ -310,8 +424,12 @@
<div class="preview-wrapper">
<div class="col">
<cnsl-preview [refresh]="refreshPreview" [theme]="theme" class="preview"
[policy]="view === View.PREVIEW ? previewData : data">
<cnsl-preview
[refresh]="refreshPreview"
[theme]="theme"
class="preview"
[policy]="view === View.PREVIEW ? previewData : data"
>
</cnsl-preview>
</div>
</div>
@@ -320,4 +438,4 @@
<cnsl-policy-grid class="grid" [currentPolicy]="currentPolicy" [type]="serviceType" tagForFilter="text">
</cnsl-policy-grid>
</div>
</cnsl-detail-layout>
</cnsl-detail-layout>