From 365ec0965a21d8b9c6de28f62b6026f06a5cac44 Mon Sep 17 00:00:00 2001 From: shevijacobson Date: Mon, 4 Nov 2024 12:35:25 +0200 Subject: [PATCH] change download modal Signed-off-by: shevijacobson --- .../applications-table/applications-table.tsx | 56 +++++++++++-------- 1 file changed, 32 insertions(+), 24 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 b856d2301..16b5aa3b9 100644 --- a/client/src/app/pages/applications/applications-table/applications-table.tsx +++ b/client/src/app/pages/applications/applications-table/applications-table.tsx @@ -16,10 +16,11 @@ import { DropdownItem, Modal, Tooltip, - FormGroup, + FormSelect, + FormSelectOption, + TextContent, } from "@patternfly/react-core"; import { - CodeIcon, PencilAltIcon, TagIcon, WarningTriangleIcon, @@ -157,7 +158,7 @@ export const ApplicationsTable: React.FC = () => { const [isDownloadModalOpen, setIsDownloadModalOpen] = useState(false); - const [selectedFormat, setSelectedFormat] = useState<"json" | "yaml">("json"); + const [selectedFormat, setSelectedFormat] = useState("json"); const [assessmentToEdit, setAssessmentToEdit] = useState( null @@ -178,6 +179,16 @@ export const ApplicationsTable: React.FC = () => { const [endOfAppImportPeriod, setEndOfAppImportPeriod] = useState( dayjs() ); + const onChange = ( + _event: React.FormEvent, + value: string + ) => { + setSelectedFormat(value); + }; + const formats = [ + { value: "json", label: "JSON", disabled: false }, + { value: "yaml", label: "YAML", disabled: false }, + ]; const [ saveApplicationsCredentialsModalState, @@ -1365,31 +1376,28 @@ export const ApplicationsTable: React.FC = () => { /> setIsDownloadModalOpen(false)} > - -
- - -
-

Selected Format: {selectedFormat}

-
- + {"Select format"} + + + {formats.map((option, index) => ( + + ))} +
);