diff --git a/console/angular.json b/console/angular.json
index 338b52832d..697d1fb4de 100644
--- a/console/angular.json
+++ b/console/angular.json
@@ -31,6 +31,7 @@
"src/app/proto/generated/zitadel/admin_pb",
"src/app/proto/generated/zitadel/org_pb",
"src/app/proto/generated/zitadel/management_pb",
+ "src/app/proto/generated/zitadel/user_pb",
"src/app/proto/generated/**",
"google-protobuf/google/protobuf/empty_pb",
"file-saver",
diff --git a/console/src/app/app.component.ts b/console/src/app/app.component.ts
index 98d6ae95ae..b1499b18ba 100644
--- a/console/src/app/app.component.ts
+++ b/console/src/app/app.component.ts
@@ -216,13 +216,14 @@ export class AppComponent implements OnDestroy {
.getActiveOrg()
.then((org) => {
this.org = org;
-
- this.loadPrivateLabelling();
+ this.themeService.loadPrivateLabelling();
// TODO add when console storage is implemented
// this.startIntroWorkflow();
})
.catch((error) => {
+ console.error(error);
+ this.themeService.setDefaultColors();
this.router.navigate(['/users/me']);
});
}
@@ -256,95 +257,6 @@ export class AppComponent implements OnDestroy {
this.destroy$.complete();
}
- public loadPrivateLabelling(): void {
- const setDefaultColors = () => {
- const darkPrimary = '#bbbafa';
- const lightPrimary = '#5469d4';
-
- const darkWarn = '#ff3b5b';
- const lightWarn = '#cd3d56';
-
- const darkBackground = '#111827';
- const lightBackground = '#fafafa';
-
- const darkText = '#ffffff';
- const lightText = '#000000';
-
- this.themeService.savePrimaryColor(darkPrimary, true);
- this.themeService.savePrimaryColor(lightPrimary, false);
-
- this.themeService.saveWarnColor(darkWarn, true);
- this.themeService.saveWarnColor(lightWarn, false);
-
- this.themeService.saveBackgroundColor(darkBackground, true);
- this.themeService.saveBackgroundColor(lightBackground, false);
-
- this.themeService.saveTextColor(darkText, true);
- this.themeService.saveTextColor(lightText, false);
- };
-
- setDefaultColors();
-
- this.mgmtService.getLabelPolicy().then((labelpolicy) => {
- if (labelpolicy.policy) {
- this.labelpolicy = labelpolicy.policy;
-
- const isDark = (color: string) => this.themeService.isDark(color);
- const isLight = (color: string) => this.themeService.isLight(color);
-
- const darkPrimary = this.labelpolicy?.primaryColorDark || '#bbbafa';
- const lightPrimary = this.labelpolicy?.primaryColor || '#5469d4';
-
- const darkWarn = this.labelpolicy?.warnColorDark || '#ff3b5b';
- const lightWarn = this.labelpolicy?.warnColor || '#cd3d56';
-
- let darkBackground = this.labelpolicy?.backgroundColorDark;
- let lightBackground = this.labelpolicy?.backgroundColor;
-
- let darkText = this.labelpolicy.fontColorDark;
- let lightText = this.labelpolicy.fontColor;
-
- this.themeService.savePrimaryColor(darkPrimary, true);
- this.themeService.savePrimaryColor(lightPrimary, false);
-
- this.themeService.saveWarnColor(darkWarn, true);
- this.themeService.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.themeService.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.themeService.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.themeService.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.themeService.saveTextColor(lightText || '#000000', false);
- }
- });
- }
-
public prepareRoute(outlet: RouterOutlet): boolean {
return outlet && outlet.activatedRouteData && outlet.activatedRouteData.animation;
}
@@ -357,7 +269,7 @@ export class AppComponent implements OnDestroy {
}
public changedOrg(org: Org.AsObject): void {
- this.loadPrivateLabelling();
+ this.themeService.loadPrivateLabelling();
this.authService.zitadelPermissionsChanged.pipe(take(1)).subscribe(() => {
this.router.navigate(['/org'], { fragment: org.id });
});
diff --git a/console/src/app/modules/footer/footer.component.html b/console/src/app/modules/footer/footer.component.html
index 27822c69cc..472c367c0c 100644
--- a/console/src/app/modules/footer/footer.component.html
+++ b/console/src/app/modules/footer/footer.component.html
@@ -11,7 +11,7 @@
-
diff --git a/console/src/app/modules/idp-table/idp-table.component.html b/console/src/app/modules/idp-table/idp-table.component.html
index bfa88fbc7b..da80ff730d 100644
--- a/console/src/app/modules/idp-table/idp-table.component.html
+++ b/console/src/app/modules/idp-table/idp-table.component.html
@@ -11,7 +11,7 @@