Skip to content

feat: add resource-action pills to custom roles table #14354

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 11 commits into from
Sep 3, 2024
Prev Previous commit
chore: cleanup
  • Loading branch information
jaaydenh committed Sep 3, 2024
commit 1b10a76f0a4c2b366087af984e5ce0ca7d6b6657
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type Interpolation, type Theme, useTheme } from "@emotion/react";
import Stack from "@mui/material/Stack";
import type { Permission, Role } from "api/typesGenerated";
import type { Permission } from "api/typesGenerated";
import { Pill } from "components/Pill/Pill";
import {
Popover,
Expand All @@ -21,7 +21,7 @@ interface PermissionPillsListProps {
export const PermissionPillsList: FC<PermissionPillsListProps> = ({
permissions,
}) => {
const resourceTypes: string[] = getUniqueResourceTypes(permissions);
const resourceTypes = getUniqueResourceTypes(permissions);

return (
<Stack direction="row" spacing={1}>
Expand Down Expand Up @@ -53,11 +53,9 @@ const PermissionsPill: FC<PermissionPillProps> = ({
resource,
permissions,
}) => {
const actions = permissions.filter((p) => {
if (resource === p.resource_type) {
return p.action;
}
});
const actions = permissions.filter(
(p) => resource === p.resource_type && p.action,
);

return (
<Pill css={styles.permissionPill}>
Expand Down
Loading