8000 l18n for client names in device activity by ssilvert · Pull Request #32920 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

l18n for client names in device activity - #32920

Closed
ssilvert wants to merge 1 commit into
keycloak:mainfrom
ssilvert:issue-32916-dev-activity-client-name
Closed

ssilvert wants to merge 1 commit into
keycloak:mainfrom
ssilvert:issue-32916-dev-activity-client-name

Conversation

@ssilvert
Copy link
Copy Markdown
Contributor

Fixes #32916

Fixes keycloak#32916

Signed-off-by: Stan Silvert <ssilvert@redhat.com>
@keycloak-github-bot
Copy link
Copy Markdown

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.webauthn.WebAuthnTransportsTest#usbTransport

Keycloak CI - WebAuthn IT (chrome)

java.lang.AssertionError: Expected LoginPage but was AUTH_RESPONSE (https://localhost:8543/auth/realms/master/app/auth?state=078045ae-3646-41b7-a819-349b3d9426ec&session_state=85d384a3-42fe-4eb5-9ba6-cd8aa09baddb&iss=https%3A%2F%2Flocalhost%3A8543%2Fauth%2Frealms%2Ftest&code=c0db998d-b99b-491e-9c35-022295e62164.85d384a3-42fe-4eb5-9ba6-cd8aa09baddb.e5837747-634f-4eaa-a02a-33aa69a6e8c8)
	at org.junit.Assert.fail(Assert.java:89)
	at org.junit.Assert.assertTrue(Assert.java:42)
	at org.keycloak.testsuite.pages.AbstractPage.assertCurrent(AbstractPage.java:47)
	at org.keycloak.testsuite.pages.LoginPage.open(LoginPage.java:262)
...

Report flaky test

@keycloak-github-bot keycloak-github-bot Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

Comment on lines +90 to +97
const removeSpecialChars = (clientName: string): string => {
if (clientName.startsWith("${") && clientName.endsWith("}")) {
return clientName.substring(2, clientName.length - 1);
}

return clientName;
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is already logic that does this and also looks up the name in the bundle

Suggested change
const removeSpecialChars = (clientName: string): string => {
if (clientName.startsWith("${") && clientName.endsWith("}")) {
return clientName.substring(2, clientName.length - 1);
}
return clientName;
};
import { label } from "@keycloak/keycloak-ui-shared";

let clientName: string;
if (client.clientName !== "") {
clientName = t(client.clientName as TFuncKey);
clientName = t(removeSpecialChars(client.clientName) as TFuncKey);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
clientName = t(removeSpecialChars(client.clientName) as TFuncKey);
clientName = label(t, client.clientName);

@ssilvert
Copy link
Copy Markdown
Contributor Author

Closed in favor of #32982

@ssilvert ssilvert closed this Sep 16, 2024
@ssilvert
ssilvert deleted the issue-32916-dev-activity-client-name branch October 4, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Device activity client name translations

2 participants

0