Skip to content

refactor(site): minor improvements on users page popovers #10492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
refactor(site): minor improvements on users page popovers
  • Loading branch information
BrunoQuaresma committed Nov 2, 2023
commit cfda7a71539fee8e8b1e65d0d71d0f7b662c5524
19 changes: 18 additions & 1 deletion site/src/pages/UsersPage/UsersTable/UserGroupsCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
PopoverTrigger,
PopoverContent,
} from "components/Popover/Popover";
import { css } from "@emotion/css";

type GroupsCellProps = {
userGroups: readonly Group[] | undefined;
Expand Down Expand Up @@ -68,7 +69,23 @@ export function UserGroupsCell({ userGroups }: GroupsCellProps) {
</Button>
</PopoverTrigger>

<PopoverContent disableScrollLock disableRestoreFocus>
<PopoverContent
disableScrollLock
disableRestoreFocus
css={(theme) => ({
".MuiPaper-root": {
minWidth: "auto",
},
})}
anchorOrigin={{
vertical: "top",
horizontal: "center",
}}
transformOrigin={{
vertical: "bottom",
horizontal: "center",
}}
>
<OverflowY maxHeight={400}>
<List
component="ul"
Expand Down
9 changes: 9 additions & 0 deletions site/src/pages/UsersPage/UsersTable/UserRoleCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,17 @@ function OverflowRolePill({ roles }: OverflowRolePillProps) {
rowGap: theme.spacing(1.5),
padding: theme.spacing(1.5, 2),
alignContent: "space-around",
minWidth: "auto",
},
}}
anchorOrigin={{
vertical: -4,
horizontal: "center",
}}
transformOrigin={{
vertical: "bottom",
horizontal: "center",
}}
>
{roles.map((role) => (
<Pill
Expand Down