From 291bacc3ec132adb9672fea2b84b12dffb239f4c Mon Sep 17 00:00:00 2001 From: Tyler Ohlsen Date: Mon, 22 Jul 2024 17:26:29 -0700 Subject: [PATCH] Simplify and make text consistent for both edit modals Signed-off-by: Tyler Ohlsen --- .../ingest_inputs/source_data.tsx | 16 ++++++++-------- .../search_inputs/configure_search_request.tsx | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/public/pages/workflow_detail/workflow_inputs/ingest_inputs/source_data.tsx b/public/pages/workflow_detail/workflow_inputs/ingest_inputs/source_data.tsx index ce518f1a..6e5b5b16 100644 --- a/public/pages/workflow_detail/workflow_inputs/ingest_inputs/source_data.tsx +++ b/public/pages/workflow_detail/workflow_inputs/ingest_inputs/source_data.tsx @@ -34,8 +34,8 @@ interface SourceDataProps { export function SourceData(props: SourceDataProps) { const { values, setFieldValue } = useFormikContext(); - // load modal state - const [isLoadModalOpen, setIsLoadModalOpen] = useState(false); + // edit modal state + const [isEditModalOpen, setIsEditModalOpen] = useState(false); // files state. when a file is read, update the form value. const fileReader = new FileReader(); @@ -55,14 +55,14 @@ export function SourceData(props: SourceDataProps) { return ( <> - {isLoadModalOpen && ( + {isEditModalOpen && ( setIsLoadModalOpen(false)} + onClose={() => setIsEditModalOpen(false)} style={{ width: '70vw' }} > -

{`Configure sample JSON documents`}

+

{`Edit source data`}

@@ -96,7 +96,7 @@ export function SourceData(props: SourceDataProps) { setIsLoadModalOpen(false)} + onClick={() => setIsEditModalOpen(false)} fill={false} color="primary" > @@ -116,9 +116,9 @@ export function SourceData(props: SourceDataProps) { fill={false} style={{ width: '100px' }} size="s" - onClick={() => setIsLoadModalOpen(true)} + onClick={() => setIsEditModalOpen(true)} > - Configure + Edit diff --git a/public/pages/workflow_detail/workflow_inputs/search_inputs/configure_search_request.tsx b/public/pages/workflow_detail/workflow_inputs/search_inputs/configure_search_request.tsx index faec31b7..a761f2fa 100644 --- a/public/pages/workflow_detail/workflow_inputs/search_inputs/configure_search_request.tsx +++ b/public/pages/workflow_detail/workflow_inputs/search_inputs/configure_search_request.tsx @@ -51,8 +51,8 @@ export function ConfigureSearchRequest(props: ConfigureSearchRequestProps) { undefined ); - // Query modal state - const [isQueryModalOpen, setIsQueryModalOpen] = useState(false); + // Edit modal state + const [isEditModalOpen, setIsEditModalOpen] = useState(false); // Hook to listen when the query form value changes. // Try to set the query request if possible @@ -72,14 +72,14 @@ export function ConfigureSearchRequest(props: ConfigureSearchRequestProps) { return ( <> - {isQueryModalOpen && ( + {isEditModalOpen && ( setIsQueryModalOpen(false)} + onClose={() => setIsEditModalOpen(false)} style={{ width: '70vw' }} > -

{`Configure query`}

+

{`Edit query`}

@@ -93,7 +93,7 @@ export function ConfigureSearchRequest(props: ConfigureSearchRequestProps) { setIsQueryModalOpen(false)} + onClick={() => setIsEditModalOpen(false)} fill={false} color="primary" > @@ -136,9 +136,9 @@ export function ConfigureSearchRequest(props: ConfigureSearchRequestProps) { fill={false} style={{ width: '100px' }} size="s" - onClick={() => setIsQueryModalOpen(true)} + onClick={() => setIsEditModalOpen(true)} > - Configure + Edit