From 2760c50ee4a467f1e72fc5c0998719d527075f11 Mon Sep 17 00:00:00 2001 From: Bhavya-egov <137176879+Bhavya-egov@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:03:01 +0530 Subject: [PATCH] fixed targetvalidation and added no results in boundary (#1768) --- .../modules/campaign-manager/src/Module.js | 4 +- .../src/components/CampaignUpdateSummary.js | 77 +++++++++++-------- .../src/components/NoResultsFound.js | 29 +++++++ .../src/components/UploadData.js | 2 + 4 files changed, 81 insertions(+), 31 deletions(-) create mode 100644 health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/NoResultsFound.js diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/Module.js b/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/Module.js index 0caf3513f18..1131214bd27 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/Module.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/Module.js @@ -54,6 +54,7 @@ import ViewBoundary from "./pages/employee/ViewBoundary"; import ViewHierarchy from "./pages/employee/ViewHierarchy"; import MultiSelectDropdown from "./components/MultiSelectDropdown"; import MapView from "./components/MapView"; +import NoResultsFound from "./components/NoResultsFound"; /** * MDMS Module name @@ -156,7 +157,8 @@ const componentsToRegister = { ViewBoundary, ViewHierarchy, BoundarySummary, - MapView + MapView, + NoResultsFound }; const overrideHooks = () => { diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignUpdateSummary.js b/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignUpdateSummary.js index 00fa9e2ff19..aee5defb135 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignUpdateSummary.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignUpdateSummary.js @@ -6,6 +6,7 @@ import { InfoBannerIcon, Toast } from "@egovernments/digit-ui-components"; import { DownloadIcon } from "@egovernments/digit-ui-react-components"; import { PRIMARY_COLOR, downloadExcelWithCustomName } from "../utils"; import getProjectServiceUrl from "../utils/getProjectServiceUrl"; +import NoResultsFound from "./NoResultsFound"; function boundaryDataGrp(boundaryData) { // Create an empty object to hold grouped data by type @@ -177,39 +178,55 @@ const CampaignUpdateSummary = (props) => { const target = data?.[0]?.deliveryRules; const boundaryData = boundaryDataGrp(data?.[0]?.boundaries); const hierarchyType = data?.[0]?.hierarchyType; + return { cards: [ - ...boundaryData?.map((item, index) => { - return { - navigationKey: "card1", - name: `HIERARCHY_${index + 1}`, - sections: [ - { + ...( + boundaryData.length > 0 + ? boundaryData.map((item, index) => ({ + navigationKey: "card1", name: `HIERARCHY_${index + 1}`, - type: "COMPONENT", - // cardHeader: { value: `${t(( hierarchyType + "_" + item?.type).toUpperCase())}`, inlineStyles: { color: "#0B4B66" } }, - cardHeader: { - value: hierarchyType - ? `${t((hierarchyType + "_" + item?.type).toUpperCase())}` - : t("To Be Updated"), - inlineStyles: { color: "#0B4B66" } - }, - - component: "BoundaryDetailsSummary", - cardSecondaryAction: noAction !== "false" && ( -