From 988d44d18f8061422fc7f971b23c096ea24d56bd Mon Sep 17 00:00:00 2001 From: Star Richardson <67430892+alicenstar@users.noreply.github.com> Date: Thu, 19 Oct 2023 17:38:42 -0600 Subject: [PATCH] wip: add test data for dev, start adding edit and delete buttons --- web/src/Root.tsx | 32 +++++++++---------- .../apps/HelmVMClusterManagement.tsx | 13 +++++++- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/web/src/Root.tsx b/web/src/Root.tsx index 54e86f9a31..794b0f8eff 100644 --- a/web/src/Root.tsx +++ b/web/src/Root.tsx @@ -592,22 +592,22 @@ const Root = () => { /> )} - {(state.adminConsoleMetadata?.isKurl || - state.adminConsoleMetadata?.isHelmVM) && ( - - ) : ( - - ) - } - /> - )} - {state.adminConsoleMetadata?.isHelmVM && ( - } /> - )} + {/* {(state.adminConsoleMetadata?.isKurl || + state.adminConsoleMetadata?.isHelmVM) && ( */} + + ) : ( + + ) + } + /> + {/* )} + {state.adminConsoleMetadata?.isHelmVM && ( */} + } /> + {/* )} */} } diff --git a/web/src/components/apps/HelmVMClusterManagement.tsx b/web/src/components/apps/HelmVMClusterManagement.tsx index 3c80ae1ef9..75e0ea6786 100644 --- a/web/src/components/apps/HelmVMClusterManagement.tsx +++ b/web/src/components/apps/HelmVMClusterManagement.tsx @@ -1,3 +1,4 @@ +import { MenuItem } from "@mui/material"; import { useQuery } from "@tanstack/react-query"; import classNames from "classnames"; import MaterialReactTable, { MRT_ColumnDef } from "material-react-table"; @@ -231,6 +232,7 @@ const HelmVMClusterManagement = ({ }; // #endregion + // #region table logic type NodeColumns = { name: string | JSX.Element; roles: JSX.Element; @@ -370,7 +372,7 @@ const HelmVMClusterManagement = ({ columns={columns} data={mappedNodes} state={{ - columnPinning: { left: ["name"] }, + columnPinning: { left: ["mrt-row-actions", "name"] }, }} enableColumnResizing enableColumnActions={false} @@ -404,6 +406,15 @@ const HelmVMClusterManagement = ({ initialState={{ density: "compact" }} enablePagination={false} enableColumnFilters={false} + enableRowActions + renderRowActionMenuItems={({ row }) => [ + console.info("Edit")}> + Edit + , + console.info("Delete")}> + Delete + , + ]} /> )}