mirror of
https://github.com/zitadel/zitadel.git
synced 2025-05-04 15:30:46 +00:00
fix: change back to login button and add to register option screen (#4847)
* fix: change back to login button and add to register option screen * fix: change back to login button and add logic for remove and set events Co-authored-by: Fabi <38692350+hifabienne@users.noreply.github.com>
This commit is contained in:
parent
5d61ed5cac
commit
339fbd4f0c
@ -229,6 +229,7 @@ export function mapRequestValues(map: Partial<Map>, req: Req): Req {
|
||||
r21.setExternalLoginDescription(map.registrationOptionText?.externalLoginDescription ?? '');
|
||||
r21.setTitle(map.registrationOptionText?.title ?? '');
|
||||
r21.setUserNameButtonText(map.registrationOptionText?.userNameButtonText ?? '');
|
||||
r21.setLoginButtonText(map.registrationOptionText?.loginButtonText ?? '');
|
||||
req.setRegistrationOptionText(r21);
|
||||
|
||||
const r22 = new RegistrationOrgScreenText();
|
||||
|
@ -486,6 +486,7 @@ title: zitadel/text.proto
|
||||
| description | string | - | string.max_len: 500<br /> |
|
||||
| user_name_button_text | string | - | string.max_len: 200<br /> |
|
||||
| external_login_description | string | - | string.max_len: 500<br /> |
|
||||
| login_button_text | string | - | string.max_len: 200<br /> |
|
||||
|
||||
|
||||
|
||||
|
@ -345,6 +345,7 @@ func RegistrationOptionScreenTextToPb(text domain.RegistrationOptionScreenText)
|
||||
Description: text.Description,
|
||||
UserNameButtonText: text.RegisterUsernamePasswordButtonText,
|
||||
ExternalLoginDescription: text.ExternalLoginDescription,
|
||||
LoginButtonText: text.LoginButtonText,
|
||||
}
|
||||
}
|
||||
|
||||
@ -811,6 +812,7 @@ func RegistrationOptionScreenTextPbToDomain(text *text_pb.RegistrationOptionScre
|
||||
Description: text.Description,
|
||||
RegisterUsernamePasswordButtonText: text.UserNameButtonText,
|
||||
ExternalLoginDescription: text.ExternalLoginDescription,
|
||||
LoginButtonText: text.LoginButtonText,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -195,6 +195,7 @@ RegisterOption:
|
||||
Description: Wähle aus wie du dich registrieren möchtest.
|
||||
RegisterUsernamePasswordButtonText: Mit Benutzername Passwort
|
||||
ExternalLoginDescription: oder registriere dich mit einem externen Benutzer
|
||||
LoginButtonText: login
|
||||
|
||||
RegistrationUser:
|
||||
Title: Registration
|
||||
@ -222,7 +223,7 @@ RegistrationUser:
|
||||
TosConfirmAnd: und die
|
||||
PrivacyLinkText: Datenschutzerklärung
|
||||
ExternalLogin: oder registriere dich mit einem externen Benutzer
|
||||
BackButtonText: zurück
|
||||
BackButtonText: login
|
||||
NextButtonText: weiter
|
||||
|
||||
ExternalRegistrationUserOverview:
|
||||
|
@ -195,6 +195,7 @@ RegisterOption:
|
||||
Description: Choose how you'd like to register
|
||||
RegisterUsernamePasswordButtonText: With username password
|
||||
ExternalLoginDescription: or register with an external user
|
||||
LoginButtonText: login
|
||||
|
||||
RegistrationUser:
|
||||
Title: Registration
|
||||
@ -222,7 +223,7 @@ RegistrationUser:
|
||||
TosConfirmAnd: and the
|
||||
PrivacyLinkText: privacy policy
|
||||
ExternalLogin: or register with an external user
|
||||
BackButtonText: back
|
||||
BackButtonText: login
|
||||
NextButtonText: next
|
||||
|
||||
ExternalRegistrationUserOverview:
|
||||
|
@ -195,6 +195,7 @@ RegisterOption:
|
||||
Description: Choisissez comment vous souhaitez vous enregistrer
|
||||
RegisterUsernamePasswordButtonText: Avec nom d'utilisateur et mot de passe
|
||||
ExternalLoginDescription: ou s'enregistrer avec un utilisateur externe
|
||||
LoginButtonText: connexion
|
||||
|
||||
RegistrationUser:
|
||||
Title: Inscription
|
||||
@ -222,7 +223,7 @@ RegistrationUser:
|
||||
TosConfirmAnd: et la
|
||||
PrivacyLinkText: politique de confidentialité
|
||||
ExternalLogin: ou m'inscrire avec un utilisateur externe
|
||||
BackButtonText: retour
|
||||
BackButtonText: connexion
|
||||
NextButtonText: suivant
|
||||
|
||||
ExternalRegistrationUserOverview:
|
||||
|
@ -195,6 +195,7 @@ RegisterOption:
|
||||
Description: Scegli come vuoi registrarti
|
||||
RegisterUsernamePasswordButtonText: Con nome utente e password
|
||||
ExternalLoginDescription: o registrarsi con un utente esterno
|
||||
LoginButtonText: Accedi
|
||||
|
||||
RegistrationUser:
|
||||
Title: Registrazione
|
||||
@ -222,7 +223,7 @@ RegistrationUser:
|
||||
TosConfirmAnd: e
|
||||
PrivacyLinkText: l'informativa sulla privacy
|
||||
ExternalLogin: o registrati con un utente esterno
|
||||
BackButtonText: indietro
|
||||
BackButtonText: Accedi
|
||||
NextButtonText: Avanti
|
||||
|
||||
ExternalRegistrationUserOverview:
|
||||
|
@ -195,6 +195,7 @@ RegisterOption:
|
||||
Description: 选择您的注册方式
|
||||
RegisterUsernamePasswordButtonText: 使用用户名密码
|
||||
ExternalLoginDescription: 或使用外部身份提供者
|
||||
LoginButtonText: 登录
|
||||
|
||||
RegistrationUser:
|
||||
Title: 注册
|
||||
@ -222,7 +223,7 @@ RegistrationUser:
|
||||
TosConfirmAnd: 和
|
||||
PrivacyLinkText: 隐私政策
|
||||
ExternalLogin: 使用外部身份提供者注册
|
||||
BackButtonText: 返回
|
||||
BackButtonText: 登录
|
||||
NextButtonText: 继续
|
||||
|
||||
ExternalRegistrationUserOverview:
|
||||
|
@ -36,6 +36,12 @@
|
||||
</div>
|
||||
|
||||
{{template "error-message" .}}
|
||||
|
||||
<div class="lgn-actions">
|
||||
<a class="lgn-stroked-button" href="{{ loginUrl }}">
|
||||
{{t "RegisterOption.LoginButtonText"}}
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
@ -761,6 +761,10 @@ func (c *Commands) createRegistrationOptionEvents(ctx context.Context, agg *even
|
||||
if event != nil {
|
||||
events = append(events, event)
|
||||
}
|
||||
event = c.createCustomLoginTextEvent(ctx, agg, domain.LoginKeyRegistrationOptionLoginButtonText, existingText.RegistrationOptionLoginButtonText, text.RegisterOption.LoginButtonText, text.Language, defaultText)
|
||||
if event != nil {
|
||||
events = append(events, event)
|
||||
}
|
||||
return events
|
||||
}
|
||||
|
||||
|
@ -204,6 +204,7 @@ type CustomLoginTextReadModel struct {
|
||||
RegistrationOptionDescription string
|
||||
RegistrationOptionUserNameButtonText string
|
||||
RegistrationOptionExternalLoginDescription string
|
||||
RegistrationOptionLoginButtonText string
|
||||
|
||||
RegistrationUserTitle string
|
||||
RegistrationUserDescription string
|
||||
@ -1878,6 +1879,10 @@ func (wm *CustomLoginTextReadModel) handleRegistrationOptionScreenSetEvent(e *po
|
||||
wm.RegistrationOptionExternalLoginDescription = e.Text
|
||||
return
|
||||
}
|
||||
if e.Key == domain.LoginKeyRegistrationOptionLoginButtonText {
|
||||
wm.RegistrationOptionLoginButtonText = e.Text
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func (wm *CustomLoginTextReadModel) handleRegistrationOptionScreenRemoveEvent(e *policy.CustomTextRemovedEvent) {
|
||||
@ -1897,6 +1902,10 @@ func (wm *CustomLoginTextReadModel) handleRegistrationOptionScreenRemoveEvent(e
|
||||
wm.RegistrationOptionExternalLoginDescription = ""
|
||||
return
|
||||
}
|
||||
if e.Key == domain.LoginKeyRegistrationOptionLoginButtonText {
|
||||
wm.RegistrationOptionLoginButtonText = ""
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func (wm *CustomLoginTextReadModel) handleRegistrationUserScreenSetEvent(e *policy.CustomTextSetEvent) {
|
||||
|
@ -932,6 +932,12 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) {
|
||||
&instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionExternalLoginDescription, "ExternalLoginDescription", language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusherWithInstanceID(
|
||||
"INSTANCE",
|
||||
instance.NewCustomTextSetEvent(context.Background(),
|
||||
&instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionLoginButtonText, "LoginButtonText", language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusherWithInstanceID(
|
||||
"INSTANCE",
|
||||
instance.NewCustomTextSetEvent(context.Background(),
|
||||
@ -1569,6 +1575,7 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) {
|
||||
Description: "Description",
|
||||
RegisterUsernamePasswordButtonText: "RegisterUsernamePasswordButtonText",
|
||||
ExternalLoginDescription: "ExternalLoginDescription",
|
||||
LoginButtonText: "LoginButtonText",
|
||||
},
|
||||
RegistrationUser: domain.RegistrationUserScreenText{
|
||||
Title: "Title",
|
||||
@ -2548,6 +2555,12 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) {
|
||||
&instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionExternalLoginDescription, "ExternalLoginDescription", language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusherWithInstanceID(
|
||||
"INSTANCE",
|
||||
instance.NewCustomTextSetEvent(context.Background(),
|
||||
&instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionLoginButtonText, "LoginButtonText", language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusherWithInstanceID(
|
||||
"INSTANCE",
|
||||
instance.NewCustomTextSetEvent(context.Background(),
|
||||
@ -3859,6 +3872,12 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) {
|
||||
&instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionExternalLoginDescription, language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusherWithInstanceID(
|
||||
"INSTANCE",
|
||||
instance.NewCustomTextRemovedEvent(context.Background(),
|
||||
&instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionLoginButtonText, language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusherWithInstanceID(
|
||||
"INSTANCE",
|
||||
instance.NewCustomTextRemovedEvent(context.Background(),
|
||||
@ -5223,6 +5242,12 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) {
|
||||
&instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionExternalLoginDescription, "ExternalLoginDescription", language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusherWithInstanceID(
|
||||
"INSTANCE",
|
||||
instance.NewCustomTextSetEvent(context.Background(),
|
||||
&instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionLoginButtonText, "LoginButtonText", language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusherWithInstanceID(
|
||||
"INSTANCE",
|
||||
instance.NewCustomTextSetEvent(context.Background(),
|
||||
@ -6532,6 +6557,12 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) {
|
||||
&instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionExternalLoginDescription, language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusherWithInstanceID(
|
||||
"INSTANCE",
|
||||
instance.NewCustomTextRemovedEvent(context.Background(),
|
||||
&instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionLoginButtonText, language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusherWithInstanceID(
|
||||
"INSTANCE",
|
||||
instance.NewCustomTextRemovedEvent(context.Background(),
|
||||
@ -7844,6 +7875,12 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) {
|
||||
&instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionExternalLoginDescription, "ExternalLoginDescription", language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusherWithInstanceID(
|
||||
"INSTANCE",
|
||||
instance.NewCustomTextSetEvent(context.Background(),
|
||||
&instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionLoginButtonText, "LoginButtonText", language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusherWithInstanceID(
|
||||
"INSTANCE",
|
||||
instance.NewCustomTextSetEvent(context.Background(),
|
||||
@ -8481,6 +8518,7 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) {
|
||||
Description: "Description",
|
||||
RegisterUsernamePasswordButtonText: "RegisterUsernamePasswordButtonText",
|
||||
ExternalLoginDescription: "ExternalLoginDescription",
|
||||
LoginButtonText: "LoginButtonText",
|
||||
},
|
||||
RegistrationUser: domain.RegistrationUserScreenText{
|
||||
Title: "Title",
|
||||
|
@ -206,6 +206,7 @@ const (
|
||||
LoginKeyRegistrationOptionDescription = LoginKeyRegistrationOption + "Description"
|
||||
LoginKeyRegistrationOptionUserNameButtonText = LoginKeyRegistrationOption + "RegisterUsernamePasswordButtonText"
|
||||
LoginKeyRegistrationOptionExternalLoginDescription = LoginKeyRegistrationOption + "ExternalLoginDescription"
|
||||
LoginKeyRegistrationOptionLoginButtonText = LoginKeyRegistrationOption + "LoginButtonText"
|
||||
|
||||
LoginKeyRegistrationUser = "RegistrationUser."
|
||||
LoginKeyRegistrationUserTitle = LoginKeyRegistrationUser + "Title"
|
||||
@ -261,6 +262,7 @@ const (
|
||||
LoginKeyRegisterOrgTosConfirmAnd = LoginKeyRegistrationOrg + "TosConfirmAnd"
|
||||
LoginKeyRegisterOrgPrivacyLinkText = LoginKeyRegistrationOrg + "PrivacyLinkText"
|
||||
LoginKeyRegisterOrgSaveButtonText = LoginKeyRegistrationOrg + "SaveButtonText"
|
||||
LoginKeyRegisterOrgBackButtonText = LoginKeyRegistrationOrg + "BackButtonText"
|
||||
|
||||
LoginKeyLinkingUserDone = "LinkingUsersDone."
|
||||
LoginKeyLinkingUserDoneTitle = LoginKeyLinkingUserDone + "Title"
|
||||
@ -540,6 +542,7 @@ type RegistrationOptionScreenText struct {
|
||||
Description string
|
||||
RegisterUsernamePasswordButtonText string
|
||||
ExternalLoginDescription string
|
||||
LoginButtonText string
|
||||
}
|
||||
|
||||
type RegistrationUserScreenText struct {
|
||||
|
@ -283,6 +283,7 @@ message RegistrationOptionScreenText {
|
||||
string description = 2 [(validate.rules).string = {max_len: 500}];
|
||||
string user_name_button_text = 3 [(validate.rules).string = {max_len: 200}];
|
||||
string external_login_description = 4 [(validate.rules).string = {max_len: 500}];
|
||||
string login_button_text = 5 [(validate.rules).string = {max_len: 200}];
|
||||
}
|
||||
|
||||
message RegistrationUserScreenText {
|
||||
|
Loading…
x
Reference in New Issue
Block a user