Removed unused column

fixes: #1758
This commit is contained in:
Erik Jan de Wit 2022-04-29 09:03:39 +02:00 committed by Jon Koops
parent 566f9a46ff
commit a15eb11d81
3 changed files with 22 additions and 27 deletions

View file

@ -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",

View file

@ -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,27 +41,24 @@ export const mapRoles = (
assignedRoles: Row[],
effectiveRoles: Row[],
hide: boolean
) => {
return [
...(hide
? assignedRoles.map((row) => ({
...row,
role: {
...row.role,
isInherited: false,
},
}))
: effectiveRoles.map((row) => ({
...row,
role: {
...row.role,
isInherited:
assignedRoles.find((r) => r.role.id === row.role.id) ===
undefined,
},
}))),
];
};
) => [
...(hide
? assignedRoles.map((row) => ({
...row,
role: {
...row.role,
isInherited: false,
},
}))
: effectiveRoles.map((row) => ({
...row,
role: {
...row.role,
isInherited:
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"),

View file

@ -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();