From 62c13adda77148a8d5384474f5229a8938d80259 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Wed, 9 Mar 2022 17:44:43 +0100 Subject: [PATCH] Fixed title and link to page (#2183) --- .../authorization/PermissionDetails.tsx | 7 +++- src/clients/authorization/Resources.tsx | 34 +++++++++++-------- src/clients/authorization/Scopes.tsx | 32 ++++++++++------- src/clients/help.ts | 2 ++ 4 files changed, 46 insertions(+), 29 deletions(-) diff --git a/src/clients/authorization/PermissionDetails.tsx b/src/clients/authorization/PermissionDetails.tsx index 21e12d3a14..c175b2d363 100644 --- a/src/clients/authorization/PermissionDetails.tsx +++ b/src/clients/authorization/PermissionDetails.tsx @@ -32,6 +32,7 @@ import { HelpItem } from "../../components/help-enabler/HelpItem"; import { ResourcesPolicySelect } from "./ResourcesPolicySelect"; import { toAuthorizationTab } from "../routes/AuthenticationTab"; import { ScopeSelect } from "./ScopeSelect"; +import { toUpperCase } from "../../util"; const DECISION_STRATEGIES = ["UNANIMOUS", "AFFIRMATIVE", "CONSENSUS"] as const; @@ -166,7 +167,11 @@ export default function PermissionDetails() { <> { const { t } = useTranslation("clients"); - const history = useHistory(); const adminClient = useAdminClient(); const { addAlert, addError } = useAlerts(); const { realm } = useRealm(); @@ -173,6 +172,7 @@ export const AuthorizationResources = ({ clientId }: ResourcesProps) => { {t("owner")} {t("uris")} + {resources.map((resource, rowIndex) => ( @@ -208,6 +208,23 @@ export const AuthorizationResources = ({ clientId }: ResourcesProps) => { + + + { toggleDeleteDialog(); }, }, - { - title: t("createPermission"), - className: "pf-m-link", - isOutsideDropdown: true, - onClick: () => - history.push( - toNewPermission({ - realm, - id: clientId, - permissionType: "resource", - }) - ), - }, ], }} /> diff --git a/src/clients/authorization/Scopes.tsx b/src/clients/authorization/Scopes.tsx index 909cb909b5..2fde08f96f 100644 --- a/src/clients/authorization/Scopes.tsx +++ b/src/clients/authorization/Scopes.tsx @@ -161,6 +161,7 @@ export const AuthorizationScopes = ({ clientId }: ScopesProps) => { {t("resources")} {t("permissions")} + {scopes.map((scope, rowIndex) => ( @@ -197,7 +198,25 @@ export const AuthorizationScopes = ({ clientId }: ScopesProps) => { + + + { toggleDeleteDialog(); }, }, - { - title: t("createPermission"), - className: "pf-m-link", - isOutsideDropdown: true, - onClick: () => - history.push( - toNewPermission({ - realm, - id: clientId, - permissionType: "resource", - }) - ), - }, ], }} /> diff --git a/src/clients/help.ts b/src/clients/help.ts index 79f919edc7..4a6f45f011 100644 --- a/src/clients/help.ts +++ b/src/clients/help.ts @@ -283,6 +283,8 @@ export default { "Specifies that this permission must be applied to a specific resource instance.", permissionScopes: "Specifies that this permission must be applied to one or more scopes.", + permissionPolicies: + "Specifies all the policies that must be applied to the scopes defined by this policy or permission.", permissionType: "Specifies that this permission must be applied to all resources instances of a given type.", permissionDecisionStrategy: