diff --git a/health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/facility.scss b/health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/facility.scss index 9c8b271bf65..e74d203e885 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/facility.scss +++ b/health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/facility.scss @@ -1,3 +1,19 @@ .facility-popup{ max-width: 85% !important; +} + +.facilitypopup-serach-results-wrapper{ + display: flex; + flex-direction: column; + gap: 1.5rem; +} + +.facility-popup-table-card{ + border: 1px solid #d6d5d4; +} + +.facilitypopup-tab-serach-wrapper{ + display: flex; + flex-direction: column; + justify-content: flex-start; } \ No newline at end of file diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FacilityPopup.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FacilityPopup.js index 3089751059a..35f4f1a678a 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FacilityPopup.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FacilityPopup.js @@ -1,11 +1,12 @@ import React, { useState, Fragment, useEffect } from "react"; import { useTranslation } from "react-i18next"; -import { PopUp, Button, Tab, CheckBox, Card, Toast } from "@egovernments/digit-ui-components"; +import { PopUp, Button, Tab, CheckBox, Card, Toast,SVG } from "@egovernments/digit-ui-components"; import SearchJurisdiction from "./SearchJurisdiction"; import { LoaderWithGap, Loader } from "@egovernments/digit-ui-react-components"; import DataTable from "react-data-table-component"; import AccessibilityPopUp from "./accessbilityPopUP"; import SecurityPopUp from "./securityPopUp"; +import { tableCustomStyle } from "./tableCustomStyle"; const FacilityPopUp = ({ details, onClose }) => { const { t } = useTranslation(); @@ -183,24 +184,12 @@ const FacilityPopUp = ({ details, onClose }) => { } }, [isLoadingPlanEmployee, isLoadingCampaign]); - const handleRowSelect = (row) => { - const isSelected = selectedRows.includes(row.id); - const newSelectedRows = isSelected - ? selectedRows.filter((id) => id !== row.id) - : [...selectedRows, row.id]; - + const handleRowSelect = (event) => { + // Extract the IDs of all selected rows + const newSelectedRows = event.selectedRows.map(row => row.id); + // Update the state with the list of selected IDs setSelectedRows(newSelectedRows); - setIsAllSelected(newSelectedRows.length === censusData.length); - }; - - const handleSelectAll = () => { - if (isAllSelected) { - setSelectedRows([]); - } else { - const allRowIds = censusData.map((row) => row.id); - setSelectedRows(allRowIds); - } - setIsAllSelected(!isAllSelected); + setIsAllSelected(event.allSelected); }; const handleViewDetailsForAccessibility = (row) => { @@ -216,25 +205,6 @@ const FacilityPopUp = ({ details, onClose }) => { }; const columns = [ - { - name: ( - - ), - cell: (row) => ( - handleRowSelect(row)} - checked={selectedRows.includes(row.id)} - label="" - /> - ), - sortable: false, - allowOverflow: true, - width: "6rem" - }, { name: t("MP_FACILITY_VILLAGE"), // Change to your column name selector: (row) => row.boundaryCode, // Replace with the appropriate field from your data @@ -243,24 +213,14 @@ const FacilityPopUp = ({ details, onClose }) => { { name: t("MP_VILLAGE_ACCESSIBILITY_LEVEL"), // Change to your column type cell: (row) => ( - handleViewDetailsForAccessibility(row)} - > - {t("VIEW_DETAILS")} - +