mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 19:14:23 +00:00
ab62f2d79d
* fix: return full url of assets in admin and mgmt api * remove asset loading over asset service * remove unused code Co-authored-by: Max Peintner <max@caos.ch>
37 lines
1.5 KiB
Go
37 lines
1.5 KiB
Go
package policy
|
|
|
|
import (
|
|
"github.com/caos/zitadel/internal/api/grpc/object"
|
|
"github.com/caos/zitadel/internal/domain"
|
|
"github.com/caos/zitadel/internal/query"
|
|
policy_pb "github.com/caos/zitadel/pkg/grpc/policy"
|
|
)
|
|
|
|
func ModelLabelPolicyToPb(policy *query.LabelPolicy, assetPrefix string) *policy_pb.LabelPolicy {
|
|
return &policy_pb.LabelPolicy{
|
|
IsDefault: policy.IsDefault,
|
|
PrimaryColor: policy.Light.PrimaryColor,
|
|
BackgroundColor: policy.Light.BackgroundColor,
|
|
FontColor: policy.Light.FontColor,
|
|
WarnColor: policy.Light.WarnColor,
|
|
PrimaryColorDark: policy.Dark.PrimaryColor,
|
|
BackgroundColorDark: policy.Dark.BackgroundColor,
|
|
WarnColorDark: policy.Dark.WarnColor,
|
|
FontColorDark: policy.Dark.FontColor,
|
|
FontUrl: domain.AssetURL(assetPrefix, policy.ResourceOwner, policy.FontURL),
|
|
LogoUrl: domain.AssetURL(assetPrefix, policy.ResourceOwner, policy.Light.LogoURL),
|
|
LogoUrlDark: domain.AssetURL(assetPrefix, policy.ResourceOwner, policy.Dark.LogoURL),
|
|
IconUrl: domain.AssetURL(assetPrefix, policy.ResourceOwner, policy.Light.IconURL),
|
|
IconUrlDark: domain.AssetURL(assetPrefix, policy.ResourceOwner, policy.Dark.IconURL),
|
|
|
|
DisableWatermark: policy.WatermarkDisabled,
|
|
HideLoginNameSuffix: policy.HideLoginNameSuffix,
|
|
Details: object.ToViewDetailsPb(
|
|
policy.Sequence,
|
|
policy.CreationDate,
|
|
policy.ChangeDate,
|
|
policy.ResourceOwner,
|
|
),
|
|
}
|
|
}
|