mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 04:18:01 +00:00
cb7b50b513
* 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>
39 lines
1.3 KiB
Go
39 lines
1.3 KiB
Go
package admin
|
|
|
|
import (
|
|
"github.com/zitadel/zitadel/internal/domain"
|
|
admin_pb "github.com/zitadel/zitadel/pkg/grpc/admin"
|
|
policy_pb "github.com/zitadel/zitadel/pkg/grpc/policy"
|
|
)
|
|
|
|
func updateLabelPolicyToDomain(policy *admin_pb.UpdateLabelPolicyRequest) *domain.LabelPolicy {
|
|
return &domain.LabelPolicy{
|
|
PrimaryColor: policy.PrimaryColor,
|
|
BackgroundColor: policy.BackgroundColor,
|
|
WarnColor: policy.WarnColor,
|
|
FontColor: policy.FontColor,
|
|
PrimaryColorDark: policy.PrimaryColorDark,
|
|
BackgroundColorDark: policy.BackgroundColorDark,
|
|
WarnColorDark: policy.WarnColorDark,
|
|
FontColorDark: policy.FontColorDark,
|
|
HideLoginNameSuffix: policy.HideLoginNameSuffix,
|
|
DisableWatermark: policy.DisableWatermark,
|
|
ThemeMode: themeModeToDomain(policy.ThemeMode),
|
|
}
|
|
}
|
|
|
|
func themeModeToDomain(theme policy_pb.ThemeMode) domain.LabelPolicyThemeMode {
|
|
switch theme {
|
|
case policy_pb.ThemeMode_THEME_MODE_AUTO:
|
|
return domain.LabelPolicyThemeAuto
|
|
case policy_pb.ThemeMode_THEME_MODE_DARK:
|
|
return domain.LabelPolicyThemeDark
|
|
case policy_pb.ThemeMode_THEME_MODE_LIGHT:
|
|
return domain.LabelPolicyThemeLight
|
|
case policy_pb.ThemeMode_THEME_MODE_UNSPECIFIED:
|
|
return domain.LabelPolicyThemeAuto
|
|
default:
|
|
return domain.LabelPolicyThemeAuto
|
|
}
|
|
}
|