From 0a9577eb4a05a911e6f82a47325e8d8b595247b2 Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Thu, 20 Oct 2022 16:28:08 -0500 Subject: [PATCH] Fix modal processes when selecting all records --- src/qqq/pages/entity-list/index.tsx | 16 +++++++++++++++- src/qqq/pages/process-run/ReportRun.tsx | 5 ----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/qqq/pages/entity-list/index.tsx b/src/qqq/pages/entity-list/index.tsx index 05a41db..54206bd 100644 --- a/src/qqq/pages/entity-list/index.tsx +++ b/src/qqq/pages/entity-list/index.tsx @@ -235,6 +235,7 @@ function EntityList({table, launchProcess}: Props): JSX.Element const [activeModalProcess, setActiveModalProcess] = useState(null as QProcessMetaData); const [launchingProcess, setLaunchingProcess] = useState(launchProcess); + const [recordIdsForProcess, setRecordIdsForProcess] = useState(null as string | QQueryFilter) const instance = useRef({timer: null}); @@ -893,6 +894,19 @@ function EntityList({table, launchProcess}: Props): JSX.Element const openModalProcess = (process: QProcessMetaData = null) => { + if (selectFullFilterState === "filter") + { + setRecordIdsForProcess(buildQFilter(filterModel)); + } + else if (selectedIds.length > 0) + { + setRecordIdsForProcess(selectedIds.join(",")); + } + else + { + setRecordIdsForProcess(""); + } + navigate(`${process.name}${getRecordsQueryString()}`); closeActionsMenu(); }; @@ -1255,7 +1269,7 @@ function EntityList({table, launchProcess}: Props): JSX.Element activeModalProcess && closeModalProcess(event, reason)}>
- +
} diff --git a/src/qqq/pages/process-run/ReportRun.tsx b/src/qqq/pages/process-run/ReportRun.tsx index 0ba0a8d..aef8194 100644 --- a/src/qqq/pages/process-run/ReportRun.tsx +++ b/src/qqq/pages/process-run/ReportRun.tsx @@ -33,8 +33,6 @@ interface Props function ReportRun({report}: Props): JSX.Element { - // const reportNameParam = useParams().reportName; - // const processName = process === null ? processNameParam : process.name; const [metaData, setMetaData] = useState(null as QInstance); const {pageHeader, setPageHeader} = useContext(QContext); @@ -53,10 +51,7 @@ function ReportRun({report}: Props): JSX.Element if (metaData) { setPageHeader(report.label); - - console.log(`Report Process name is ${report.processName}`); const process = metaData.processes.get(report.processName); - console.log(`Process is ${process.name}`); const defaultProcessValues = {reportName: report.name}; return (); }