Added help text on role mapping (#4340)

This commit is contained in:
Erik Jan de Wit 2023-02-07 12:31:20 +01:00 committed by GitHub
parent df49a82033
commit df03f6845c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -14,5 +14,6 @@
"protocolMapper": "Protocol...", "protocolMapper": "Protocol...",
"mapperName": "Name of the mapper", "mapperName": "Name of the mapper",
"role": "Role name you want changed. Click 'Select Role' button to browse roles, or just type it in the textbox. To reference an application role the syntax is appname.approle, i.e. myapp.myrole", "role": "Role name you want changed. Click 'Select Role' button to browse roles, or just type it in the textbox. To reference an application role the syntax is appname.approle, i.e. myapp.myrole",
"newRoleName": "The new role name. The new name format corresponds to where in the access token the role will be mapped to. So, a new name of 'myapp.newname' will map the role to that position in the access token. A new name of 'newname' will map the role to the realm roles in the token." "newRoleName": "The new role name. The new name format corresponds to where in the access token the role will be mapped to. So, a new name of 'myapp.newname' will map the role to that position in the access token. A new name of 'newname' will map the role to the realm roles in the token.",
"rolesScope": "If there is no role scope mapping defined, each user is permitted to use this client scope. If there are role scope mappings defined, the user must be a member of at least one of the roles."
} }

View file

@ -3,6 +3,7 @@ import type ProtocolMapperRepresentation from "@keycloak/keycloak-admin-client/l
import type { RoleMappingPayload } from "@keycloak/keycloak-admin-client/lib/defs/roleRepresentation"; import type { RoleMappingPayload } from "@keycloak/keycloak-admin-client/lib/defs/roleRepresentation";
import type { ProtocolMapperTypeRepresentation } from "@keycloak/keycloak-admin-client/lib/defs/serverInfoRepesentation"; import type { ProtocolMapperTypeRepresentation } from "@keycloak/keycloak-admin-client/lib/defs/serverInfoRepesentation";
import { import {
Alert,
AlertVariant, AlertVariant,
ButtonVariant, ButtonVariant,
DropdownItem, DropdownItem,
@ -22,6 +23,7 @@ import {
ClientScopeDefaultOptionalType, ClientScopeDefaultOptionalType,
} from "../components/client-scope/ClientScopeTypes"; } from "../components/client-scope/ClientScopeTypes";
import { useConfirmDialog } from "../components/confirm-dialog/ConfirmDialog"; import { useConfirmDialog } from "../components/confirm-dialog/ConfirmDialog";
import { useHelp } from "../components/help-enabler/HelpHeader";
import { KeycloakSpinner } from "../components/keycloak-spinner/KeycloakSpinner"; import { KeycloakSpinner } from "../components/keycloak-spinner/KeycloakSpinner";
import { RoleMapping, Row } from "../components/role-mapping/RoleMapping"; import { RoleMapping, Row } from "../components/role-mapping/RoleMapping";
import { import {
@ -49,6 +51,7 @@ export default function EditClientScope() {
const { adminClient } = useAdminClient(); const { adminClient } = useAdminClient();
const { id } = useParams<ClientScopeParams>(); const { id } = useParams<ClientScopeParams>();
const { addAlert, addError } = useAlerts(); const { addAlert, addError } = useAlerts();
const { enabled } = useHelp();
const [clientScope, setClientScope] = const [clientScope, setClientScope] =
useState<ClientScopeDefaultOptionalType>(); useState<ClientScopeDefaultOptionalType>();
const [key, setKey] = useState(0); const [key, setKey] = useState(0);
@ -262,6 +265,15 @@ export default function EditClientScope() {
title={<TabTitleText>{t("scope")}</TabTitleText>} title={<TabTitleText>{t("scope")}</TabTitleText>}
{...scopeTab} {...scopeTab}
> >
{enabled && (
<PageSection>
<Alert
variant="info"
isInline
title={t("client-scopes-help:rolesScope")}
/>
</PageSection>
)}
<RoleMapping <RoleMapping
id={clientScope.id!} id={clientScope.id!}
name={clientScope.name!} name={clientScope.name!}