From 91b110dcb26ab53eb942eece030a24020b111cc5 Mon Sep 17 00:00:00 2001 From: Sidney Alcantara Date: Wed, 20 Jul 2022 15:19:00 +1000 Subject: [PATCH 1/4] fix NavDrawer causing compile to fail --- src/layouts/Navigation/NavDrawer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/Navigation/NavDrawer.tsx b/src/layouts/Navigation/NavDrawer.tsx index cabc1c66..f68cdfdf 100644 --- a/src/layouts/Navigation/NavDrawer.tsx +++ b/src/layouts/Navigation/NavDrawer.tsx @@ -232,7 +232,7 @@ export default function NavDrawer({ {...({ component: "button" } as any)} style={{ textAlign: "left" }} sx={{ mb: 1 }} - onClick={(e) => { + onClick={(e: any) => { if (closeDrawer) closeDrawer(e); openTableSettingsDialog({}); }} From a50360214f4fa797e5fa736011247ee103e6acb7 Mon Sep 17 00:00:00 2001 From: shamsmosowi Date: Mon, 25 Jul 2022 20:51:15 +0200 Subject: [PATCH 2/4] show text field if collections array is empy --- src/components/TableSettingsDialog/TableSettingsDialog.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/TableSettingsDialog/TableSettingsDialog.tsx b/src/components/TableSettingsDialog/TableSettingsDialog.tsx index 3850e30e..7d48121c 100644 --- a/src/components/TableSettingsDialog/TableSettingsDialog.tsx +++ b/src/components/TableSettingsDialog/TableSettingsDialog.tsx @@ -232,7 +232,9 @@ export default function TableSettingsDialog() { })), ["section", "label"] ), - Array.isArray(collections) ? collections.filter((x) => x !== CONFIG) : null + Array.isArray(collections) && collections.length !== 0 + ? collections.filter((x) => x !== CONFIG) + : null ); return ( From b64c6c49098e52cf34ed08b81284ba25a01fcc16 Mon Sep 17 00:00:00 2001 From: shamsmosowi Date: Tue, 26 Jul 2022 16:24:23 +0200 Subject: [PATCH 3/4] column ids --- src/components/ColumnMenu/ColumnMenu.tsx | 22 +++++++++++++++---- src/components/ColumnMenu/MenuContents.tsx | 2 ++ .../Table/ColumnHeader/ColumnHeader.tsx | 2 ++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/components/ColumnMenu/ColumnMenu.tsx b/src/components/ColumnMenu/ColumnMenu.tsx index 1bfde791..2408acd6 100644 --- a/src/components/ColumnMenu/ColumnMenu.tsx +++ b/src/components/ColumnMenu/ColumnMenu.tsx @@ -124,8 +124,9 @@ export default function ColumnMenu() { }; const localViewActions: IMenuContentsProps["menuItems"] = [ - { type: "subheader" }, + { type: "subheader", key: "subLocalView" }, { + key: "sortDesc", label: "Sort: descending", activeLabel: "Remove sort: descending", icon: , @@ -139,6 +140,7 @@ export default function ColumnMenu() { disabled: column.type === FieldType.id, }, { + key: "sortAsc", label: "Sort: ascending", activeLabel: "Remove sort: ascending", icon: , @@ -152,6 +154,7 @@ export default function ColumnMenu() { disabled: column.type === FieldType.id, }, { + key: "hide", label: "Hide", icon: , onClick: () => { @@ -168,6 +171,7 @@ export default function ColumnMenu() { disabled: !updateUserSettings, }, { + key: "filter", label: "Filter…", icon: , onClick: () => { @@ -187,9 +191,10 @@ export default function ColumnMenu() { ]; const configActions: IMenuContentsProps["menuItems"] = [ - { type: "subheader" }, + { type: "subheader", key: "subActionsConfig" }, { label: "Lock", + key: "lock", activeLabel: "Unlock", icon: , activeIcon: , @@ -204,6 +209,7 @@ export default function ColumnMenu() { }, { label: "Disable resize", + key: "disableResize", activeLabel: "Enable resize", icon: , onClick: () => { @@ -217,6 +223,7 @@ export default function ColumnMenu() { }, { label: "Freeze", + key: "freeze", activeLabel: "Unfreeze", icon: , activeIcon: , @@ -229,6 +236,7 @@ export default function ColumnMenu() { // { type: "subheader" }, { label: "Rename…", + key: "rename", icon: , onClick: () => { openColumnModal({ type: "name", columnKey: column.key }); @@ -237,6 +245,7 @@ export default function ColumnMenu() { }, { label: `Edit type: ${getFieldProp("name", column.type)}…`, + key: "editType", // This is based on the cell type icon: getFieldProp("icon", column.type), onClick: () => { @@ -246,6 +255,7 @@ export default function ColumnMenu() { }, { label: `Column config…`, + key: "columConfig", icon: , onClick: () => { openColumnModal({ type: "config", columnKey: column.key }); @@ -299,8 +309,9 @@ export default function ColumnMenu() { } }; const derivativeActions: IMenuContentsProps["menuItems"] = [ - { type: "subheader" }, + { type: "subheader", key: "sub-derivative" }, { + key: "evaluateAll", label: altPress ? "Evaluate all" : "Evaluate all…", icon: , onClick: altPress @@ -323,9 +334,10 @@ export default function ColumnMenu() { ]; const columnActions: IMenuContentsProps["menuItems"] = [ - { type: "subheader" }, + { type: "subheader", key: "subActions" }, { label: "Insert to the left…", + key: "insertLeft", icon: , onClick: () => { openColumnModal({ type: "new", index: column.index - 1 }); @@ -334,6 +346,7 @@ export default function ColumnMenu() { }, { label: "Insert to the right…", + key: "insertRight", icon: , onClick: () => { openColumnModal({ type: "new", index: column.index + 1 }); @@ -342,6 +355,7 @@ export default function ColumnMenu() { }, { label: `Delete column${altPress ? "" : "…"}`, + key: "delete", icon: , onClick: altPress ? handleDeleteColumn diff --git a/src/components/ColumnMenu/MenuContents.tsx b/src/components/ColumnMenu/MenuContents.tsx index d442b77d..c14754f0 100644 --- a/src/components/ColumnMenu/MenuContents.tsx +++ b/src/components/ColumnMenu/MenuContents.tsx @@ -4,6 +4,7 @@ import { MenuItem, ListItemIcon, ListSubheader, Divider } from "@mui/material"; export interface IMenuContentsProps { menuItems: { + key: string; type?: string; label?: string; activeLabel?: string; @@ -36,6 +37,7 @@ export default function MenuContents({ menuItems }: IMenuContentsProps) { return ( { dragRef(ref); dropRef(ref); @@ -213,6 +214,7 @@ export default function DraggableHeaderRenderer({ Date: Fri, 29 Jul 2022 00:44:37 +0200 Subject: [PATCH 4/4] row ID --- src/components/Table/TableRow.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Table/TableRow.tsx b/src/components/Table/TableRow.tsx index 0ecd229a..ca19ee77 100644 --- a/src/components/Table/TableRow.tsx +++ b/src/components/Table/TableRow.tsx @@ -24,6 +24,7 @@ export default function TableRow(props: RowRendererProps) { return (