parent
566f9a46ff
commit
a15eb11d81
3 changed files with 22 additions and 27 deletions
|
@ -96,6 +96,7 @@
|
|||
"deleteGrantsSuccess": "Grants successfully revoked.",
|
||||
"deleteGrantsError": "Error deleting grants.",
|
||||
"roleMapping": "Role mapping",
|
||||
"roleMappingUpdatedSuccess": "User role mapping successfully updated",
|
||||
"noRoles": "No roles for this user",
|
||||
"noRolesInstructions": "You haven't assigned any roles to this user. Assign a role to get started.",
|
||||
"unlockAllUsers": "Unlock all users",
|
||||
|
|
|
@ -8,6 +8,7 @@ import {
|
|||
Checkbox,
|
||||
ToolbarItem,
|
||||
} from "@patternfly/react-core";
|
||||
import { cellWidth } from "@patternfly/react-table";
|
||||
|
||||
import type ClientRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientRepresentation";
|
||||
import type RoleRepresentation from "@keycloak/keycloak-admin-client/lib/defs/roleRepresentation";
|
||||
|
@ -40,8 +41,7 @@ export const mapRoles = (
|
|||
assignedRoles: Row[],
|
||||
effectiveRoles: Row[],
|
||||
hide: boolean
|
||||
) => {
|
||||
return [
|
||||
) => [
|
||||
...(hide
|
||||
? assignedRoles.map((row) => ({
|
||||
...row,
|
||||
|
@ -55,12 +55,10 @@ export const mapRoles = (
|
|||
role: {
|
||||
...row.role,
|
||||
isInherited:
|
||||
assignedRoles.find((r) => r.role.id === row.role.id) ===
|
||||
undefined,
|
||||
assignedRoles.find((r) => r.role.id === row.role.id) === undefined,
|
||||
},
|
||||
}))),
|
||||
];
|
||||
};
|
||||
];
|
||||
|
||||
export const ServiceRole = ({ role, client }: Row) => (
|
||||
<>
|
||||
|
@ -287,13 +285,9 @@ export const RoleMapping = ({
|
|||
{
|
||||
name: "role.name",
|
||||
displayKey: t("common:name"),
|
||||
transforms: [cellWidth(30)],
|
||||
cellRenderer: ServiceRole,
|
||||
},
|
||||
{
|
||||
name: "role.parent.name",
|
||||
displayKey: t("common:inherentFrom"),
|
||||
cellFormatters: [emptyFormatter()],
|
||||
},
|
||||
{
|
||||
name: "role.description",
|
||||
displayKey: t("common:description"),
|
||||
|
|
|
@ -17,7 +17,7 @@ type UserRoleMappingProps = {
|
|||
};
|
||||
|
||||
export const UserRoleMapping = ({ id, name }: UserRoleMappingProps) => {
|
||||
const { t } = useTranslation("clients");
|
||||
const { t } = useTranslation("users");
|
||||
const adminClient = useAdminClient();
|
||||
const { addAlert, addError } = useAlerts();
|
||||
|
||||
|
|
Loading…
Reference in a new issue