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