From f6ece0cded75aad36b39619933ae028edd180119 Mon Sep 17 00:00:00 2001 From: Paul Bui-Quang Date: Thu, 4 May 2023 16:44:00 +0200 Subject: [PATCH] refactor: remove dispatch any --- .../ControlPanel/ControlPanel.tsx | 10 ++-- .../components/Breadcrumbs/Breadcrumbs.tsx | 4 +- .../LogicalOperator/LogicalOperator.tsx | 22 ++++---- .../components/Form/BiologyForm.tsx | 2 +- .../components/Hierarchy/BiologyHierarchy.tsx | 8 +-- .../CCAM/components/Form/CCAMForm.tsx | 2 +- .../components/Hierarchy/CCAMHierarchy.tsx | 8 +-- .../Cim10Form/components/Form/Cim10Form.tsx | 2 +- .../components/Hierarchy/Cim10Hierarchy.tsx | 8 +-- .../GHM/components/Form/GhmForm.tsx | 2 +- .../GHM/components/Hierarchy/GhmHierarchy.tsx | 8 +-- .../components/Form/MedicationForm.tsx | 2 +- .../Hierarchy/MedicationHierarchy.tsx | 8 +-- .../RequestForm/RequestForm.tsx | 2 +- .../LogicalOperatorItem.tsx | 18 +++--- .../PopulationCard/PopulationCard.tsx | 4 +- .../TemporalConstraintCard.tsx | 4 +- .../TemporalConstraintModal.tsx | 4 +- .../ModalCreateNewRequest.tsx | 18 +++--- src/components/CreationCohort/Requeteur.tsx | 10 ++-- .../ModalAddOrEditProject.tsx | 6 +- .../ModalDeleteRequests.tsx | 2 +- .../ModalEditCohort/ModalEditCohort.tsx | 8 +-- .../ModalMoveRequest/ModalMoveRequest.tsx | 2 +- .../ProjectTable/ProjectRow/ProjectRow.tsx | 6 +- .../ProjectTable/RequestRow/RequestRow.tsx | 4 +- .../ProjectTable/VersionRow/VersionRow.tsx | 4 +- .../Patient/PatientBiology/PatientBiology.tsx | 2 +- .../Patient/PatientDocs/PatientDocs.tsx | 2 +- .../PatientMedication/PatientMedication.tsx | 2 +- .../Patient/PatientPMSI/PatientPMSI.tsx | 2 +- .../PatientTimeline/PatientTimeline.tsx | 2 +- .../Routes/LeftSideBar/LeftSideBar.tsx | 18 +++--- src/components/Routes/PrivateRoute.tsx | 2 +- src/components/SavedResearch/ResearchCard.tsx | 6 +- .../ResearchTable/RequestsTable.tsx | 10 ++-- .../ResearchTable/ResearchTable.tsx | 2 +- src/components/ScopeTree/ScopeTree.tsx | 16 +++--- src/components/TopBar/TopBar.tsx | 8 +-- .../Welcome/ResearchCard/ResearchCard.tsx | 8 +-- src/state/cohortCreation.ts | 24 ++++---- src/state/exploredCohort.ts | 2 +- src/state/request.ts | 2 +- src/utils/pmsi.ts | 55 ++++++++++--------- src/views/Dashboard/Dashboard.tsx | 4 +- src/views/MyProjects/MyProjects.tsx | 24 ++++---- src/views/Patient/Patient.tsx | 2 +- src/views/Welcome/Welcome.tsx | 16 +++--- 48 files changed, 195 insertions(+), 192 deletions(-) diff --git a/src/components/CreationCohort/ControlPanel/ControlPanel.tsx b/src/components/CreationCohort/ControlPanel/ControlPanel.tsx index 4a4bebbb4..38aa6dded 100644 --- a/src/components/CreationCohort/ControlPanel/ControlPanel.tsx +++ b/src/components/CreationCohort/ControlPanel/ControlPanel.tsx @@ -117,15 +117,15 @@ const ControlPanel: React.FC<{ if (logicalOperatorNeedToBeErase && logicalOperatorNeedToBeErase.length > 0) { for (const logicalOperator of logicalOperatorNeedToBeErase) { const { id } = logicalOperator - dispatch(deleteCriteriaGroup(id)) + dispatch(deleteCriteriaGroup(id)) } } - dispatch(buildCohortCreation({})) + dispatch(buildCohortCreation({})) } const _relaunchCount = (keepCount: boolean) => { if (keepCount) setOldCount(count ?? null) - dispatch( + dispatch( countCohortCreation({ json, snapshotId: currentSnapshot, @@ -151,7 +151,7 @@ const ControlPanel: React.FC<{ useEffect(() => { const interval = setInterval(() => { if (count && count.status && (count.status === 'pending' || count.status === 'started')) { - dispatch(countCohortCreation({ uuid: count.uuid })) + dispatch(countCohortCreation({ uuid: count.uuid })) } else { clearInterval(interval) } @@ -198,7 +198,7 @@ const ControlPanel: React.FC<{