diff --git a/src/components/Permissions/PermissionsTable.tsx b/src/components/Permissions/PermissionsTable.tsx index d3a3adbbc..b83eb3d2d 100644 --- a/src/components/Permissions/PermissionsTable.tsx +++ b/src/components/Permissions/PermissionsTable.tsx @@ -11,6 +11,7 @@ import PlaybookSpecIcon from "../Playbooks/Settings/PlaybookSpecIcon"; import { TopologyLink } from "../Topology/TopologyLink"; import { permissionObjectList } from "./ManagePermissions/Forms/FormikPermissionSelectResourceFields"; import { permissionsActionsList } from "./PermissionsView"; +import { BsBan } from "react-icons/bs"; const permissionsTableColumns: MRT_ColumnDef[] = [ { @@ -90,8 +91,15 @@ const permissionsTableColumns: MRT_ColumnDef[] = [ return (
- {actionLabel ?? action} - {deny && } + + {actionLabel ?? action} + {deny && ( + + )} +
); } diff --git a/src/components/Permissions/PermissionsView.tsx b/src/components/Permissions/PermissionsView.tsx index a26769fdb..c0f32e0d0 100644 --- a/src/components/Permissions/PermissionsView.tsx +++ b/src/components/Permissions/PermissionsView.tsx @@ -21,8 +21,8 @@ export const permissionsActionsList: FormikSelectDropdownOption[] = [ { value: "ActionDelete", label: "delete" }, { value: "ActionAll", label: "*" }, { value: "ActionCRUD", label: "create,read,update,delete" }, - { value: "ActionRun", label: "run" }, - { value: "ActionApprove", label: "approve" } + { value: "ActionRun", label: "playbook:run" }, + { value: "ActionApprove", label: "playbook:approve" } ]; type PermissionsViewProps = { diff --git a/src/ui/MRTDataTable/MRTDataTable.tsx b/src/ui/MRTDataTable/MRTDataTable.tsx index 2d3c451b9..4f8840290 100644 --- a/src/ui/MRTDataTable/MRTDataTable.tsx +++ b/src/ui/MRTDataTable/MRTDataTable.tsx @@ -7,17 +7,13 @@ import { MRT_ColumnDef, MRT_Row, MRT_TableInstance, - useMantineReactTable + useMantineReactTable, + MantineReactTable, + MRT_TableOptions } from "mantine-react-table"; -import dynamic from "next/dynamic"; import useReactTablePaginationState from "../DataTable/Hooks/useReactTablePaginationState"; import useReactTableSortState from "../DataTable/Hooks/useReactTableSortState"; -const MantineReactTable = dynamic( - () => import("mantine-react-table").then((mod) => mod.MantineReactTable), - { ssr: false } -); - type MRTDataTableProps = {}> = { data: T[]; columns: MRT_ColumnDef[]; @@ -50,7 +46,7 @@ export default function MRTDataTable = {}>({ onRowClick = () => {}, isLoading = false, disablePagination = false, - enableServerSideSorting = undefined, + enableServerSideSorting = false, enableServerSidePagination = false, enableGrouping = false, manualPageCount, @@ -65,7 +61,7 @@ export default function MRTDataTable = {}>({ const { pageIndex, pageSize, setPageIndex } = useReactTablePaginationState(); const [sortState, setSortState] = useReactTableSortState(); - const table = useMantineReactTable({ + const options = { data: data, columns: columns, enableGlobalFilter: false, @@ -74,6 +70,7 @@ export default function MRTDataTable = {}>({ enableSelectAll: false, enableFullScreenToggle: false, layoutMode: "grid", + enableTopToolbar: false, enableColumnResizing: true, enableStickyHeader: true, enableTableFooter: true, @@ -108,7 +105,7 @@ export default function MRTDataTable = {}>({ } }), enablePagination: !disablePagination, - enableExpandAll: true, + enableExpandAll: enableGrouping, mantineTableContainerProps: { sx: { flex: "1 1 0" @@ -133,9 +130,11 @@ export default function MRTDataTable = {}>({ return acc; }, {}) }, - initialState: { - expanded: expandAllRows ? true : undefined - }, + initialState: expandAllRows + ? { + expanded: true + } + : undefined, mantinePaginationProps: { rowsPerPageOptions: ["50", "100", "200"] }, @@ -145,8 +144,11 @@ export default function MRTDataTable = {}>({ mantineExpandAllButtonProps: { size: "xs" }, + renderDetailPanel - }); + } as MRT_TableOptions; + + const table = useMantineReactTable(options); // @ts-expect-error return ;