diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/RoleMappingTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/RoleMappingTab.ts index 5ffaeead8a..b288e78ad5 100644 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/RoleMappingTab.ts +++ b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/RoleMappingTab.ts @@ -74,7 +74,7 @@ export default class RoleMappingTab { selectRow(name: string, modal = false) { cy.get(modal ? ".pf-v5-c-modal-box " : "" + this.#namesColumn) .contains(name) - .parent() + .parents("tr") .within(() => { cy.get("input").click(); }); diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_roles/AssociatedRolesPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_roles/AssociatedRolesPage.ts index 07622f8155..6a40e0874d 100644 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_roles/AssociatedRolesPage.ts +++ b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_roles/AssociatedRolesPage.ts @@ -21,7 +21,7 @@ export default class AssociatedRolesPage { cy.get(this.#addRoleTable) .contains(roleName) - .parent() + .parents("tr") .within(() => { cy.get("input").click(); }); @@ -49,7 +49,7 @@ export default class AssociatedRolesPage { cy.get(this.#addRoleTable) .contains(roleName) - .parent() + .parents("tr") .within(() => { cy.get("input").click(); }); @@ -67,7 +67,7 @@ export default class AssociatedRolesPage { cy.get(this.#addRoleTable) .contains(roleName) - .parent() + .parents("tr") .within(() => { cy.get("input").click(); }); diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/UserRegistration.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/UserRegistration.ts index 00909a07d6..d3297ea25a 100644 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/UserRegistration.ts +++ b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/UserRegistration.ts @@ -40,7 +40,7 @@ export default class UserRegistration { selectRow(name: string) { cy.get(this.#namesColumn) .contains(name) - .parent() + .parents("tr") .within(() => { cy.get("input").click(); }); diff --git a/js/apps/admin-ui/src/components/role-mapping/AddRoleMappingModal.tsx b/js/apps/admin-ui/src/components/role-mapping/AddRoleMappingModal.tsx index 54c58ab098..4239ae2f30 100644 --- a/js/apps/admin-ui/src/components/role-mapping/AddRoleMappingModal.tsx +++ b/js/apps/admin-ui/src/components/role-mapping/AddRoleMappingModal.tsx @@ -1,3 +1,8 @@ +import RoleRepresentation from "@keycloak/keycloak-admin-client/lib/defs/roleRepresentation"; +import { + KeycloakDataTable, + ListEmptyState, +} from "@keycloak/keycloak-ui-shared"; import { Button, Dropdown, @@ -9,14 +14,13 @@ import { ToolbarItem, } from "@patternfly/react-core"; import { FilterIcon } from "@patternfly/react-icons"; +import { cellWidth, TableText } from "@patternfly/react-table"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import { useAdminClient } from "../../admin-client"; import { useAccess } from "../../context/access/Access"; import { translationFormatter } from "../../utils/translationFormatter"; import useLocaleSort from "../../utils/useLocaleSort"; -import { ListEmptyState } from "@keycloak/keycloak-ui-shared"; -import { KeycloakDataTable } from "@keycloak/keycloak-ui-shared"; import { ResourcesKey, Row, ServiceRole } from "./RoleMapping"; import { getAvailableRoles } from "./queries"; import { getAvailableClientRoles } from "./resource"; @@ -33,6 +37,15 @@ type AddRoleMappingModalProps = { type FilterType = "roles" | "clients"; +const RoleDescription = ({ role }: { role: RoleRepresentation }) => { + const { t } = useTranslation(); + return ( + + {translationFormatter(t)(role.description) as string} + + ); +}; + export const AddRoleMappingModal = ({ id, name, @@ -184,11 +197,12 @@ export const AddRoleMappingModal = ({ { name: "name", cellRenderer: ServiceRole, + transforms: [cellWidth(20)], }, { name: "role.description", displayKey: "description", - cellFormatters: [translationFormatter(t)], + cellRenderer: RoleDescription, }, ]} emptyState={