Skip to content

Commit c2aea9b

Browse files
committed
chore: add tooltip for Groups column header
1 parent 25767c6 commit c2aea9b

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

site/build/tsconfig.tsbuildinfo

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import {
2+
HelpTooltip,
3+
HelpTooltipLink,
4+
HelpTooltipLinksGroup,
5+
HelpTooltipText,
6+
HelpTooltipTitle,
7+
} from "components/HelpTooltip/HelpTooltip";
8+
import { docs } from "utils/docs";
9+
10+
export const Language = {
11+
title: "What is a group?",
12+
link: "User Groups",
13+
text:
14+
"Groups can be used with template RBAC to give groups of users access " +
15+
"to specific templates. View our docs on how to use groups.",
16+
};
17+
18+
export function GroupsHelpTooltip() {
19+
return (
20+
<HelpTooltip size="small">
21+
<HelpTooltipTitle>{Language.title}</HelpTooltipTitle>
22+
<HelpTooltipText>{Language.text}</HelpTooltipText>
23+
24+
<HelpTooltipLinksGroup>
25+
<HelpTooltipLink href={docs("/admin/groups")}>
26+
{Language.link}
27+
</HelpTooltipLink>
28+
</HelpTooltipLinksGroup>
29+
</HelpTooltip>
30+
);
31+
}

site/src/pages/UsersPage/UsersTable/UsersTable.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import TableRow from "@mui/material/TableRow";
1111
import { Stack } from "components/Stack/Stack";
1212
import { UserRoleHelpTooltip } from "./UserRoleHelpTooltip";
1313
import { UsersTableBody } from "./UsersTableBody";
14+
import { GroupsHelpTooltip } from "./GroupsHelpTooltip";
1415

1516
export const Language = {
1617
usernameLabel: "User",
@@ -79,7 +80,13 @@ export const UsersTable: FC<React.PropsWithChildren<UsersTableProps>> = ({
7980
</Stack>
8081
</TableCell>
8182

82-
<TableCell width="14%">{Language.groupsLabel}</TableCell>
83+
<TableCell width="14%">
84+
<Stack direction="row" spacing={1} alignItems="center">
85+
<span>{Language.groupsLabel}</span>
86+
<GroupsHelpTooltip />
87+
</Stack>
88+
</TableCell>
89+
8390
<TableCell width="14%">{Language.loginTypeLabel}</TableCell>
8491
<TableCell width="14%">{Language.statusLabel}</TableCell>
8592

0 commit comments

Comments
 (0)