mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-21 19:00:59 +00:00
fix: import user, hide login name suffix (#1474)
* fix: import user, and label policy command side * feat: Import user and hide loginname suffix (#1464) * 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> (cherry picked from commit03ddb8fc38
) * feat: Import user and hide loginname suffix (#1464) * 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> (cherry picked from commit03ddb8fc38
) * feat: Import user and hide loginname suffix (#1464) * 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> (cherry picked from commit03ddb8fc38
) * fix: label policy events * loginname placeholder * fix: tests * fix: tests * Update internal/command/iam_policy_label_model.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
@@ -60,6 +60,7 @@ func TestCommandSide_AddDefaultLabelPolicy(t *testing.T) {
|
||||
&iam.NewAggregate().Aggregate,
|
||||
"primary-color",
|
||||
"secondary-color",
|
||||
true,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -68,8 +69,9 @@ func TestCommandSide_AddDefaultLabelPolicy(t *testing.T) {
|
||||
args: args{
|
||||
ctx: context.Background(),
|
||||
policy: &domain.LabelPolicy{
|
||||
PrimaryColor: "primary-color",
|
||||
SecondaryColor: "secondary-color",
|
||||
PrimaryColor: "primary-color",
|
||||
SecondaryColor: "secondary-color",
|
||||
HideLoginNameSuffix: true,
|
||||
},
|
||||
},
|
||||
res: res{
|
||||
@@ -89,6 +91,7 @@ func TestCommandSide_AddDefaultLabelPolicy(t *testing.T) {
|
||||
&iam.NewAggregate().Aggregate,
|
||||
"primary-color",
|
||||
"secondary-color",
|
||||
true,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -98,8 +101,9 @@ func TestCommandSide_AddDefaultLabelPolicy(t *testing.T) {
|
||||
args: args{
|
||||
ctx: context.Background(),
|
||||
policy: &domain.LabelPolicy{
|
||||
PrimaryColor: "primary-color",
|
||||
SecondaryColor: "secondary-color",
|
||||
PrimaryColor: "primary-color",
|
||||
SecondaryColor: "secondary-color",
|
||||
HideLoginNameSuffix: true,
|
||||
},
|
||||
},
|
||||
res: res{
|
||||
@@ -108,8 +112,9 @@ func TestCommandSide_AddDefaultLabelPolicy(t *testing.T) {
|
||||
AggregateID: "IAM",
|
||||
ResourceOwner: "IAM",
|
||||
},
|
||||
PrimaryColor: "primary-color",
|
||||
SecondaryColor: "secondary-color",
|
||||
PrimaryColor: "primary-color",
|
||||
SecondaryColor: "secondary-color",
|
||||
HideLoginNameSuffix: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -199,6 +204,7 @@ func TestCommandSide_ChangeDefaultLabelPolicy(t *testing.T) {
|
||||
&iam.NewAggregate().Aggregate,
|
||||
"primary-color",
|
||||
"secondary-color",
|
||||
true,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -207,8 +213,9 @@ func TestCommandSide_ChangeDefaultLabelPolicy(t *testing.T) {
|
||||
args: args{
|
||||
ctx: context.Background(),
|
||||
policy: &domain.LabelPolicy{
|
||||
PrimaryColor: "primary-color",
|
||||
SecondaryColor: "secondary-color",
|
||||
PrimaryColor: "primary-color",
|
||||
SecondaryColor: "secondary-color",
|
||||
HideLoginNameSuffix: true,
|
||||
},
|
||||
},
|
||||
res: res{
|
||||
@@ -226,13 +233,14 @@ func TestCommandSide_ChangeDefaultLabelPolicy(t *testing.T) {
|
||||
&iam.NewAggregate().Aggregate,
|
||||
"primary-color",
|
||||
"secondary-color",
|
||||
true,
|
||||
),
|
||||
),
|
||||
),
|
||||
expectPush(
|
||||
[]*repository.Event{
|
||||
eventFromEventPusher(
|
||||
newDefaultLabelPolicyChangedEvent(context.Background(), "primary-color-change", "secondary-color-change"),
|
||||
newDefaultLabelPolicyChangedEvent(context.Background(), "primary-color-change", "secondary-color-change", false),
|
||||
),
|
||||
},
|
||||
),
|
||||
@@ -241,8 +249,9 @@ func TestCommandSide_ChangeDefaultLabelPolicy(t *testing.T) {
|
||||
args: args{
|
||||
ctx: context.Background(),
|
||||
policy: &domain.LabelPolicy{
|
||||
PrimaryColor: "primary-color-change",
|
||||
SecondaryColor: "secondary-color-change",
|
||||
PrimaryColor: "primary-color-change",
|
||||
SecondaryColor: "secondary-color-change",
|
||||
HideLoginNameSuffix: false,
|
||||
},
|
||||
},
|
||||
res: res{
|
||||
@@ -251,8 +260,9 @@ func TestCommandSide_ChangeDefaultLabelPolicy(t *testing.T) {
|
||||
AggregateID: "IAM",
|
||||
ResourceOwner: "IAM",
|
||||
},
|
||||
PrimaryColor: "primary-color-change",
|
||||
SecondaryColor: "secondary-color-change",
|
||||
PrimaryColor: "primary-color-change",
|
||||
SecondaryColor: "secondary-color-change",
|
||||
HideLoginNameSuffix: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -276,12 +286,13 @@ func TestCommandSide_ChangeDefaultLabelPolicy(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func newDefaultLabelPolicyChangedEvent(ctx context.Context, primaryColor, secondaryColor string) *iam.LabelPolicyChangedEvent {
|
||||
func newDefaultLabelPolicyChangedEvent(ctx context.Context, primaryColor, secondaryColor string, hideLoginNameSuffix bool) *iam.LabelPolicyChangedEvent {
|
||||
event, _ := iam.NewLabelPolicyChangedEvent(ctx,
|
||||
&iam.NewAggregate().Aggregate,
|
||||
[]policy.LabelPolicyChanges{
|
||||
policy.ChangePrimaryColor(primaryColor),
|
||||
policy.ChangeSecondaryColor(secondaryColor),
|
||||
policy.ChangeHideLoginNameSuffix(hideLoginNameSuffix),
|
||||
},
|
||||
)
|
||||
return event
|
||||
|
Reference in New Issue
Block a user