Fixed title and link to page (#2183)
This commit is contained in:
parent
4e697600e0
commit
62c13adda7
4 changed files with 46 additions and 29 deletions
|
@ -32,6 +32,7 @@ import { HelpItem } from "../../components/help-enabler/HelpItem";
|
||||||
import { ResourcesPolicySelect } from "./ResourcesPolicySelect";
|
import { ResourcesPolicySelect } from "./ResourcesPolicySelect";
|
||||||
import { toAuthorizationTab } from "../routes/AuthenticationTab";
|
import { toAuthorizationTab } from "../routes/AuthenticationTab";
|
||||||
import { ScopeSelect } from "./ScopeSelect";
|
import { ScopeSelect } from "./ScopeSelect";
|
||||||
|
import { toUpperCase } from "../../util";
|
||||||
|
|
||||||
const DECISION_STRATEGIES = ["UNANIMOUS", "AFFIRMATIVE", "CONSENSUS"] as const;
|
const DECISION_STRATEGIES = ["UNANIMOUS", "AFFIRMATIVE", "CONSENSUS"] as const;
|
||||||
|
|
||||||
|
@ -166,7 +167,11 @@ export default function PermissionDetails() {
|
||||||
<>
|
<>
|
||||||
<DeleteConfirm />
|
<DeleteConfirm />
|
||||||
<ViewHeader
|
<ViewHeader
|
||||||
titleKey={permissionId ? permission?.name! : "clients:createPermission"}
|
titleKey={
|
||||||
|
permissionId
|
||||||
|
? permission?.name!
|
||||||
|
: `clients:create${toUpperCase(permissionType)}BasedPermission`
|
||||||
|
}
|
||||||
dropdownItems={
|
dropdownItems={
|
||||||
permissionId
|
permissionId
|
||||||
? [
|
? [
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { Link, useHistory } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import {
|
import {
|
||||||
Alert,
|
Alert,
|
||||||
|
@ -42,7 +42,6 @@ type ExpandableResourceRepresentation = ResourceRepresentation & {
|
||||||
|
|
||||||
export const AuthorizationResources = ({ clientId }: ResourcesProps) => {
|
export const AuthorizationResources = ({ clientId }: ResourcesProps) => {
|
||||||
const { t } = useTranslation("clients");
|
const { t } = useTranslation("clients");
|
||||||
const history = useHistory();
|
|
||||||
const adminClient = useAdminClient();
|
const adminClient = useAdminClient();
|
||||||
const { addAlert, addError } = useAlerts();
|
const { addAlert, addError } = useAlerts();
|
||||||
const { realm } = useRealm();
|
const { realm } = useRealm();
|
||||||
|
@ -173,6 +172,7 @@ export const AuthorizationResources = ({ clientId }: ResourcesProps) => {
|
||||||
<Th>{t("owner")}</Th>
|
<Th>{t("owner")}</Th>
|
||||||
<Th>{t("uris")}</Th>
|
<Th>{t("uris")}</Th>
|
||||||
<Th />
|
<Th />
|
||||||
|
<Th />
|
||||||
</Tr>
|
</Tr>
|
||||||
</Thead>
|
</Thead>
|
||||||
{resources.map((resource, rowIndex) => (
|
{resources.map((resource, rowIndex) => (
|
||||||
|
@ -208,6 +208,23 @@ export const AuthorizationResources = ({ clientId }: ResourcesProps) => {
|
||||||
<Td>
|
<Td>
|
||||||
<UriRenderer row={resource} />
|
<UriRenderer row={resource} />
|
||||||
</Td>
|
</Td>
|
||||||
|
<Td width={10}>
|
||||||
|
<Button
|
||||||
|
variant="link"
|
||||||
|
component={(props) => (
|
||||||
|
<Link
|
||||||
|
{...props}
|
||||||
|
to={toNewPermission({
|
||||||
|
realm,
|
||||||
|
id: clientId,
|
||||||
|
permissionType: "resource",
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{t("createPermission")}
|
||||||
|
</Button>
|
||||||
|
</Td>
|
||||||
<Td
|
<Td
|
||||||
actions={{
|
actions={{
|
||||||
items: [
|
items: [
|
||||||
|
@ -219,19 +236,6 @@ export const AuthorizationResources = ({ clientId }: ResourcesProps) => {
|
||||||
toggleDeleteDialog();
|
toggleDeleteDialog();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: t("createPermission"),
|
|
||||||
className: "pf-m-link",
|
|
||||||
isOutsideDropdown: true,
|
|
||||||
onClick: () =>
|
|
||||||
history.push(
|
|
||||||
toNewPermission({
|
|
||||||
realm,
|
|
||||||
id: clientId,
|
|
||||||
permissionType: "resource",
|
|
||||||
})
|
|
||||||
),
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -161,6 +161,7 @@ export const AuthorizationScopes = ({ clientId }: ScopesProps) => {
|
||||||
<Th>{t("resources")}</Th>
|
<Th>{t("resources")}</Th>
|
||||||
<Th>{t("permissions")}</Th>
|
<Th>{t("permissions")}</Th>
|
||||||
<Th />
|
<Th />
|
||||||
|
<Th />
|
||||||
</Tr>
|
</Tr>
|
||||||
</Thead>
|
</Thead>
|
||||||
{scopes.map((scope, rowIndex) => (
|
{scopes.map((scope, rowIndex) => (
|
||||||
|
@ -197,7 +198,25 @@ export const AuthorizationScopes = ({ clientId }: ScopesProps) => {
|
||||||
<Td>
|
<Td>
|
||||||
<PermissionsRenderer row={scope} />
|
<PermissionsRenderer row={scope} />
|
||||||
</Td>
|
</Td>
|
||||||
|
<Td width={10}>
|
||||||
|
<Button
|
||||||
|
variant="link"
|
||||||
|
component={(props) => (
|
||||||
|
<Link
|
||||||
|
{...props}
|
||||||
|
to={toNewPermission({
|
||||||
|
realm,
|
||||||
|
id: clientId,
|
||||||
|
permissionType: "scope",
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{t("createPermission")}
|
||||||
|
</Button>
|
||||||
|
</Td>
|
||||||
<Td
|
<Td
|
||||||
|
isActionCell
|
||||||
actions={{
|
actions={{
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
|
@ -207,19 +226,6 @@ export const AuthorizationScopes = ({ clientId }: ScopesProps) => {
|
||||||
toggleDeleteDialog();
|
toggleDeleteDialog();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: t("createPermission"),
|
|
||||||
className: "pf-m-link",
|
|
||||||
isOutsideDropdown: true,
|
|
||||||
onClick: () =>
|
|
||||||
history.push(
|
|
||||||
toNewPermission({
|
|
||||||
realm,
|
|
||||||
id: clientId,
|
|
||||||
permissionType: "resource",
|
|
||||||
})
|
|
||||||
),
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -283,6 +283,8 @@ export default {
|
||||||
"Specifies that this permission must be applied to a specific resource instance.",
|
"Specifies that this permission must be applied to a specific resource instance.",
|
||||||
permissionScopes:
|
permissionScopes:
|
||||||
"Specifies that this permission must be applied to one or more scopes.",
|
"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:
|
permissionType:
|
||||||
"Specifies that this permission must be applied to all resources instances of a given type.",
|
"Specifies that this permission must be applied to all resources instances of a given type.",
|
||||||
permissionDecisionStrategy:
|
permissionDecisionStrategy:
|
||||||
|
|
Loading…
Reference in a new issue