mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-25 13:58:46 +00:00
feat: rehauled console (#3525)
* new console * move npm ci to angular build * rel path for assets * local grpc copy * login policy, rm clear views, features rel path * lock Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
co-authored by
Livio Amstutz
parent
00f7dbe875
commit
08ae39ae19
+306
-318
@@ -1,335 +1,323 @@
|
||||
<div class="policy enlarged-container">
|
||||
<div class="header">
|
||||
<a [routerLink]="[ serviceType === PolicyComponentServiceType.ADMIN ? '/iam/policies' : '/org']" mat-icon-button>
|
||||
<mat-icon class="icon">arrow_back</mat-icon>
|
||||
</a>
|
||||
<div class="col">
|
||||
<h1>{{'POLICY.PRIVATELABELING.TITLE' | translate}}</h1>
|
||||
<p>{{'POLICY.PRIVATELABELING.DESCRIPTION' | translate}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="desc">{{'POLICY.PRIVATELABELING.PREVIEW_DESCRIPTION' | translate}}</p>
|
||||
<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>
|
||||
|
||||
<div class="spinner-wr">
|
||||
<mat-spinner diameter="30" *ngIf="loading" color="primary"></mat-spinner>
|
||||
</div>
|
||||
|
||||
<div class="top-row">
|
||||
<div>
|
||||
<p>{{'POLICY.PRIVATELABELING.THEME' | translate}}</p>
|
||||
<div class="theme-changer">
|
||||
<button (click)="theme = Theme.LIGHT" matTooltip="{{'POLICY.PRIVATELABELING.LIGHT' | translate}}" class="light"
|
||||
[ngClass]="{'active': theme === Theme.LIGHT}">
|
||||
<i class="icon las la-edit"></i>
|
||||
</button>
|
||||
<button (click)="theme = Theme.DARK" matTooltip="{{'POLICY.PRIVATELABELING.DARK' | translate}}" class="dark"
|
||||
[ngClass]="{'active': theme === Theme.DARK}">
|
||||
<i class="icon las la-edit"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span class="fill-space"></span>
|
||||
|
||||
<ng-template cnslHasRole [hasRole]="['policy.delete']">
|
||||
<button class="reset-button" *ngIf="serviceType === PolicyComponentServiceType.MGMT && !isDefault"
|
||||
matTooltip="{{'POLICY.RESET' | translate}}" color="warn" (click)="removePolicy()" mat-stroked-button>
|
||||
{{'POLICY.RESET' | translate}}
|
||||
</button>
|
||||
<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>
|
||||
</ng-template>
|
||||
</p>
|
||||
|
||||
<button class="activate-button"
|
||||
[disabled]="serviceType === PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async) === false"
|
||||
mat-raised-button color="primary" (click)="activatePolicy()">
|
||||
{{'POLICY.PRIVATELABELING.ACTIVATEPREVIEW' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
<div class="privatelabeling-policy">
|
||||
<cnsl-info-section *ngIf="isDefault"> {{'POLICY.DEFAULTLABEL' | translate}}</cnsl-info-section>
|
||||
|
||||
<div *ngIf="previewData && data" class="lab-policy-content">
|
||||
<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>
|
||||
|
||||
<mat-accordion class="settings">
|
||||
<mat-expansion-panel class="expansion">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
<div class="panel-title">
|
||||
<i class="icon las la-image"></i>
|
||||
Logo
|
||||
</div>
|
||||
</mat-panel-title>
|
||||
<mat-panel-description>
|
||||
<div class="spinner-wr">
|
||||
<mat-spinner diameter="30" *ngIf="loading" color="primary"></mat-spinner>
|
||||
</div>
|
||||
|
||||
</mat-panel-description>
|
||||
</mat-expansion-panel-header>
|
||||
|
||||
<p class="description">{{'POLICY.PRIVATELABELING.USEOFLOGO' | translate}}</p>
|
||||
|
||||
<cnsl-info-section class="max-size-desc"> {{'POLICY.PRIVATELABELING.MAXSIZE' | translate}}</cnsl-info-section>
|
||||
<cnsl-info-section class="max-size-desc"> {{'POLICY.PRIVATELABELING.EMAILNOSVG' | translate}}
|
||||
</cnsl-info-section>
|
||||
|
||||
<!-- <span class="title">{{ theme === Theme.DARK ? ('POLICY.PRIVATELABELING.DARK' | translate) : ('POLICY.PRIVATELABELING.LIGHT' | translate)}}</span> -->
|
||||
<div class="logo-setup-wrapper">
|
||||
<div class="part">
|
||||
<span class="label">Logo</span>
|
||||
<!-- <mat-spinner class="spinner" color="primary" diameter="25" *ngIf="loadingImages"></mat-spinner> -->
|
||||
<container [ngSwitch]="theme">
|
||||
<div class="logo-view" *ngSwitchCase="Theme.DARK">
|
||||
<div class="img-wrapper mat-elevation-z3" *ngIf="previewData.logoUrlDark">
|
||||
<mat-icon matTooltip="{{'ACTIONS.DELETE' | translate}}" color="warn" class="dl-btn"
|
||||
(click)="deleteAsset(AssetType.LOGO, theme)">remove_circle</mat-icon>
|
||||
<img matTooltip="Preview" class="prev" [src]="previewData.logoUrlDark" alt="dark logo preview" />
|
||||
</div>
|
||||
<span class="fill-space"></span>
|
||||
<div class="img-wrapper" *ngIf="data.logoUrlDark">
|
||||
<img matTooltip="Current" class="curr" [src]="data.logoUrlDark" alt="dark logo" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="logo-view" *ngSwitchCase="Theme.LIGHT">
|
||||
<div class="img-wrapper" *ngIf="previewData.logoUrl">
|
||||
<mat-icon matTooltip="{{'ACTIONS.DELETE' | translate}}" color="warn" class="dl-btn"
|
||||
(click)="deleteAsset(AssetType.LOGO, theme)">remove_circle</mat-icon>
|
||||
<img matTooltip="Preview" class="prev" [src]="previewData.logoUrl" alt="logo preview" />
|
||||
</div>
|
||||
<span class="fill-space"></span>
|
||||
<div class="img-wrapper" *ngIf="data.logoUrl">
|
||||
<img matTooltip="Current" class="curr" [src]="data.logoUrl" alt="logo" />
|
||||
</div>
|
||||
</div>
|
||||
</container>
|
||||
<div class="dropzone" cnslDropzone (hovered)="toggleHoverLogo(theme, $event)"
|
||||
(dropped)="onDropLogo(theme, $event)" [class.hovering]="isHoveringOverDarkLogo">
|
||||
<label class="file-label">
|
||||
<i class="icon las la-image"></i>
|
||||
<span>{{isHoveringOverDarkLogo ? ('POLICY.PRIVATELABELING.RELEASE' | translate):
|
||||
('POLICY.PRIVATELABELING.DROP' | translate)}}</span>
|
||||
<input #selectedFile style="display: none;" class="file-input" type="file"
|
||||
(change)="onDropLogo(theme, $any($event.target).files)">
|
||||
<a class="btn"
|
||||
*ngIf="serviceType === PolicyComponentServiceType.ADMIN || (serviceType === PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async))"
|
||||
(click)="$event.preventDefault(); selectedFile.click();">
|
||||
{{'POLICY.PRIVATELABELING.BTN' | translate}}</a>
|
||||
</label>
|
||||
</div>
|
||||
<div class="privatelabeling-top-row">
|
||||
<mat-button-toggle-group class="buttongroup" [(ngModel)]="theme" name="theme" aria-label="Theme">
|
||||
<mat-button-toggle [value]="Theme.LIGHT">
|
||||
<div class="toggle-row">
|
||||
<i class="icon las la-sun"></i>
|
||||
<span>{{'POLICY.PRIVATELABELING.LIGHT' | translate}}</span>
|
||||
<div *ngIf="theme === Theme.LIGHT" class="current-dot"></div>
|
||||
</div>
|
||||
|
||||
<div class="part">
|
||||
<span class="label">Icon</span>
|
||||
<container [ngSwitch]="theme">
|
||||
<div class="logo-view" *ngSwitchCase="Theme.DARK">
|
||||
<div class="img-wrapper" *ngIf="previewData.iconUrlDark">
|
||||
<mat-icon matTooltip="{{'ACTIONS.DELETE' | translate}}" color="warn" class="dl-btn"
|
||||
(click)="deleteAsset(AssetType.ICON, theme)">remove_circle</mat-icon>
|
||||
<img matTooltip="Preview" class="prev" [src]="previewData.iconUrlDark" alt="dark icon preview" />
|
||||
</div>
|
||||
<span class="fill-space"></span>
|
||||
<div class="img-wrapper" *ngIf="data.iconUrlDark">
|
||||
<img matTooltip="Current" class="curr" [src]="data.iconUrlDark" alt="dark icon" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="logo-view" *ngSwitchCase="Theme.LIGHT">
|
||||
<div class="img-wrapper" *ngIf="previewData.iconUrl">
|
||||
<mat-icon matTooltip="{{'ACTIONS.DELETE' | translate}}" color="warn" class="dl-btn"
|
||||
(click)="deleteAsset(AssetType.ICON,theme)">remove_circle</mat-icon>
|
||||
<img matTooltip="Preview" class="prev" [src]="previewData.iconUrl" alt="icon preview" />
|
||||
</div>
|
||||
<span class="fill-space"></span>
|
||||
<div class="img-wrapper" *ngIf="data.iconUrl">
|
||||
<img matTooltip="Current" class="curr" [src]="data.iconUrl" alt="icon" />
|
||||
</div>
|
||||
</div>
|
||||
</container>
|
||||
<div class="dropzone" cnslDropzone (hovered)="toggleHoverIcon(theme, $event)"
|
||||
(dropped)="onDropIcon(theme, $event)" [class.hovering]="isHoveringOverDarkIcon">
|
||||
<label class="file-label">
|
||||
<i class="icon las la-image"></i>
|
||||
<span>{{isHoveringOverDarkIcon ? ('POLICY.PRIVATELABELING.RELEASE' | translate):
|
||||
('POLICY.PRIVATELABELING.DROP' | translate)}}</span>
|
||||
<input #selectedFileIcon style="display: none;" class="file-input" type="file"
|
||||
(change)="onDropIcon(theme, $any($event.target).files)">
|
||||
<a class="btn"
|
||||
*ngIf="serviceType === PolicyComponentServiceType.ADMIN || (serviceType === PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async))"
|
||||
(click)="$event.preventDefault(); selectedFileIcon.click();">
|
||||
{{'POLICY.PRIVATELABELING.BTN' | translate}}</a>
|
||||
</label>
|
||||
</div>
|
||||
</mat-button-toggle>
|
||||
<mat-button-toggle [value]=" Theme.DARK">
|
||||
<div class="toggle-row">
|
||||
<i class="icon las la-moon"></i>
|
||||
<span> {{'POLICY.PRIVATELABELING.DARK' | translate}}</span>
|
||||
<div *ngIf="theme === Theme.DARK" class="current-dot"></div>
|
||||
</div>
|
||||
</div>
|
||||
</mat-button-toggle>
|
||||
</mat-button-toggle-group>
|
||||
|
||||
</mat-expansion-panel>
|
||||
|
||||
<mat-expansion-panel class="expansion" [expanded]="true">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
<div class="panel-title">
|
||||
<i class="icon las la-palette"></i>
|
||||
{{'POLICY.PRIVATELABELING.COLORS' | translate}}
|
||||
</div>
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
|
||||
<ng-container *ngIf="theme === Theme.DARK">
|
||||
<div class="colors" *ngIf="data && previewData">
|
||||
<div class="color">
|
||||
<cnsl-color [colorType]="ColorType.BACKGROUNDDARK"
|
||||
(previewChanged)="previewData.backgroundColorDark = $event" name="Background Color"
|
||||
[color]="data.backgroundColorDark" [previewColor]="previewData.backgroundColorDark"></cnsl-color>
|
||||
</div>
|
||||
|
||||
<div class="color">
|
||||
<cnsl-color [colorType]="ColorType.PRIMARY" (previewChanged)="previewData.primaryColorDark = $event"
|
||||
name="Primary Color" [color]="data.primaryColorDark" [previewColor]="previewData.primaryColorDark">
|
||||
</cnsl-color>
|
||||
</div>
|
||||
|
||||
<div class="color">
|
||||
<cnsl-color [colorType]="ColorType.WARN" (previewChanged)="previewData.warnColorDark = $event"
|
||||
name="Warn Color" [color]="data.warnColorDark" [previewColor]="previewData.warnColorDark"></cnsl-color>
|
||||
</div>
|
||||
|
||||
<div class="color">
|
||||
<cnsl-color [colorType]="ColorType.FONTDARK" (previewChanged)="previewData.fontColorDark = $event"
|
||||
name="Font Color" [color]="data.fontColorDark" [previewColor]="previewData.fontColorDark"></cnsl-color>
|
||||
</div>
|
||||
<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>
|
||||
<div *ngIf="view === View.PREVIEW" class="current-dot"></div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="theme === Theme.LIGHT">
|
||||
<div class="colors" *ngIf="data && previewData">
|
||||
<div class="color">
|
||||
<cnsl-color [colorType]="ColorType.BACKGROUNDLIGHT"
|
||||
(previewChanged)="previewData.backgroundColor = $event" name="Background Color"
|
||||
[color]="data.backgroundColor" [previewColor]="previewData.backgroundColor"></cnsl-color>
|
||||
</div>
|
||||
|
||||
<div class="color">
|
||||
<cnsl-color [colorType]="ColorType.PRIMARY" (previewChanged)="previewData.primaryColor = $event"
|
||||
name="Primary Color" [color]="data.primaryColor" [previewColor]="previewData.primaryColor"></cnsl-color>
|
||||
</div>
|
||||
|
||||
<div class="color">
|
||||
<cnsl-color [colorType]="ColorType.WARN" name="Warn Color"
|
||||
(previewChanged)="previewData.warnColor= $event" [color]="data.warnColor"
|
||||
[previewColor]="previewData.warnColor"></cnsl-color>
|
||||
</div>
|
||||
|
||||
<div class="color">
|
||||
<cnsl-color [colorType]="ColorType.FONTLIGHT" (previewChanged)="previewData.fontColor = $event"
|
||||
name="Font Color" [color]="data.fontColor" [previewColor]="previewData.fontColor"></cnsl-color>
|
||||
</div>
|
||||
</mat-button-toggle>
|
||||
<mat-button-toggle [value]="View.CURRENT">
|
||||
<div class="toggle-row">
|
||||
<span> {{'POLICY.PRIVATELABELING.VIEWS.CURRENT' | translate}}</span>
|
||||
<div *ngIf="view === View.CURRENT" class="current-dot"></div>
|
||||
</div>
|
||||
</ng-container>
|
||||
</mat-button-toggle>
|
||||
</mat-button-toggle-group>
|
||||
|
||||
<div class="clr-btn-wrapper">
|
||||
<button color="primary" mat-raised-button (click)="savePolicy()">{{'ACTIONS.SAVE' | translate}}</button>
|
||||
</div>
|
||||
</mat-expansion-panel>
|
||||
<span class="fill-space"></span>
|
||||
|
||||
<mat-expansion-panel class="expansion">
|
||||
<mat-expansion-panel-header class="header">
|
||||
<mat-panel-title>
|
||||
<div class="panel-title">
|
||||
<i class="icon las la-font"></i>
|
||||
{{'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>
|
||||
<div class="font-preview mat-elevation-z3"
|
||||
*ngIf="preview === Preview.PREVIEW && previewData.fontUrl || preview === Preview.CURRENT && data.fontUrl">
|
||||
<mat-icon class="icon">text_fields</mat-icon>
|
||||
<span>ABC • abc • 123</span>
|
||||
|
||||
<span class="fill-space"></span>
|
||||
<button
|
||||
[disabled]="serviceType === PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async) === false"
|
||||
matTooltip="{{'ACTIONS.REMOVE' | translate}}" mat-icon-button color="warn" (click)="deleteFont()">
|
||||
<mat-icon>remove_circle</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="dropzone" cnslDropzone (hovered)="toggleHoverFont($event)" (dropped)="onDropFont($event)"
|
||||
[class.hovering]="isHoveringOverFont">
|
||||
<label class="file-label">
|
||||
<i class="icon las la-file"></i>
|
||||
<span>{{isHoveringOverFont ? ('POLICY.PRIVATELABELING.RELEASEFONT' | translate):
|
||||
('POLICY.PRIVATELABELING.DROPFONT' | translate)}}</span>
|
||||
<input #selectedFontFile style="display: none;" class="file-input" type="file"
|
||||
(change)="onDropFont($any($event.target).files)">
|
||||
<a class="btn"
|
||||
*ngIf="serviceType === PolicyComponentServiceType.ADMIN || (serviceType === PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async))"
|
||||
(click)="selectedFontFile.click()">{{'POLICY.PRIVATELABELING.BTN' | translate}}</a>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</mat-expansion-panel>
|
||||
|
||||
<mat-expansion-panel class="expansion">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
<div class="panel-title">
|
||||
<i class="icon las la-universal-access"></i>
|
||||
{{'POLICY.PRIVATELABELING.ADVANCEDBEHAVIOR' | translate}}
|
||||
</div>
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
<div class="adv-container" *ngIf="previewData">
|
||||
|
||||
<ng-container
|
||||
*ngIf="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]="serviceType === PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async) === false"
|
||||
[(ngModel)]="previewData.hideLoginNameSuffix" (change)="savePolicy()">
|
||||
{{'POLICY.DATA.HIDELOGINNAMESUFFIX' | translate}}
|
||||
</mat-slide-toggle>
|
||||
|
||||
<ng-container
|
||||
*ngIf="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]="serviceType === PolicyComponentServiceType.MGMT && (['label_policy.watermark'] | hasFeature | async) === false"
|
||||
[(ngModel)]="previewData.disableWatermark" (change)="savePolicy()">
|
||||
{{'POLICY.DATA.DISABLEWATERMARK' | translate}}
|
||||
</mat-slide-toggle>
|
||||
</div>
|
||||
</mat-expansion-panel>
|
||||
</mat-accordion>
|
||||
|
||||
<div class="preview-wrapper">
|
||||
<!-- <cnsl-preview class="prev" label="CURRENT CONFIG" [policy]="data"></cnsl-preview> -->
|
||||
<div class="col">
|
||||
<button color="primary" mat-raised-button class="preview-changer"
|
||||
(click)="preview = preview === Preview.PREVIEW ? Preview.CURRENT : Preview.PREVIEW"
|
||||
matTooltip="{{'POLICY.PRIVATELABELING.CHANGEVIEW' | translate}}"
|
||||
[ngClass]="{'active': preview === Preview.PREVIEW}">
|
||||
<span><span [ngClass]="{'strong': preview === Preview.PREVIEW}">P</span> / <span
|
||||
[ngClass]="{'strong': preview === Preview.CURRENT}">C</span></span>
|
||||
<ng-template cnslHasRole [hasRole]="['policy.delete']">
|
||||
<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}}
|
||||
</button>
|
||||
</ng-template>
|
||||
|
||||
<cnsl-preview *ngIf="preview === Preview.CURRENT" [refresh]="refreshPreview" [preview]="preview" [theme]="theme"
|
||||
class="prev" label="CURRENT" [policy]="data"></cnsl-preview>
|
||||
<cnsl-preview *ngIf="preview === Preview.PREVIEW" [refresh]="refreshPreview" [preview]="preview" [theme]="theme"
|
||||
class="prev" label="PREVIEW" [policy]="previewData"></cnsl-preview>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<cnsl-info-section *ngIf="view === View.PREVIEW" class="desc cnsl-secondary-text">
|
||||
{{'POLICY.PRIVATELABELING.PREVIEW_DESCRIPTION' | translate}}
|
||||
</cnsl-info-section>
|
||||
|
||||
<div *ngIf="previewData && data" class="lab-policy-content">
|
||||
<mat-accordion class="settings">
|
||||
<mat-expansion-panel class="expansion">
|
||||
<mat-expansion-panel-header [attr.data-e2e]="'policy-category'">
|
||||
<mat-panel-title>
|
||||
<div class="panel-title">
|
||||
<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>
|
||||
</div>
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
|
||||
<div>
|
||||
<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>
|
||||
<cnsl-info-section *ngIf="view !== View.CURRENT" class="max-size-desc">
|
||||
{{'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">
|
||||
<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}}">
|
||||
<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();">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
</ng-template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="logo-view" [attr.data-e2e]="'image-part-icon'">
|
||||
<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">
|
||||
<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}}">
|
||||
<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();">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
</ng-template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</mat-expansion-panel>
|
||||
|
||||
<mat-expansion-panel class="expansion" [expanded]="true">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
<div class="panel-title">
|
||||
<i class="icon las la-palette"></i>
|
||||
<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>
|
||||
</div>
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
</mat-expansion-panel>
|
||||
|
||||
<mat-expansion-panel class="expansion">
|
||||
<mat-expansion-panel-header class="header" [attr.data-e2e]="'policy-category'">
|
||||
<mat-panel-title>
|
||||
<div class="panel-title">
|
||||
<i class="icon las la-font"></i>
|
||||
{{'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>
|
||||
<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}}">
|
||||
<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}}">
|
||||
<mat-icon>add</mat-icon>
|
||||
</a>
|
||||
</div>
|
||||
</ng-template>
|
||||
</div>
|
||||
</mat-expansion-panel>
|
||||
|
||||
<mat-expansion-panel class="expansion">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
<div class="panel-title">
|
||||
<i class="icon las la-universal-access"></i>
|
||||
{{'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)"
|
||||
[(ngModel)]="view === View.CURRENT ? data.hideLoginNameSuffix : previewData.hideLoginNameSuffix"
|
||||
(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)"
|
||||
[(ngModel)]="view === View.CURRENT ? data.disableWatermark : previewData.disableWatermark"
|
||||
(change)="savePolicy()">
|
||||
{{'POLICY.DATA.DISABLEWATERMARK' | translate}}
|
||||
</mat-slide-toggle>
|
||||
</div>
|
||||
</mat-expansion-panel>
|
||||
</mat-accordion>
|
||||
|
||||
<div class="vertical-divider"></div>
|
||||
|
||||
<div class="preview-wrapper">
|
||||
<div class="col">
|
||||
<cnsl-preview [refresh]="refreshPreview" [theme]="theme" class="preview"
|
||||
[policy]="view === View.PREVIEW ? previewData : data">
|
||||
</cnsl-preview>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<cnsl-policy-grid class="grid" [currentPolicy]="currentPolicy" [type]="serviceType" tagForFilter="text">
|
||||
</cnsl-policy-grid>
|
||||
</div>
|
||||
<cnsl-policy-grid class="grid" [currentPolicy]="currentPolicy" [type]="serviceType" tagForFilter="text">
|
||||
</cnsl-policy-grid>
|
||||
</div>
|
||||
</cnsl-detail-layout>
|
||||
Reference in New Issue
Block a user