Skip to content

Commit

Permalink
Removes support for exporting all patients
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Mar 21, 2024
1 parent 1ced42e commit 6b384e8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
19 changes: 19 additions & 0 deletions src/Components/Common/Export.tsx
Expand Up @@ -39,6 +39,25 @@ export const ExportMenu = ({
}: ExportMenuProps) => {
const { isExporting, exportFile } = useExport();

if (exportItems.length === 1) {
const item = exportItems[0];

return (
<ButtonV2
disabled={isExporting || disabled}
onClick={() =>
exportFile(item.action, item.filePrefix, item.type, item.parse)
}
border
ghost
className="py-2.5"
>
<CareIcon className="care-l-export" />
{isExporting ? "Exporting..." : label}
</ButtonV2>
);
}

return (
<div key="export-menu" id="export-button">
<DropdownMenu
Expand Down
10 changes: 1 addition & 9 deletions src/Components/Patient/ManagePatients.tsx
Expand Up @@ -831,18 +831,10 @@ export const PatientManager = () => {
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,
},
]}
/>
)}
Expand Down

0 comments on commit 6b384e8

Please sign in to comment.