mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:27:32 +00:00
feat: add attribute to only enable specific themes (#6798)
* feat: enable only specific themes in label policy * feat: enable only specific themes in label policy * feat: enable only specific themes in label policy * feat: enable only specific themes in label policy * add management in console * pass enabledTheme * render login ui based on enabled theme * add in branding / settings service and name consistently * update console to latest proto state * fix console linting * fix linting * cleanup * add translations --------- Co-authored-by: Livio Spring <livio.a@gmail.com> Co-authored-by: Tim Möhlmann <tim+github@zitadel.com>
This commit is contained in:
@@ -107,6 +107,20 @@ func brandingSettingsToPb(current *query.LabelPolicy, assetPrefix string) *setti
|
||||
DisableWatermark: current.WatermarkDisabled,
|
||||
HideLoginNameSuffix: current.HideLoginNameSuffix,
|
||||
ResourceOwnerType: isDefaultToResourceOwnerTypePb(current.IsDefault),
|
||||
ThemeMode: themeModeToPb(current.ThemeMode),
|
||||
}
|
||||
}
|
||||
|
||||
func themeModeToPb(themeMode domain.LabelPolicyThemeMode) settings.ThemeMode {
|
||||
switch themeMode {
|
||||
case domain.LabelPolicyThemeAuto:
|
||||
return settings.ThemeMode_THEME_MODE_AUTO
|
||||
case domain.LabelPolicyThemeLight:
|
||||
return settings.ThemeMode_THEME_MODE_LIGHT
|
||||
case domain.LabelPolicyThemeDark:
|
||||
return settings.ThemeMode_THEME_MODE_DARK
|
||||
default:
|
||||
return settings.ThemeMode_THEME_MODE_AUTO
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -258,6 +258,7 @@ func Test_brandingSettingsToPb(t *testing.T) {
|
||||
FontURL: "fonts",
|
||||
WatermarkDisabled: true,
|
||||
HideLoginNameSuffix: true,
|
||||
ThemeMode: domain.LabelPolicyThemeDark,
|
||||
IsDefault: true,
|
||||
}
|
||||
want := &settings.BrandingSettings{
|
||||
@@ -281,6 +282,7 @@ func Test_brandingSettingsToPb(t *testing.T) {
|
||||
DisableWatermark: true,
|
||||
HideLoginNameSuffix: true,
|
||||
ResourceOwnerType: settings.ResourceOwnerType_RESOURCE_OWNER_TYPE_INSTANCE,
|
||||
ThemeMode: settings.ThemeMode_THEME_MODE_DARK,
|
||||
}
|
||||
|
||||
got := brandingSettingsToPb(arg, "http://example.com")
|
||||
|
Reference in New Issue
Block a user