From 03ee5016e151547dfeb1a0fa9e92568c1352000e Mon Sep 17 00:00:00 2001 From: Jacob John Jeevan Date: Mon, 13 Jan 2025 17:42:22 +0530 Subject: [PATCH] disable facility type filter if location is not selected --- public/locale/en.json | 1 + src/pages/Facility/FacilitiesPage.tsx | 6 ++++++ src/pages/Organization/components/OrganizationFilter.tsx | 9 ++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/public/locale/en.json b/public/locale/en.json index 8cbbf6d15b0..e90dbd1ea7f 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -1770,6 +1770,7 @@ "select_investigation_groups": "Select Investigation Groups", "select_investigations": "Select Investigations", "select_local_body": "Select Local Body", + "select_location_first": "Select Location First", "select_method": "Select method", "select_new_role": "Select New Role", "select_patient": "Select Patient", diff --git a/src/pages/Facility/FacilitiesPage.tsx b/src/pages/Facility/FacilitiesPage.tsx index 8f978c46a15..402e5549ad8 100644 --- a/src/pages/Facility/FacilitiesPage.tsx +++ b/src/pages/Facility/FacilitiesPage.tsx @@ -115,6 +115,12 @@ export function FacilitiesPage() {
{isLoading ? ( + ) : !qParams.organization ? ( + +
+ {t("select_location_first")} +
+
) : !facilitiesResponse?.results.length ? (
diff --git a/src/pages/Organization/components/OrganizationFilter.tsx b/src/pages/Organization/components/OrganizationFilter.tsx index 258fd17431a..0cfa5182929 100644 --- a/src/pages/Organization/components/OrganizationFilter.tsx +++ b/src/pages/Organization/components/OrganizationFilter.tsx @@ -132,9 +132,16 @@ export default function OrganizationFilter(props: OrganizationFilterProps) { ?.id, }); }} + disabled={selected.length === 0} > - + {FACILITY_TYPES.map((type) => (