mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-10 22:43:40 +00:00
03ddb8fc38
* fix: import user * fix: label policy * fix: label policy * fix: label policy * fix: migrations * fix: migrations * fix: migrations * fix: label policy * loginSuffix in login ui * suffix * fix cursor on disabled user selection Co-authored-by: Livio Amstutz <livio.a@gmail.com>
51 lines
1.7 KiB
Go
51 lines
1.7 KiB
Go
package management
|
|
|
|
import (
|
|
"github.com/caos/logging"
|
|
"github.com/golang/protobuf/ptypes"
|
|
|
|
iam_model "github.com/caos/zitadel/internal/iam/model"
|
|
"github.com/caos/zitadel/pkg/grpc/management"
|
|
)
|
|
|
|
func labelPolicyRequestToModel(policy *management.LabelPolicyRequest) *iam_model.LabelPolicy {
|
|
return &iam_model.LabelPolicy{
|
|
SecondaryColor: policy.SecondaryColor,
|
|
PrimaryColor: policy.PrimaryColor,
|
|
HideLoginNameSuffix: policy.HideLoginNameSuffix,
|
|
}
|
|
}
|
|
|
|
func labelPolicyFromModel(policy *iam_model.LabelPolicy) *management.LabelPolicy {
|
|
creationDate, err := ptypes.TimestampProto(policy.CreationDate)
|
|
logging.Log("GRPC-2Fsm8").OnError(err).Debug("date parse failed")
|
|
|
|
changeDate, err := ptypes.TimestampProto(policy.ChangeDate)
|
|
logging.Log("GRPC-3Flo0").OnError(err).Debug("date parse failed")
|
|
|
|
return &management.LabelPolicy{
|
|
SecondaryColor: policy.SecondaryColor,
|
|
PrimaryColor: policy.PrimaryColor,
|
|
HideLoginNameSuffix: policy.HideLoginNameSuffix,
|
|
CreationDate: creationDate,
|
|
ChangeDate: changeDate,
|
|
}
|
|
}
|
|
|
|
func labelPolicyViewFromModel(policy *iam_model.LabelPolicyView) *management.LabelPolicyView {
|
|
creationDate, err := ptypes.TimestampProto(policy.CreationDate)
|
|
logging.Log("GRPC-5Tsm8").OnError(err).Debug("date parse failed")
|
|
|
|
changeDate, err := ptypes.TimestampProto(policy.ChangeDate)
|
|
logging.Log("GRPC-8dJgs").OnError(err).Debug("date parse failed")
|
|
|
|
return &management.LabelPolicyView{
|
|
Default: policy.Default,
|
|
SecondaryColor: policy.SecondaryColor,
|
|
PrimaryColor: policy.PrimaryColor,
|
|
HideLoginNameSuffix: policy.HideLoginNameSuffix,
|
|
CreationDate: creationDate,
|
|
ChangeDate: changeDate,
|
|
}
|
|
}
|