From f2b62c0384ccbff2dad8fd216f326cec945b64f1 Mon Sep 17 00:00:00 2001 From: Swathi-eGov Date: Mon, 28 Oct 2024 12:40:55 +0530 Subject: [PATCH 1/2] updated facilitypopup --- .../example/public/index.html | 2 +- .../packages/css/package.json | 2 +- .../css/src/pages/employee/facility.scss | 16 ++ .../microplan/src/components/FacilityPopup.js | 231 ++++++++++-------- .../src/components/SearchJurisdiction.js | 8 +- health/micro-ui/web/public/index.html | 2 +- 6 files changed, 157 insertions(+), 104 deletions(-) diff --git a/health/micro-ui/web/micro-ui-internals/example/public/index.html b/health/micro-ui/web/micro-ui-internals/example/public/index.html index 7e924de1d0f..220580a25d5 100644 --- a/health/micro-ui/web/micro-ui-internals/example/public/index.html +++ b/health/micro-ui/web/micro-ui-internals/example/public/index.html @@ -16,7 +16,7 @@ /> --> - + diff --git a/health/micro-ui/web/micro-ui-internals/packages/css/package.json b/health/micro-ui/web/micro-ui-internals/packages/css/package.json index 0f01ed3cfe0..cbd6c6c7173 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/css/package.json +++ b/health/micro-ui/web/micro-ui-internals/packages/css/package.json @@ -1,6 +1,6 @@ { "name": "@egovernments/digit-ui-health-css", - "version": "0.1.10", + "version": "0.1.11", "license": "MIT", "main": "dist/index.css", "author": "Jagankumar ", 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..4522c20d827 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")} - +