Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added "on" label to checkbox #28087

Merged
merged 1 commit into from Mar 21, 2024
Merged

added "on" label to checkbox #28087

merged 1 commit into from Mar 21, 2024

Conversation

edewit
Copy link
Contributor

@edewit edewit commented Mar 20, 2024

fixes: #28078
Signed-off-by: Erik Jan de Wit erikjan.dewit@gmail.com

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
@edewit edewit requested a review from a team as a code owner March 20, 2024 09:40
Copy link
Contributor

@jonkoops jonkoops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, let's also make sure to backport this.

@@ -25,7 +33,7 @@ export const OptionComponent = (props: UserProfileFieldProps) => {
key={option}
id={option}
data-testid={option}
label={option}
label={props.t(unWrap(optionLabel?.on || option))}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to unWrap(label) here as well, or can we get away with:

Suggested change
label={props.t(unWrap(optionLabel?.on || option))}
label={props.t(optionLabel?.on ? unWrap(optionLabel.on) : option)}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it can be a translation key, see the issue

@edewit edewit merged commit adf838f into keycloak:main Mar 21, 2024
52 checks passed
ahus1 pushed a commit to ahus1/keycloak that referenced this pull request Mar 22, 2024
Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
@@ -25,7 +33,7 @@ export const OptionComponent = (props: UserProfileFieldProps) => {
key={option}
id={option}
data-testid={option}
label={option}
label={props.t(unWrap(optionLabel?.on || option))}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that using optionLabel?.on will look for a entry in inputOptionLabels for the key "on". My guess is that this should rather look for the key option.

Suggestion:

                label={props.t(unWrap(optionLabel?.[option] || option))}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

inputOptionLabels not used for OptionComponent in ui-shared
3 participants