feat(console): deactivate, reactivate org, fix signedout route (#3834)

* org detail

* feat: org deactivate, reactivate

* statehandler includes instead of startsWith

* fix signout route

* Update console/src/assets/i18n/de.json

Co-authored-by: Livio Spring <[email protected]>

* french

Co-authored-by: Livio Spring <[email protected]>
This commit is contained in:
Max Peintner
2022-07-08 06:58:23 +00:00
committed by GitHub
co-authored by Livio Spring
parent 91771bc49b
commit 190a454140
22 changed files with 316 additions and 202 deletions
@@ -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);
+56 -54
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();
});
}
}
}