mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-30 11:02:16 +00:00
fix(console): dont apply colors from branding settings (#6853)
fix: dont apply colors in console, clean up theme service
This commit is contained in:
+1
-31
@@ -20,15 +20,7 @@ import { AdminService } from 'src/app/services/admin.service';
|
||||
import { AssetEndpoint, AssetService, AssetType } from 'src/app/services/asset.service';
|
||||
import { ManagementService } from 'src/app/services/mgmt.service';
|
||||
import { StorageKey, StorageLocation, StorageService } from 'src/app/services/storage.service';
|
||||
import {
|
||||
BACKGROUND,
|
||||
DARK_BACKGROUND,
|
||||
DARK_PRIMARY,
|
||||
DARK_WARN,
|
||||
PRIMARY,
|
||||
ThemeService,
|
||||
WARN,
|
||||
} from 'src/app/services/theme.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
import * as opentype from 'opentype.js';
|
||||
@@ -658,7 +650,6 @@ export class PrivateLabelingPolicyComponent implements OnInit, OnDestroy {
|
||||
this.getData().then((data) => {
|
||||
if (data.policy) {
|
||||
this.data = data.policy;
|
||||
this.applyToConsole(data.policy);
|
||||
}
|
||||
});
|
||||
this.getPreviewData().then((data) => {
|
||||
@@ -680,7 +671,6 @@ export class PrivateLabelingPolicyComponent implements OnInit, OnDestroy {
|
||||
this.getData().then((data) => {
|
||||
if (data.policy) {
|
||||
this.data = data.policy;
|
||||
this.applyToConsole(data.policy);
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
@@ -691,26 +681,6 @@ export class PrivateLabelingPolicyComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
private applyToConsole(labelpolicy: LabelPolicy.AsObject): void {
|
||||
const darkPrimary = labelpolicy?.primaryColorDark || DARK_PRIMARY;
|
||||
const lightPrimary = labelpolicy?.primaryColor || PRIMARY;
|
||||
|
||||
const darkWarn = labelpolicy?.warnColorDark || DARK_WARN;
|
||||
const lightWarn = labelpolicy?.warnColor || WARN;
|
||||
|
||||
const darkBackground = labelpolicy?.backgroundColorDark || DARK_BACKGROUND;
|
||||
const lightBackground = labelpolicy?.backgroundColor || BACKGROUND;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
public resetPolicy(): Promise<any> {
|
||||
return (this.service as ManagementService)
|
||||
.resetLabelPolicyToDefault()
|
||||
|
||||
Reference in New Issue
Block a user