add help text for direct membership

This commit is contained in:
jenny-s51 2021-04-22 16:37:10 -04:00
parent 4182f2bd58
commit 5bcfa03747
2 changed files with 25 additions and 2 deletions

View file

@ -1,4 +1,4 @@
import React, { useEffect, useState } from "react"; import React, { useContext, useEffect, useState } from "react";
import { useParams } from "react-router-dom"; import { useParams } from "react-router-dom";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {
@ -7,6 +7,7 @@ import {
ButtonVariant, ButtonVariant,
Checkbox, Checkbox,
PageSection, PageSection,
Popover,
} from "@patternfly/react-core"; } from "@patternfly/react-core";
import { ListEmptyState } from "../components/list-empty-state/ListEmptyState"; import { ListEmptyState } from "../components/list-empty-state/ListEmptyState";
import { KeycloakDataTable } from "../components/table-toolbar/KeycloakDataTable"; import { KeycloakDataTable } from "../components/table-toolbar/KeycloakDataTable";
@ -20,6 +21,8 @@ import { useErrorHandler } from "react-error-boundary";
import _ from "lodash"; import _ from "lodash";
import UserRepresentation from "keycloak-admin/lib/defs/userRepresentation"; import UserRepresentation from "keycloak-admin/lib/defs/userRepresentation";
import { JoinGroupDialog } from "./JoinGroupDialog"; import { JoinGroupDialog } from "./JoinGroupDialog";
import { HelpContext } from "../components/help-enabler/HelpHeader";
import { QuestionCircleIcon } from "@patternfly/react-icons";
type GroupTableData = GroupRepresentation & { type GroupTableData = GroupRepresentation & {
membersLength?: number; membersLength?: number;
@ -55,6 +58,8 @@ export const UserGroups = () => {
>([]); >([]);
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const { enabled } = useContext(HelpContext);
const adminClient = useAdminClient(); const adminClient = useAdminClient();
const { id } = useParams<{ id: string }>(); const { id } = useParams<{ id: string }>();
const alphabetize = (groupsList: GroupRepresentation[]) => { const alphabetize = (groupsList: GroupRepresentation[]) => {
@ -325,6 +330,22 @@ export const UserGroups = () => {
onChange={() => setDirectMembership(!isDirectMembership)} onChange={() => setDirectMembership(!isDirectMembership)}
isChecked={isDirectMembership} isChecked={isDirectMembership}
/> />
{enabled && (
<Popover
aria-label="Basic popover"
position="bottom"
bodyContent={<div>{t("users:whoWillAppearPopoverText")}</div>}
>
<Button
variant="link"
className="kc-who-will-appear-button"
key="who-will-appear-button"
icon={<QuestionCircleIcon />}
>
{t("users:whoWillAppearLinkText")}
</Button>
</Popover>
)}
</> </>
} }
columns={[ columns={[

View file

@ -58,6 +58,8 @@
"updateUserLocale": "Update User Locale", "updateUserLocale": "Update User Locale",
"consents": "Consents", "consents": "Consents",
"noConsents": "No consents", "noConsents": "No consents",
"noConsentsText": "The consents will only be recorded when users try to access a client that is configured to require consent. In that case, users will get a consent page which asks them to grant access to the client." "noConsentsText": "The consents will only be recorded when users try to access a client that is configured to require consent. In that case, users will get a consent page which asks them to grant access to the client.",
"whoWillAppearLinkText": "Who will appear in this group list?",
"whoWillAppearPopoverText": "Groups are hierarchical. When you select Direct Membership, you see only the child group that the user joined. Ancestor groups are not included."
} }
} }