mirror of
https://github.com/zitadel/zitadel.git
synced 2025-07-10 17:18:33 +00:00

* header check * eslint, header link * labelpolicy promise * set isdefault of branding to false on add * icon * branding toggles
252 lines
8.8 KiB
HTML
252 lines
8.8 KiB
HTML
<mat-toolbar class="header-wrapper">
|
|
<div class="header-content">
|
|
<a
|
|
class="title custom"
|
|
[routerLink]="['/']"
|
|
*ngIf="org && labelpolicy && labelpolicy.disableWatermark; else defaultHome"
|
|
>
|
|
<img
|
|
class="logo"
|
|
alt="home logo"
|
|
*ngIf="isDarkTheme; else customlighttheme"
|
|
[src]="labelpolicy.iconUrlDark ? labelpolicy.iconUrlDark : './assets/images/zitadel-logo-solo-light.svg'"
|
|
(error)="errorHandler($event, './assets/images/zitadel-logo-solo-light.svg')"
|
|
/>
|
|
<ng-template #customlighttheme>
|
|
<img
|
|
alt="home logo"
|
|
class="logo"
|
|
[src]="labelpolicy.iconUrl ? labelpolicy.iconUrl : './assets/images/zitadel-logo-solo-dark.svg'"
|
|
(error)="errorHandler($event, './assets/images/zitadel-logo-solo-dark.svg')"
|
|
/>
|
|
</ng-template>
|
|
</a>
|
|
|
|
<ng-template #defaultHome>
|
|
<a class="title" [routerLink]="authService.zitadelPermissions.getValue().length === 0 ? ['/users', 'me'] : ['/']">
|
|
<img
|
|
class="logo"
|
|
alt="zitadel logo"
|
|
*ngIf="isDarkTheme; else lighttheme"
|
|
src="./assets/images/zitadel-logo-solo-light.svg"
|
|
/>
|
|
<ng-template #lighttheme>
|
|
<img alt="zitadel logo" class="logo" src="./assets/images/zitadel-logo-solo-dark.svg" />
|
|
</ng-template>
|
|
</a>
|
|
</ng-template>
|
|
|
|
<ng-container *ngFor="let bread of breadcrumbService.breadcrumbs$ | async as bc; index as i">
|
|
<ng-container *ngIf="bread.type === BreadcrumbType.INSTANCE">
|
|
<ng-template cnslHasRole [hasRole]="['iam.read']">
|
|
<svg
|
|
class="slash hide-on-small"
|
|
viewBox="0 0 24 24"
|
|
width="32"
|
|
height="32"
|
|
stroke="currentColor"
|
|
stroke-width="1"
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
shape-rendering="geometricPrecision"
|
|
>
|
|
<path d="M16.88 3.549L7.12 20.451"></path>
|
|
</svg>
|
|
|
|
<div class="breadcrumb-context hide-on-small">
|
|
<a matRipple [matRippleUnbounded]="false" class="breadcrumb-link" [routerLink]="bread.routerLink">
|
|
{{ 'MENU.INSTANCE' | translate }}
|
|
</a>
|
|
</div>
|
|
</ng-template>
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="bread.type === BreadcrumbType.ORG">
|
|
<svg
|
|
class="slash"
|
|
viewBox="0 0 24 24"
|
|
width="32"
|
|
height="32"
|
|
stroke="currentColor"
|
|
stroke-width="1"
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
shape-rendering="geometricPrecision"
|
|
>
|
|
<path d="M16.88 3.549L7.12 20.451"></path>
|
|
</svg>
|
|
|
|
<div class="org-context">
|
|
<a *ngIf="org" matRipple [matRippleUnbounded]="false" class="org-link" id="orglink" [routerLink]="['/org']">
|
|
{{ org.name ? org.name : 'NO NAME' }}</a
|
|
>
|
|
|
|
<div class="org-context-wrapper" *ngIf="org">
|
|
<button
|
|
cdkOverlayOrigin
|
|
#trigger="cdkOverlayOrigin"
|
|
matRipple
|
|
[matRippleUnbounded]="false"
|
|
id="orgswitchbutton"
|
|
class="org-switch-button"
|
|
(click)="showOrgContext = !showOrgContext"
|
|
>
|
|
<span class="svgspan">
|
|
<svg xmlns=" http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
<path
|
|
fill-rule="evenodd"
|
|
d="M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z"
|
|
clip-rule="evenodd"
|
|
></path>
|
|
</svg>
|
|
</span>
|
|
<cnsl-action-keys
|
|
(actionTriggered)="showOrgContext = !showOrgContext"
|
|
[type]="ActionKeysType.ORGSWITCHER"
|
|
></cnsl-action-keys>
|
|
</button>
|
|
|
|
<ng-template
|
|
cdkConnectedOverlay
|
|
[cdkConnectedOverlayOrigin]="trigger"
|
|
[flexibleDimensions]="true"
|
|
[lockPosition]="true"
|
|
[cdkConnectedOverlayOffsetY]="10"
|
|
[cdkConnectedOverlayHasBackdrop]="true"
|
|
[cdkConnectedOverlayPositions]="positions"
|
|
cdkConnectedOverlayBackdropClass="transparent-backdrop"
|
|
[cdkConnectedOverlayOpen]="showOrgContext"
|
|
(backdropClick)="showOrgContext = false"
|
|
(detach)="showOrgContext = false"
|
|
>
|
|
<cnsl-org-context
|
|
class="context_card"
|
|
*ngIf="org && showOrgContext"
|
|
(closedCard)="showOrgContext = false"
|
|
[org]="org"
|
|
(setOrg)="setActiveOrg($event)"
|
|
>
|
|
</cnsl-org-context>
|
|
</ng-template>
|
|
</div>
|
|
</div>
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="bread.type !== BreadcrumbType.INSTANCE && bread.type !== BreadcrumbType.ORG">
|
|
<svg
|
|
class="slash"
|
|
viewBox="0 0 24 24"
|
|
width="32"
|
|
height="32"
|
|
stroke="currentColor"
|
|
stroke-width="1"
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
shape-rendering="geometricPrecision"
|
|
>
|
|
<path d="M16.88 3.549L7.12 20.451"></path>
|
|
</svg>
|
|
|
|
<div class="breadcrumb-context">
|
|
<a
|
|
matRipple
|
|
[matRippleUnbounded]="false"
|
|
class="breadcrumb-link"
|
|
[ngClass]="{ maxwidth: bc.length > 1 }"
|
|
[routerLink]="bread.routerLink"
|
|
>
|
|
<ng-container *ngIf="i !== bc.length - 1; else defLabel">
|
|
<span class="desk">{{ bread.name }}</span>
|
|
<span class="mob">...</span>
|
|
</ng-container>
|
|
<ng-template #defLabel>
|
|
<span>{{ bread.name }}</span>
|
|
</ng-template>
|
|
</a>
|
|
</div>
|
|
</ng-container>
|
|
</ng-container>
|
|
|
|
<span class="fill-space"></span>
|
|
|
|
<a class="doc-link" href="https://docs.zitadel.com" mat-stroked-button target="_blank">
|
|
{{ 'MENU.DOCUMENTATION' | translate }}
|
|
</a>
|
|
|
|
<div class="system-rel" *ngIf="!isOnMe">
|
|
<a
|
|
id="systembutton"
|
|
*ngIf="!isOnInstance && (['iam.read$', 'iam.write$'] | hasRole | async)"
|
|
[routerLink]="['/instance']"
|
|
class="iam-settings cnsl-action-button"
|
|
mat-stroked-button
|
|
>
|
|
<span class="iam-label">{{ 'MENU.INSTANCE' | translate }}</span>
|
|
<i class="las la-cog"></i>
|
|
</a>
|
|
<a
|
|
id="orgbutton"
|
|
*ngIf="isOnInstance && (['org.read'] | hasRole | async)"
|
|
[routerLink]="['/org']"
|
|
class="org-settings cnsl-action-button"
|
|
mat-stroked-button
|
|
>
|
|
<span class="iam-label">{{ 'MENU.ORGANIZATION' | translate }}</span>
|
|
<i class="las la-cog"></i>
|
|
</a>
|
|
</div>
|
|
|
|
<ng-container
|
|
*ngIf="user && (user.human?.profile?.displayName || (user.human?.profile?.firstName && user.human?.profile?.lastName))"
|
|
>
|
|
<div class="account-card-wrapper">
|
|
<button
|
|
cdkOverlayOrigin
|
|
#accounttrigger="cdkOverlayOrigin"
|
|
class="icon-container"
|
|
(click)="showAccount = !showAccount"
|
|
[ngClass]="{ 'iam-user': (['iam.write$'] | hasRole | async) }"
|
|
>
|
|
<cnsl-avatar
|
|
id="avatartoggle"
|
|
class="avatar-toggle dontcloseonclick"
|
|
[active]="showAccount"
|
|
[avatarUrl]="user.human?.profile?.avatarUrl || ''"
|
|
[forColor]="user.preferredLoginName || ''"
|
|
[name]="
|
|
user.human?.profile?.displayName
|
|
? user.human?.profile?.displayName ?? ''
|
|
: user.human?.profile?.firstName + ' ' + user.human?.profile?.lastName
|
|
"
|
|
[size]="38"
|
|
>
|
|
</cnsl-avatar>
|
|
</button>
|
|
</div>
|
|
<ng-template
|
|
cdkConnectedOverlay
|
|
[cdkConnectedOverlayOrigin]="accounttrigger"
|
|
[flexibleDimensions]="true"
|
|
[lockPosition]="true"
|
|
[cdkConnectedOverlayOffsetY]="10"
|
|
[cdkConnectedOverlayHasBackdrop]="true"
|
|
[cdkConnectedOverlayPositions]="accountCardPositions"
|
|
cdkConnectedOverlayBackdropClass="transparent-backdrop"
|
|
[cdkConnectedOverlayOpen]="showAccount"
|
|
(backdropClick)="showAccount = false"
|
|
(detach)="showAccount = false"
|
|
>
|
|
<cnsl-accounts-card
|
|
@accounts
|
|
class="a_card"
|
|
*ngIf="showAccount"
|
|
(closedCard)="showAccount = false"
|
|
[user]="user"
|
|
[iamuser]="['iam.write$'] | hasRole | async"
|
|
>
|
|
</cnsl-accounts-card>
|
|
</ng-template>
|
|
</ng-container>
|
|
</div>
|
|
</mat-toolbar>
|