add build, deploy and e2e-setup

This commit is contained in:
Elio Bischof
2022-07-08 15:54:06 +02:00
138 changed files with 15236 additions and 5395 deletions

View File

@@ -22,9 +22,17 @@
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": ["src/favicon.ico", "src/assets", "src/manifest.webmanifest"],
"styles": ["src/styles.scss"],
"scripts": ["./node_modules/tinycolor2/dist/tinycolor-min.js"],
"assets": [
"src/favicon.ico",
"src/assets",
"src/manifest.webmanifest"
],
"styles": [
"src/styles.scss"
],
"scripts": [
"./node_modules/tinycolor2/dist/tinycolor-min.js"
],
"allowedCommonJsDependencies": [
"@angular/common/locales/de",
"codemirror/mode/javascript/javascript",
@@ -122,15 +130,27 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": ["src/favicon.ico", "src/assets", "src/manifest.webmanifest"],
"styles": ["./node_modules/@angular/material/prebuilt-themes/pink-bluegrey.css", "src/styles.scss"],
"scripts": ["./node_modules/tinycolor2/dist/tinycolor-min.js"]
"assets": [
"src/favicon.ico",
"src/assets",
"src/manifest.webmanifest"
],
"styles": [
"./node_modules/@angular/material/prebuilt-themes/pink-bluegrey.css",
"src/styles.scss"
],
"scripts": [
"./node_modules/tinycolor2/dist/tinycolor-min.js"
]
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
},
"e2e": {

View File

@@ -17,5 +17,5 @@ fi
$NPX cypress $ACTION \
--port ${E2E_CYPRESS_PORT} \
--env org="${E2E_ORG}",org_owner_password="${E2E_ORG_OWNER_PW}",org_owner_viewer_password="${E2E_ORG_OWNER_VIEWER_PW}",org_project_creator_password="${E2E_ORG_PROJECT_CREATOR_PW}",login_policy_user_password="${E2E_LOGIN_POLICY_USER_PW}",password_complexity_user_password="${E2E_PASSWORD_COMPLEXITY_USER_PW}",consoleUrl=${E2E_CONSOLE_URL},apiUrl="${E2E_API_URL}",accountsUrl="${E2E_ACCOUNTS_URL}",issuerUrl="${E2E_ISSUER_URL}",serviceAccountKey="${E2E_SERVICEACCOUNT_KEY}",serviceAccountKeyPath="${E2E_SERVICEACCOUNT_KEY_PATH}",otherZitadelIdpInstance="${E2E_OTHER_ZITADEL_IDP_INSTANCE}",zitadelProjectResourceId="${E2E_ZITADEL_PROJECT_RESOURCE_ID}" \
--env org="${ZITADEL_E2E_ORG}",org_owner_password="${ZITADEL_E2E_ORGOWNERPW}",org_owner_viewer_password="${ZITADEL_E2E_ORGOWNERVIEWERPW}",org_project_creator_password="${ZITADEL_E2E_ORGPROJECTCREATORPW}",login_policy_user_password="${ZITADEL_E2E_LOGINPOLICYUSERPW}",password_complexity_user_password="${ZITADEL_E2E_PASSWORDCOMPLEXITYUSERPW}",consoleUrl="${ZITADEL_E2E_CONSOLEURL}",apiUrl="${ZITADEL_E2E_APIURL}",accountsUrl="${ZITADEL_E2E_ACCOUNTSURL}",issuerUrl="${ZITADEL_E2E_ISSUERURL}",serviceAccountKeyPath="${ZITADEL_E2E_MACHINEKEYPATH}",otherZitadelIdpInstance="${ZITADEL_E2E_OTHERZITADELIDPINSTANCE}",zitadelProjectResourceId="${ZITADEL_E2E_ZITADELPROJECTRESOURCEID}" \
"$@"

View File

@@ -1,14 +0,0 @@
E2E_CYPRESS_PORT=5003
E2E_ORG=e2e-tests
E2E_ORG_OWNER_PW=Password1!
E2E_ORG_OWNER_VIEWER_PW=Password1!
E2E_ORG_PROJECT_CREATOR_PW=Password1!
E2E_PASSWORD_COMPLEXITY_USER_PW=Password1!
E2E_LOGIN_POLICY_USER_PW=Password1!
E2E_SERVICEACCOUNT_KEY_PATH="${projectRoot}/.keys/e2e.json"
E2E_CONSOLE_URL="http://localhost:4200/ui/console"
E2E_API_URL="http://localhost:50002"
E2E_ACCOUNTS_URL="http://localhost:50003"
E2E_ISSUER_URL="http://localhost:50002/oauth/v2"
E2E_OTHER_ZITADEL_IDP_INSTANCE=false
E2E_ZITADEL_PROJECT_RESOURCE_ID="bignumber-$(echo -n $(docker compose -f ${projectRoot}/build/local/docker-compose-local.yml exec --no-TTY db cockroach sql --insecure --execute "select aggregate_id from eventstore.events where event_type = 'project.added' and event_data = '{\"name\": \"Zitadel\"}';" --format tsv) | cut -d " " -f 2)"

11242
console/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -12,18 +12,18 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^14.0.1",
"@angular/cdk": "^14.0.1",
"@angular/common": "^14.0.1",
"@angular/compiler": "^14.0.1",
"@angular/core": "^14.0.1",
"@angular/forms": "^14.0.1",
"@angular/material": "^14.0.1",
"@angular/material-moment-adapter": "^14.0.1",
"@angular/platform-browser": "^14.0.1",
"@angular/platform-browser-dynamic": "^14.0.1",
"@angular/router": "^14.0.1",
"@angular/service-worker": "^14.0.1",
"@angular/animations": "^14.0.4",
"@angular/cdk": "^14.0.4",
"@angular/common": "^14.0.4",
"@angular/compiler": "^14.0.4",
"@angular/core": "^14.0.4",
"@angular/forms": "^14.0.4",
"@angular/material": "^14.0.4",
"@angular/material-moment-adapter": "^14.0.4",
"@angular/platform-browser": "^14.0.4",
"@angular/platform-browser-dynamic": "^14.0.4",
"@angular/router": "^14.0.4",
"@angular/service-worker": "^14.0.4",
"@ctrl/ngx-codemirror": "^5.1.1",
"@grpc/grpc-js": "^1.5.7",
"@ngx-translate/core": "^14.0.0",
@@ -36,7 +36,7 @@
"codemirror": "^5.65.0",
"cors": "^2.8.5",
"file-saver": "^2.0.5",
"google-proto-files": "^2.5.0",
"google-proto-files": "^3.0.0",
"google-protobuf": "^3.19.4",
"grpc-web": "^1.3.0",
"libphonenumber-js": "^1.10.6",
@@ -52,32 +52,32 @@
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^14.0.1",
"@angular-eslint/builder": "^14.0.0-alpha.3",
"@angular-eslint/eslint-plugin": "^14.0.0-alpha.3",
"@angular-eslint/eslint-plugin-template": "^14.0.0-alpha.3",
"@angular-eslint/schematics": "^14.0.0-alpha.3",
"@angular-eslint/template-parser": "^14.0.0-alpha.3",
"@angular/cli": "^14.0.1",
"@angular/compiler-cli": "^14.0.1",
"@angular/language-service": "^14.0.1",
"@angular-devkit/build-angular": "^14.0.4",
"@angular-eslint/builder": "^14.0.0",
"@angular-eslint/eslint-plugin": "^14.0.0",
"@angular-eslint/eslint-plugin-template": "^14.0.0",
"@angular-eslint/schematics": "^14.0.0",
"@angular-eslint/template-parser": "^14.0.0",
"@angular/cli": "^14.0.4",
"@angular/compiler-cli": "^14.0.4",
"@angular/language-service": "^14.0.4",
"@types/jasmine": "~4.0.3",
"@types/jasminewd2": "~2.0.10",
"@types/jsonwebtoken": "^8.5.5",
"@types/node": "^17.0.42",
"@typescript-eslint/eslint-plugin": "5.25.0",
"@typescript-eslint/parser": "5.27.0",
"@typescript-eslint/eslint-plugin": "5.30.4",
"@typescript-eslint/parser": "5.30.4",
"codelyzer": "^6.0.0",
"cypress": "^10.1.0",
"cypress-terminal-report": "^4.0.1",
"eslint": "^8.17.0",
"jasmine-core": "~4.1.1",
"eslint": "^8.18.0",
"jasmine-core": "~4.2.0",
"jasmine-spec-reporter": "~7.0.0",
"jsonwebtoken": "^8.5.1",
"karma": "~6.3.16",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~5.0.1",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "^2.0.0",
"mochawesome": "^7.1.2",
"prettier": "^2.4.1",

View File

@@ -13,6 +13,10 @@ const routes: Routes = [
loadChildren: () => import('./pages/home/home.module').then((m) => m.HomeModule),
canActivate: [AuthGuard],
},
{
path: 'signedout',
loadChildren: () => import('./pages/signedout/signedout.module').then((m) => m.SignedoutModule),
},
{
path: 'orgs',
loadChildren: () => import('./pages/org-list/org-list.module').then((m) => m.OrgListModule),
@@ -38,12 +42,7 @@ const routes: Routes = [
{
path: 'users',
canActivate: [AuthGuard],
children: [
{
path: '',
loadChildren: () => import('src/app/pages/users/users.module').then((m) => m.UsersModule),
},
],
loadChildren: () => import('src/app/pages/users/users.module').then((m) => m.UsersModule),
},
{
path: 'instance',
@@ -170,10 +169,6 @@ const routes: Routes = [
roles: ['policy.read'],
},
},
{
path: 'signedout',
loadChildren: () => import('./pages/signedout/signedout.module').then((m) => m.SignedoutModule),
},
{
path: '**',
redirectTo: '/',

View File

@@ -1,32 +1,31 @@
<ng-container *ngIf="(authService.user | async) || undefined as user">
<ng-container *ngIf="['iam.read$', 'iam.write$'] | hasRole as iamuser$">
<div class="main-container">
<cnsl-header
*ngIf="user"
[org]="org"
[user]="user"
[isDarkTheme]="componentCssClass === 'dark-theme'"
[labelpolicy]="labelpolicy"
(changedActiveOrg)="changedOrg($event)"
></cnsl-header>
<div class="main-container">
<ng-container *ngIf="(authService.user | async) || {} as user">
<cnsl-header
*ngIf="user && user !== {}"
[org]="org"
[user]="$any(user)"
[isDarkTheme]="componentCssClass === 'dark-theme'"
[labelpolicy]="labelpolicy"
(changedActiveOrg)="changedOrg($event)"
></cnsl-header>
<cnsl-nav
id="mainnav"
class="nav"
[ngClass]="{ shadow: yoffset > 60 }"
*ngIf="user"
[org]="org"
[user]="user"
[isDarkTheme]="componentCssClass === 'dark-theme'"
[labelpolicy]="labelpolicy"
></cnsl-nav>
<div class="router-container" [@routeAnimations]="prepareRoute(outlet)">
<div class="outlet">
<router-outlet class="outlet" #outlet="outlet"></router-outlet>
</div>
</div>
<span class="fill-space"></span>
<cnsl-footer [privateLabelPolicy]="labelpolicy"></cnsl-footer>
</div>
<cnsl-nav
id="mainnav"
class="nav"
[ngClass]="{ shadow: yoffset > 60 }"
*ngIf="user && user !== {}"
[org]="org"
[user]="$any(user)"
[isDarkTheme]="componentCssClass === 'dark-theme'"
[labelpolicy]="labelpolicy"
></cnsl-nav>
</ng-container>
</ng-container>
<div class="router-container" [@routeAnimations]="prepareRoute(outlet)">
<div class="outlet">
<router-outlet class="outlet" #outlet="outlet"></router-outlet>
</div>
</div>
<span class="fill-space"></span>
<cnsl-footer [privateLabelPolicy]="labelpolicy"></cnsl-footer>
</div>

View File

@@ -69,6 +69,7 @@ export class AppComponent implements OnDestroy {
private activatedRoute: ActivatedRoute,
@Inject(DOCUMENT) private document: Document,
) {
this.themeService.loadPrivateLabelling(true);
console.log(
'%cWait!',
'text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; color: #5469D4; font-size: 50px',

View File

@@ -26,7 +26,6 @@ import { HeaderModule } from './modules/header/header.module';
import { KeyboardShortcutsModule } from './modules/keyboard-shortcuts/keyboard-shortcuts.module';
import { NavModule } from './modules/nav/nav.module';
import { WarnDialogModule } from './modules/warn-dialog/warn-dialog.module';
import { SignedoutComponent } from './pages/signedout/signedout.component';
import { HasRolePipeModule } from './pipes/has-role-pipe/has-role-pipe.module';
import { AdminService } from './services/admin.service';
import { AuthenticationService } from './services/authentication.service';
@@ -79,7 +78,7 @@ const authConfig: AuthConfig = {
};
@NgModule({
declarations: [AppComponent, SignedoutComponent],
declarations: [AppComponent],
imports: [
AppRoutingModule,
CommonModule,

View File

@@ -4,13 +4,12 @@ import { AuthConfig } from 'angular-oauth2-oidc';
import { Observable } from 'rxjs';
import { AuthenticationService } from '../services/authentication.service';
import { GrpcAuthService } from '../services/grpc-auth.service';
@Injectable({
providedIn: 'root',
})
export class AuthGuard implements CanActivate {
constructor(private auth: AuthenticationService, private authService: GrpcAuthService) {}
constructor(private auth: AuthenticationService) {}
public canActivate(
route: ActivatedRouteSnapshot,

View File

@@ -196,55 +196,56 @@
</a>
</div>
<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"
*ngIf="
user && (user.human?.profile?.displayName || (user.human?.profile?.firstName && user.human?.profile?.lastName))
"
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"
<ng-container
*ngIf="user && (user.human?.profile?.displayName || (user.human?.profile?.firstName && user.human?.profile?.lastName))"
>
<cnsl-accounts-card
@accounts
class="a_card"
*ngIf="showAccount"
(closedCard)="showAccount = false"
[user]="user"
[iamuser]="['iam.write$'] | hasRole | async"
<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>
</ng-template>
<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>

View File

@@ -5,7 +5,25 @@
[isInactive]="org?.state === OrgState.ORG_STATE_INACTIVE"
[hasContributors]="true"
stateTooltip="{{ 'ORG.STATE.' + org?.state | translate }}"
[hasActions]="['org.write:' + org?.id, 'org.write$'] | hasRole | async"
>
<ng-template topActions cnslHasRole [hasRole]="['org.write:' + org?.id, 'org.write$']">
<button
mat-menu-item
*ngIf="org?.state === OrgState.ORG_STATE_ACTIVE"
(click)="changeState(OrgState.ORG_STATE_INACTIVE)"
>
{{ 'ORG.PAGES.DEACTIVATE' | translate }}
</button>
<button
mat-menu-item
*ngIf="org?.state === OrgState.ORG_STATE_INACTIVE"
(click)="changeState(OrgState.ORG_STATE_ACTIVE)"
>
{{ 'ORG.PAGES.REACTIVATE' | translate }}
</button>
</ng-template>
<cnsl-contributors
topContributors
[totalResult]="totalMemberResult"

View File

@@ -7,6 +7,7 @@ import { CreationType, MemberCreateDialogComponent } from 'src/app/modules/add-m
import { ChangeType } from 'src/app/modules/changes/changes.component';
import { InfoSectionType } from 'src/app/modules/info-section/info-section.component';
import { PolicyComponentServiceType } from 'src/app/modules/policies/policy-component-types.enum';
import { WarnDialogComponent } from 'src/app/modules/warn-dialog/warn-dialog.component';
import { Member } from 'src/app/proto/generated/zitadel/member_pb';
import { Org, OrgState } from 'src/app/proto/generated/zitadel/org_pb';
import { User } from 'src/app/proto/generated/zitadel/user_pb';
@@ -62,6 +63,56 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
this.destroy$.complete();
}
public changeState(newState: OrgState): void {
if (newState === OrgState.ORG_STATE_ACTIVE) {
const dialogRef = this.dialog.open(WarnDialogComponent, {
data: {
confirmKey: 'ACTIONS.REACTIVATE',
cancelKey: 'ACTIONS.CANCEL',
titleKey: 'ORG.DIALOG.REACTIVATE.TITLE',
descriptionKey: 'ORG.DIALOG.REACTIVATE.DESCRIPTION',
},
width: '400px',
});
dialogRef.afterClosed().subscribe((resp) => {
if (resp) {
this.mgmtService
.reactivateOrg()
.then(() => {
this.toast.showInfo('ORG.TOAST.REACTIVATED', true);
this.org.state = OrgState.ORG_STATE_ACTIVE;
})
.catch((error) => {
this.toast.showError(error);
});
}
});
} else if (newState === OrgState.ORG_STATE_INACTIVE) {
const dialogRef = this.dialog.open(WarnDialogComponent, {
data: {
confirmKey: 'ACTIONS.DEACTIVATE',
cancelKey: 'ACTIONS.CANCEL',
titleKey: 'ORG.DIALOG.DEACTIVATE.TITLE',
descriptionKey: 'ORG.DIALOG.DEACTIVATE.DESCRIPTION',
},
width: '400px',
});
dialogRef.afterClosed().subscribe((resp) => {
if (resp) {
this.mgmtService
.deactivateOrg()
.then(() => {
this.toast.showInfo('ORG.TOAST.DEACTIVATED', true);
this.org.state = OrgState.ORG_STATE_INACTIVE;
})
.catch((error) => {
this.toast.showError(error);
});
}
});
}
}
private async getData(): Promise<void> {
this.mgmtService
.getMyOrg()

View File

@@ -4,14 +4,14 @@ import { RouterModule, Routes } from '@angular/router';
import { SignedoutComponent } from './signedout.component';
const routes: Routes = [
{
path: '',
component: SignedoutComponent,
},
{
path: '',
component: SignedoutComponent,
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class SignedoutRoutingModule { }
export class SignedoutRoutingModule {}

View File

@@ -5,11 +5,18 @@
<ng-template #lighttheme>
<img alt="zitadel logo" src="../../../assets/images/zitadel-logo-dark.svg" />
</ng-template>
<p class="cnsl-secondary-text">{{'USER.SIGNEDOUT' | translate}}</p>
<p class="cnsl-secondary-text">{{ 'USER.SIGNEDOUT' | translate }}</p>
<button matTooltip="{{'ACTIONS.LOGIN' | translate}}" color="primary" mat-raised-button
[routerLink]="[ '/users/me' ]">{{'USER.SIGNEDOUT_BTN' |
translate}} <i class="las la-sign-in-alt"></i></button>
<button
class="cnsl-action-button"
matTooltip="{{ 'ACTIONS.LOGIN' | translate }}"
color="primary"
mat-raised-button
[routerLink]="['/users/me']"
>
<i class="las la-sign-in-alt"></i>
<span>{{ 'USER.SIGNEDOUT_BTN' | translate }}</span>
</button>
</div>
</div>
</div>
</div>

View File

@@ -9,6 +9,7 @@
display: flex;
flex-direction: column;
align-items: center;
margin-top: 50px;
h1 {
font-size: 3rem;
@@ -24,16 +25,6 @@
img {
height: 100px;
max-width: 170px;
margin-bottom: 2rem;
}
button {
display: block;
padding: 0.5rem 4rem;
i {
margin-left: 0.5rem;
}
}
}
}

View File

@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { ThemeService } from 'src/app/services/theme.service';
@Component({
selector: 'cnsl-signedout',
@@ -8,7 +9,9 @@ import { Component } from '@angular/core';
export class SignedoutComponent {
public dark: boolean = true;
constructor() {
constructor(themeService: ThemeService) {
themeService.loadPrivateLabelling();
const theme = localStorage.getItem('theme');
this.dark = theme === 'dark-theme' ? true : theme === 'light-theme' ? false : true;
}

View File

@@ -1,15 +1,15 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatTooltipModule } from '@angular/material/tooltip';
import { TranslateModule } from '@ngx-translate/core';
import { SharedModule } from 'src/app/modules/shared/shared.module';
import { SignedoutRoutingModule } from './signedout-routing.module';
import { SignedoutComponent } from './signedout.component';
@NgModule({
declarations: [],
imports: [
CommonModule,
SignedoutRoutingModule,
SharedModule,
],
declarations: [SignedoutComponent],
imports: [CommonModule, SignedoutRoutingModule, MatButtonModule, MatTooltipModule, TranslateModule, SharedModule],
})
export class SignedoutModule { }
export class SignedoutModule {}

View File

@@ -49,10 +49,10 @@ export class StatehandlerServiceImpl implements StatehandlerService, OnDestroy {
switchMap((url: string) => {
if (url.includes('?login_hint=')) {
const newUrl = this.removeParam('login_hint', url);
const urlWithoutBasePath = newUrl.startsWith('/ui/console') ? newUrl.replace('/ui/console', '') : newUrl;
const urlWithoutBasePath = newUrl.includes('/ui/console') ? newUrl.replace('/ui/console', '') : newUrl;
return of(this.processor.createState(urlWithoutBasePath));
} else if (url) {
const urlWithoutBasePath = url.startsWith('/ui/console') ? url.replace('/ui/console', '') : url;
const urlWithoutBasePath = url.includes('/ui/console') ? url.replace('/ui/console', '') : url;
return of(this.processor.createState(urlWithoutBasePath));
} else {
return of(undefined);

View File

@@ -140,70 +140,72 @@ export class ThemeService {
this.saveTextColor(lightText, false);
};
public loadPrivateLabelling(): void {
this.setDefaultColors();
public loadPrivateLabelling(forceDefault: boolean = false): void {
if (forceDefault) {
this.setDefaultColors();
} else {
const isDark = (color: string) => this.isDark(color);
const isLight = (color: string) => this.isLight(color);
const isDark = (color: string) => this.isDark(color);
const isLight = (color: string) => this.isLight(color);
this.authService
.getMyLabelPolicy()
.then((lpresp) => {
const labelpolicy = lpresp.policy;
this.authService
.getMyLabelPolicy()
.then((lpresp) => {
const labelpolicy = lpresp.policy;
const darkPrimary = labelpolicy?.primaryColorDark || '#bbbafa';
const lightPrimary = labelpolicy?.primaryColor || '#5469d4';
const darkPrimary = labelpolicy?.primaryColorDark || '#bbbafa';
const lightPrimary = labelpolicy?.primaryColor || '#5469d4';
const darkWarn = labelpolicy?.warnColorDark || '#ff3b5b';
const lightWarn = labelpolicy?.warnColor || '#cd3d56';
const darkWarn = labelpolicy?.warnColorDark || '#ff3b5b';
const lightWarn = labelpolicy?.warnColor || '#cd3d56';
let darkBackground = labelpolicy?.backgroundColorDark;
let lightBackground = labelpolicy?.backgroundColor;
let darkBackground = labelpolicy?.backgroundColorDark;
let lightBackground = labelpolicy?.backgroundColor;
let darkText = labelpolicy?.fontColorDark ?? '#ffffff';
let lightText = labelpolicy?.fontColor ?? '#000000';
let darkText = labelpolicy?.fontColorDark ?? '#ffffff';
let lightText = labelpolicy?.fontColor ?? '#000000';
this.savePrimaryColor(darkPrimary, true);
this.savePrimaryColor(lightPrimary, false);
this.savePrimaryColor(darkPrimary, true);
this.savePrimaryColor(lightPrimary, false);
this.saveWarnColor(darkWarn, true);
this.saveWarnColor(lightWarn, false);
this.saveWarnColor(darkWarn, true);
this.saveWarnColor(lightWarn, false);
if (darkBackground && !isDark(darkBackground)) {
console.info(
`Background (${darkBackground}) is not dark enough for a dark theme. Falling back to zitadel background`,
);
darkBackground = '#111827';
}
this.saveBackgroundColor(darkBackground || '#111827', true);
if (darkBackground && !isDark(darkBackground)) {
console.info(
`Background (${darkBackground}) is not dark enough for a dark theme. Falling back to zitadel background`,
);
darkBackground = '#111827';
}
this.saveBackgroundColor(darkBackground || '#111827', true);
if (lightBackground && !isLight(lightBackground)) {
console.info(
`Background (${lightBackground}) is not light enough for a light theme. Falling back to zitadel background`,
);
lightBackground = '#fafafa';
}
this.saveBackgroundColor(lightBackground || '#fafafa', false);
if (lightBackground && !isLight(lightBackground)) {
console.info(
`Background (${lightBackground}) is not light enough for a light theme. Falling back to zitadel background`,
);
lightBackground = '#fafafa';
}
this.saveBackgroundColor(lightBackground || '#fafafa', false);
if (darkText && !isLight(darkText)) {
console.info(
`Text color (${darkText}) is not light enough for a dark theme. Falling back to zitadel's text color`,
);
darkText = '#ffffff';
}
this.saveTextColor(darkText || '#ffffff', true);
if (darkText && !isLight(darkText)) {
console.info(
`Text color (${darkText}) is not light enough for a dark theme. Falling back to zitadel's text color`,
);
darkText = '#ffffff';
}
this.saveTextColor(darkText || '#ffffff', true);
if (lightText && !isDark(lightText)) {
console.info(
`Text color (${lightText}) is not dark enough for a light theme. Falling back to zitadel's text color`,
);
lightText = '#000000';
}
this.saveTextColor(lightText || '#000000', false);
})
.catch((error) => {
console.error('could not load private labelling policy!', error);
this.setDefaultColors();
});
if (lightText && !isDark(lightText)) {
console.info(
`Text color (${lightText}) is not dark enough for a light theme. Falling back to zitadel's text color`,
);
lightText = '#000000';
}
this.saveTextColor(lightText || '#000000', false);
})
.catch((error) => {
console.error('could not load private labelling policy!', error);
this.setDefaultColors();
});
}
}
}

View File

@@ -757,6 +757,8 @@
"LISTDESCRIPTION": "Wähle eine Organisation aus.",
"ACTIVE": "Aktiv",
"CREATE": "Organisation erstellen",
"DEACTIVATE": "Organisation deaktivieren",
"REACTIVATE": "Organisation reaktivieren",
"NOPERMISSION": "Sie haben keine Berechtigung, auf Einstellungen der Organisation zuzugreifen.",
"USERSELFACCOUNT": "Verwenden Sie Ihr persönliches Konto als Organisationsinhaber",
"ORGDETAIL_TITLE": "Gebe den Namen und die Domain für die neue Organisation ein.",
@@ -821,6 +823,16 @@
"MEMBERREMOVED": "Manager entfernt.",
"MEMBERCHANGED": "Manager geändert.",
"SETPRIMARY": "Primäre Domain gesetzt."
},
"DIALOG": {
"DEACTIVATE": {
"TITLE": "Organisation deaktivieren",
"DESCRIPTION": "Sie sind im Begriff Ihre Organisation zu deaktivieren. User können Sich danach nicht mehr anmelden? Wollen Sie fortfahren?"
},
"REACTIVATE": {
"TITLE": "Organisation reaktivieren",
"DESCRIPTION": "Sie sind im Begriff Ihre Organisation zu reaktivieren. User können Sich danach wieder anmelden? Wollen Sie fortfahren?"
}
}
},
"SETTINGS": {
@@ -861,8 +873,9 @@
"DEFAULTLANGUAGE": "Standardsprache",
"LANGUAGE": {
"de": "Deutsch",
"en": "English",
"it": "Italiano",
"en": "English"
"fr": "Français"
},
"SMTP": {
"TITLE": "SMTP Einstellungen",
@@ -1028,10 +1041,10 @@
"UNSAVED_DESCRIPTION": "Sie haben Änderungen vorgenommen ohne zu speichern. Möchten Sie jetzt speichern?",
"LOCALE": "Sprachcode",
"LOCALES": {
"de": "German",
"de": "Deutsch",
"en": "English",
"it": "Italian",
"fr": "French"
"it": "Italiano",
"fr": "Français"
},
"KEYS": {
"emailVerificationDoneText": "Email Verification erfolgreich",
@@ -1774,8 +1787,9 @@
},
"LANGUAGES": {
"de": "Deutsch",
"it": "Italienisch",
"en": "Englisch"
"en": "English",
"it": "Italiano",
"fr": "Français"
},
"MEMBER": {
"ADD": "Manager hinzufügen",

View File

@@ -22,11 +22,11 @@
"DISCLAIMERLINK": "Further information",
"DOCUMENTATION": {
"TITLE": "Documentation",
"DESCRIPTION": "Mit ZITADEL schnell durchstarten."
"DESCRIPTION": "Get started with ZITADEL quickly."
},
"GETSTARTED": {
"TITLE": "Get started with ZITADEL",
"DESCRIPTION": "Mit ZITADEL schnell durchstarten."
"DESCRIPTION": "Get started with ZITADEL quickly."
},
"QUICKSTARTS": {
"LABEL": "First Steps",
@@ -154,7 +154,7 @@
"TEXT": "Here you can switch between your user accounts and manage your sessions and profile."
},
"NAV": {
"TEXT": "This navigation changes based on your selected oranization above or your instance"
"TEXT": "This navigation changes based on your selected organization above or your instance"
},
"CONTEXTCHANGED": {
"TEXT": "Attention! The organization context has changed."
@@ -227,7 +227,7 @@
"DETAIL": "Detail",
"CREATE": "Create",
"MY": "My Information",
"LOGINNAMES": "Loginnames",
"LOGINNAMES": "Login names",
"LOGINNAMESDESC": "These are your login names:",
"NOUSER": "No associated user.",
"REACTIVATE": "Reactivate",
@@ -757,6 +757,8 @@
"LISTDESCRIPTION": "Choose an organization.",
"ACTIVE": "Active",
"CREATE": "Create Organization",
"DEACTIVATE": "Deactivate Organization",
"REACTIVATE": "Reactivate Organization",
"NOPERMISSION": "You don't have the permission to access organization settings.",
"USERSELFACCOUNT": "Use your personal account as organization owner",
"ORGDETAIL_TITLE": "Enter the name and domain of your new organization.",
@@ -821,6 +823,16 @@
"MEMBERREMOVED": "Manager removed.",
"MEMBERCHANGED": "Manager changed.",
"SETPRIMARY": "Primary domain set."
},
"DIALOG": {
"DEACTIVATE": {
"TITLE": "Deactivate organization",
"DESCRIPTION": "You are about to deactivate your organization. Users won't be able to login afterwards. Are you sure to proceed?"
},
"REACTIVATE": {
"TITLE": "Reactivate organization",
"DESCRIPTION": "You are about to reactivate your organization. Users will be able to login again. Are you sure to proceed?"
}
}
},
"SETTINGS": {
@@ -927,7 +939,7 @@
"RESET": {
"DEFAULTTITLE": "Reset Setting",
"DEFAULTDESCRIPTION": "You are about to reset your settings to the default configuration of your instance. Are you sure you want to continue?",
"LOGINPOLICY_DESCRIPTION": "Warning: If your continue, Identiy Provider settings will be reset to the instance setting too."
"LOGINPOLICY_DESCRIPTION": "Warning: If your continue, Identity Provider settings will be reset to the instance setting too."
}
}
},
@@ -1028,10 +1040,10 @@
"UNSAVED_DESCRIPTION": "Your have made changes without saving. Do you want to save now?",
"LOCALE": "Locale Code",
"LOCALES": {
"de": "German",
"de": "Deutsch",
"en": "English",
"it": "Italian",
"fr": "French"
"it": "Italiano",
"fr": "Français"
},
"KEYS": {
"emailVerificationDoneText": "Email verification done",
@@ -1471,7 +1483,7 @@
"SCOPESLIST": "Scopes List",
"CLIENTID": "Client ID",
"CLIENTSECRET": "Client Secret",
"IDPDISPLAYNAMMAPPING": "IDP Anzeigename Mapping",
"IDPDISPLAYNAMMAPPING": "IDP Display Name Mapping",
"USERNAMEMAPPING": "Username Mapping",
"DATES": "Dates",
"CREATIONDATE": "Created At",
@@ -1773,9 +1785,10 @@
"3": "Other"
},
"LANGUAGES": {
"de": "German",
"it": "Italian",
"en": "English"
"de": "Deutsch",
"en": "English",
"it": "Italiano",
"fr": "Français"
},
"MEMBER": {
"ADD": "Add a Manager",

File diff suppressed because it is too large Load Diff

View File

@@ -22,16 +22,16 @@
"DISCLAIMERLINK": "Ulteriori informazioni",
"DOCUMENTATION": {
"TITLE": "Documentazione",
"DESCRIPTION": "Mit ZITADEL schnell durchstarten."
"DESCRIPTION": "Inizia con ZITADEL."
},
"GETSTARTED": {
"TITLE": "Come iniziare con ZITADEL",
"DESCRIPTION": "Mit ZITADEL schnell durchstarten."
"DESCRIPTION": "Inizia con ZITADEL."
},
"QUICKSTARTS": {
"LABEL": "Primi passi",
"TITLE": "Quickstarts",
"DESCRIPTION": "Iniziare rapidamente con ZITADEL."
"DESCRIPTION": "Inizia con ZITADEL."
},
"SHORTCUTS": {
"SHORTCUTS": "Scorciatoie",
@@ -757,6 +757,8 @@
"LISTDESCRIPTION": "Scegli un'organizzazione.",
"ACTIVE": "Attivo",
"CREATE": "Creare un'organizzazione",
"DEACTIVATE": "Disattiva organizzazione",
"REACTIVATE": "Riattiva organizzazione",
"NOPERMISSION": "Non hai l'autorizzazione per accedere alle impostazioni dell'organizzazione.",
"USERSELFACCOUNT": "Usa il tuo account personale come proprietario dell'organizzazione",
"ORGDETAIL_TITLE": "Inserisci il nome e il dominio della tua nuova organizzazione.",
@@ -821,6 +823,16 @@
"MEMBERREMOVED": "Manager rimosso con successo",
"MEMBERCHANGED": "Manager cambiato con successo",
"SETPRIMARY": "Dominio primario cambiato con successo"
},
"DIALOG": {
"DEACTIVATE": {
"TITLE": "Disattivare l'organizzazione",
"DESCRIPTION": "Stai per disattivate la tua organizzazione. Utenti dell' organizzazione non possono più accedere in seguito. Sei sicuro di procedere?"
},
"REACTIVATE": {
"TITLE": "Riattivare l'organizzazione",
"DESCRIPTION": "Stai per riattivare la tua organizzazione. Utenti dell' organizzazione possono accedere nuovamente dopo l'attivazione. Vuoi procedere?"
}
}
},
"SETTINGS": {
@@ -861,8 +873,9 @@
"DEFAULTLANGUAGE": "Lingua standard",
"LANGUAGE": {
"de": "Deutsch",
"en": "English",
"it": "Italiano",
"en": "English"
"fr": "Français"
},
"SMTP": {
"TITLE": "Impostazioni SMTP",
@@ -1028,10 +1041,10 @@
"UNSAVED_DESCRIPTION": "Hai fatto delle modifiche senza salvare. Vuoi salvare ora?",
"LOCALE": "Codice locale",
"LOCALES": {
"de": "Tedesco",
"en": "Inglese",
"de": "Deutsch",
"en": "English",
"it": "Italiano",
"fr": "Francese"
"fr": "Français"
},
"KEYS": {
"emailVerificationDoneText": "Verifica dell'e-mail terminata con successo.",
@@ -1773,9 +1786,10 @@
"3": "Altro"
},
"LANGUAGES": {
"de": "Tedesco",
"de": "Deutsch",
"en": "English",
"it": "Italiano",
"en": "Inglese"
"fr": "Français"
},
"MEMBER": {
"ADD": "Aggiungi un manager",

View File

@@ -1,34 +1,31 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta charset="utf-8" />
<title>Console</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link rel="stylesheet" href="./assets/icons/line-awesome/css/line-awesome.min.css" />
<link rel="manifest" href="manifest.webmanifest">
<meta name="theme-color" content="#e6768b">
<link rel="manifest" href="manifest.webmanifest" />
<meta name="theme-color" content="#e6768b" />
<meta property="description" content="Console Management Platform for ZITADEL IAM" />
<meta property="og:url" content="https://console.zitadel.ch" />
<meta property="og:type" content="website" />
<meta property="og:title" content="ZITADEL Console" />
<meta property="og:description" content="Console Management Platform for ZITADEL IAM" />
<meta property="description" content="Management Platform for ZITADEL IAM" />
<meta property="og:image" content="https://www.zitadel.ch/zitadel-social-preview25.png" />
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@zitadel_ch">
<meta property="og:image" content="https://www.zitadel.com/images/preview.png" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@zitadel" />
<meta name="twitter:title" content="ZITADEL Console" />
<meta name="twitter:description" content="Management Platform for ZITADEL IAM" />
<meta name="twitter:image" content="https://www.zitadel.ch/zitadel-social-preview25.png">
<meta name="twitter:image" content="https://www.zitadel.com/images/preview.png" />
</head>
<body>
<cnsl-root></cnsl-root>
<noscript>Please enable JavaScript to continue using this application.</noscript>
</body>
</html>
</html>