From 463ee9afc6e03c04fdbb138bf29b57341ae6aa94 Mon Sep 17 00:00:00 2001 From: Ian Bolton Date: Tue, 26 Mar 2024 10:17:07 -0400 Subject: [PATCH] PR suggestions --- .../applications-table/applications-table.tsx | 2 ++ .../components/manage-columns-modal.tsx | 4 +-- .../components/manage-columns-toolbar.tsx | 34 ++++++++++--------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/client/src/app/pages/applications/applications-table/applications-table.tsx b/client/src/app/pages/applications/applications-table/applications-table.tsx index 6116c3b3f4..720f0daf5c 100644 --- a/client/src/app/pages/applications/applications-table/applications-table.tsx +++ b/client/src/app/pages/applications/applications-table/applications-table.tsx @@ -805,6 +805,8 @@ export const ApplicationsTable: React.FC = () => { + + {dropdownItems.length ? ( { - showModal: boolean; onClose(): void; columns: ColumnState[]; setColumns: (newColumns: ColumnState[]) => void; @@ -29,7 +28,6 @@ export interface ManagedColumnsProps { } export const ManageColumnsModal = ({ - showModal, description = "Selected columns will be displayed in the table.", onClose, columns, @@ -59,7 +57,7 @@ export const ManageColumnsModal = ({ return ( diff --git a/client/src/app/pages/applications/applications-table/components/manage-columns-toolbar.tsx b/client/src/app/pages/applications/applications-table/components/manage-columns-toolbar.tsx index 8403a44b0f..91d4f5a726 100644 --- a/client/src/app/pages/applications/applications-table/components/manage-columns-toolbar.tsx +++ b/client/src/app/pages/applications/applications-table/components/manage-columns-toolbar.tsx @@ -9,8 +9,8 @@ import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { ColumnState } from "@app/hooks/table-controls/column/useColumnState"; import { ManageColumnsModal } from "./manage-columns-modal"; +import { ColumnsIcon } from "@patternfly/react-icons"; -// Define props to accept columns and setColumns directly interface ManageColumnsToolbarProps { columns: ColumnState[]; setColumns: (newColumns: ColumnState[]) => void; @@ -24,28 +24,30 @@ export const ManageColumnsToolbar = ({ const [isOpen, setIsOpen] = useState(false); return ( <> - + - + - - setIsOpen(false)} - description={t("Selected columns will be displayed in the table.")} - setColumns={setColumns} - columns={columns} - saveLabel={t("Save")} - cancelLabel={t("Cancel")} - title={t("Manage Columns")} - /> + {isOpen && ( + setIsOpen(false)} + description={t("Selected columns will be displayed in the table.")} + setColumns={setColumns} + columns={columns} + saveLabel={t("Save")} + cancelLabel={t("Cancel")} + title={t("Manage Columns")} + /> + )} ); };