fix(logintexts): fix several custom text attributes for get and set (#4733)

* fix(logintexts): fix several custom text attributes for get and set

* fix(logintexts): fix externalUserNotFound attribute for json unmarshalling and reduce for customTexts

* fix: correct imports for linting
This commit is contained in:
Stefan Benz
2022-12-01 12:31:46 +00:00
committed by GitHub
parent 9fbd1034c2
commit 9626897834
10 changed files with 88 additions and 32 deletions

View File

@@ -400,6 +400,9 @@ func CustomTextsToLoginDomain(instanceID, aggregateID, lang string, texts *Custo
if strings.HasPrefix(text.Key, domain.LoginKeyRegistrationUser) {
registrationUserKeyToDomain(text, result)
}
if strings.HasPrefix(text.Key, domain.LoginKeyExternalRegistrationUserOverview) {
externalRegistrationUserKeyToDomain(text, result)
}
if strings.HasPrefix(text.Key, domain.LoginKeyRegistrationOrg) {
registrationOrgKeyToDomain(text, result)
}
@@ -938,6 +941,57 @@ func registrationOptionKeyToDomain(text *CustomText, result *domain.CustomLoginT
}
}
func externalRegistrationUserKeyToDomain(text *CustomText, result *domain.CustomLoginText) {
if text.Key == domain.LoginKeyExternalRegistrationUserOverviewBackButtonText {
result.ExternalRegistrationUserOverview.BackButtonText = text.Text
}
if text.Key == domain.LoginKeyExternalRegistrationUserOverviewDescription {
result.ExternalRegistrationUserOverview.Description = text.Text
}
if text.Key == domain.LoginKeyExternalRegistrationUserOverviewEmailLabel {
result.ExternalRegistrationUserOverview.EmailLabel = text.Text
}
if text.Key == domain.LoginKeyExternalRegistrationUserOverviewFirstnameLabel {
result.ExternalRegistrationUserOverview.FirstnameLabel = text.Text
}
if text.Key == domain.LoginKeyExternalRegistrationUserOverviewLanguageLabel {
result.ExternalRegistrationUserOverview.LanguageLabel = text.Text
}
if text.Key == domain.LoginKeyExternalRegistrationUserOverviewLastnameLabel {
result.ExternalRegistrationUserOverview.LastnameLabel = text.Text
}
if text.Key == domain.LoginKeyExternalRegistrationUserOverviewNextButtonText {
result.ExternalRegistrationUserOverview.NextButtonText = text.Text
}
if text.Key == domain.LoginKeyExternalRegistrationUserOverviewNicknameLabel {
result.ExternalRegistrationUserOverview.NicknameLabel = text.Text
}
if text.Key == domain.LoginKeyExternalRegistrationUserOverviewPhoneLabel {
result.ExternalRegistrationUserOverview.PhoneLabel = text.Text
}
if text.Key == domain.LoginKeyExternalRegistrationUserOverviewPrivacyLinkText {
result.ExternalRegistrationUserOverview.PrivacyLinkText = text.Text
}
if text.Key == domain.LoginKeyExternalRegistrationUserOverviewTitle {
result.ExternalRegistrationUserOverview.Title = text.Text
}
if text.Key == domain.LoginKeyExternalRegistrationUserOverviewTOSAndPrivacyLabel {
result.ExternalRegistrationUserOverview.TOSAndPrivacyLabel = text.Text
}
if text.Key == domain.LoginKeyExternalRegistrationUserOverviewTOSConfirm {
result.ExternalRegistrationUserOverview.TOSConfirm = text.Text
}
if text.Key == domain.LoginKeyExternalRegistrationUserOverviewTOSConfirmAnd {
result.ExternalRegistrationUserOverview.TOSConfirmAnd = text.Text
}
if text.Key == domain.LoginKeyExternalRegistrationUserOverviewTOSLinkText {
result.ExternalRegistrationUserOverview.TOSLinkText = text.Text
}
if text.Key == domain.LoginKeyExternalRegistrationUserOverviewUsernameLabel {
result.ExternalRegistrationUserOverview.UsernameLabel = text.Text
}
}
func registrationUserKeyToDomain(text *CustomText, result *domain.CustomLoginText) {
if text.Key == domain.LoginKeyRegistrationUserTitle {
result.RegistrationUser.Title = text.Text
@@ -1060,31 +1114,31 @@ func linkingUserKeyToDomain(text *CustomText, result *domain.CustomLoginText) {
func externalUserNotFoundKeyToDomain(text *CustomText, result *domain.CustomLoginText) {
if text.Key == domain.LoginKeyExternalNotFoundTitle {
result.ExternalNotFoundOption.Title = text.Text
result.ExternalNotFound.Title = text.Text
}
if text.Key == domain.LoginKeyExternalNotFoundDescription {
result.ExternalNotFoundOption.Description = text.Text
result.ExternalNotFound.Description = text.Text
}
if text.Key == domain.LoginKeyExternalNotFoundLinkButtonText {
result.ExternalNotFoundOption.LinkButtonText = text.Text
result.ExternalNotFound.LinkButtonText = text.Text
}
if text.Key == domain.LoginKeyExternalNotFoundAutoRegisterButtonText {
result.ExternalNotFoundOption.AutoRegisterButtonText = text.Text
result.ExternalNotFound.AutoRegisterButtonText = text.Text
}
if text.Key == domain.LoginKeyExternalNotFoundTOSAndPrivacyLabel {
result.ExternalNotFoundOption.TOSAndPrivacyLabel = text.Text
result.ExternalNotFound.TOSAndPrivacyLabel = text.Text
}
if text.Key == domain.LoginKeyExternalNotFoundTOSConfirm {
result.ExternalNotFoundOption.TOSConfirm = text.Text
result.ExternalNotFound.TOSConfirm = text.Text
}
if text.Key == domain.LoginKeyExternalNotFoundTOSLinkText {
result.ExternalNotFoundOption.TOSLinkText = text.Text
result.ExternalNotFound.TOSLinkText = text.Text
}
if text.Key == domain.LoginKeyExternalNotFoundTOSConfirmAnd {
result.ExternalNotFoundOption.TOSConfirmAnd = text.Text
result.ExternalNotFound.TOSConfirmAnd = text.Text
}
if text.Key == domain.LoginKeyExternalNotFoundPrivacyLinkText {
result.ExternalNotFoundOption.PrivacyLinkText = text.Text
result.ExternalNotFound.PrivacyLinkText = text.Text
}
}