From e1fb26062ed1a0a7e39bdcbda8081c5257bc3f78 Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Fri, 22 Mar 2024 20:52:25 +0530 Subject: [PATCH] Removes support for exporting All Patients (#7457) --- src/Components/Common/Export.tsx | 19 +++++++++++++++++++ src/Components/Patient/ManagePatients.tsx | 10 +--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/Components/Common/Export.tsx b/src/Components/Common/Export.tsx index 7ddaca115bd..6714d8bdb08 100644 --- a/src/Components/Common/Export.tsx +++ b/src/Components/Common/Export.tsx @@ -39,6 +39,25 @@ export const ExportMenu = ({ }: ExportMenuProps) => { const { isExporting, exportFile } = useExport(); + if (exportItems.length === 1) { + const item = exportItems[0]; + + return ( + + exportFile(item.action, item.filePrefix, item.type, item.parse) + } + border + ghost + className="py-2.5" + > + + {isExporting ? "Exporting..." : label} + + ); + } + return (
{ disabled={!isExportAllowed} exportItems={[ { - label: - tabValue === 0 - ? "Live patients" - : "Discharged patients", + label: "Export Live patients", action: exportPatients(true), parse: preventDuplicatePatientsDuetoPolicyId, }, - { - label: "All patients", - action: exportPatients(false), - parse: preventDuplicatePatientsDuetoPolicyId, - }, ]} /> )}