From 6f6f6998a21a875a0c369d67d1606b78ca51b4f0 Mon Sep 17 00:00:00 2001 From: Bhavya-egov <137176879+Bhavya-egov@users.noreply.github.com> Date: Tue, 4 Jun 2024 17:49:57 +0530 Subject: [PATCH] HLM-6179 and HLM-6180 (#777) * HLM-6179 and HLM-6180 * campaign name changes --------- Co-authored-by: Jagankumar <53823168+jagankumar-egov@users.noreply.github.com> --- .../micro-ui-internals/example/package.json | 2 +- .../example/public/index.html | 3 +- micro-ui/web/micro-ui-internals/package.json | 2 +- .../css/src/pages/employee/campaign.scss | 13 +++ .../css/src/pages/employee/coreOverride.scss | 4 +- .../modules/campaign-manager/package.json | 2 +- .../src/components/CampaignName.js | 3 +- .../src/components/UploadData.js | 84 +++++++++++++++++-- .../src/configs/CampaignConfig.js | 1 + .../src/pages/employee/CycleConfiguration.js | 53 +++++++++--- .../employee/deliveryRule/MultiTabcontext.js | 23 +++++ micro-ui/web/package.json | 2 +- micro-ui/web/public/index.html | 2 +- micro-ui/web/workbench/inter-package.json | 2 +- micro-ui/web/workbench/package.json | 2 +- 15 files changed, 169 insertions(+), 29 deletions(-) diff --git a/micro-ui/web/micro-ui-internals/example/package.json b/micro-ui/web/micro-ui-internals/example/package.json index ba58752485b..bd9b20cc131 100644 --- a/micro-ui/web/micro-ui-internals/example/package.json +++ b/micro-ui/web/micro-ui-internals/example/package.json @@ -12,7 +12,7 @@ "@egovernments/digit-ui-libraries": "1.8.1-beta.4", "@egovernments/digit-ui-module-core": "1.8.1-beta.23", "@egovernments/digit-ui-module-utilities": "1.0.1-beta.2", - "@egovernments/digit-ui-components": "0.0.1-beta.31", + "@egovernments/digit-ui-components": "0.0.2-beta.1", "@egovernments/digit-ui-react-components": "1.8.1-beta.25", "@egovernments/digit-ui-module-workbench": "1.0.1-beta.16", "@egovernments/digit-ui-module-hcmworkbench":"0.0.38", diff --git a/micro-ui/web/micro-ui-internals/example/public/index.html b/micro-ui/web/micro-ui-internals/example/public/index.html index 0759293c9d4..962c9f2d22a 100644 --- a/micro-ui/web/micro-ui-internals/example/public/index.html +++ b/micro-ui/web/micro-ui-internals/example/public/index.html @@ -15,10 +15,9 @@ href="https://unpkg.com/@egovernments/digit-ui-css@1.8.0-alpha.6/dist/index.css" /> --> - + - diff --git a/micro-ui/web/micro-ui-internals/package.json b/micro-ui/web/micro-ui-internals/package.json index 2187e4917a9..ee6875d6938 100644 --- a/micro-ui/web/micro-ui-internals/package.json +++ b/micro-ui/web/micro-ui-internals/package.json @@ -46,7 +46,7 @@ "lodash": "4.17.21", "microbundle-crl": "0.13.11", "@egovernments/digit-ui-react-components": "1.8.1-beta.25", - "@egovernments/digit-ui-components": "0.0.1-beta.31", + "@egovernments/digit-ui-components": "0.0.2-beta.1", "react": "17.0.2", "react-dom": "17.0.2", "react-hook-form": "6.15.8", diff --git a/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/campaign.scss b/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/campaign.scss index ff5cdb24093..53f08c3b869 100644 --- a/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/campaign.scss +++ b/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/campaign.scss @@ -77,3 +77,16 @@ gap: 0.5rem; margin-bottom: 0.5rem; } +.infoClass{ + margin-bottom: 1.5rem +} +.headerWrapperClassName{ + display: none +} +.popup-close-svg{ + display: none; +} +.whoLogo{ + margin-top: -1rem; + margin-bottom: -1rem; +} \ No newline at end of file diff --git a/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/coreOverride.scss b/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/coreOverride.scss index 448357784b2..eb495402d81 100644 --- a/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/coreOverride.scss +++ b/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/coreOverride.scss @@ -136,7 +136,7 @@ header { } -.digit-popup-wrap { +/*.digit-popup-wrap { background: rgba(0, 0, 0, 0.7); @apply flex fixed w-full h-full overflow-auto top-0 left-0 min-h-screen; z-index: 10000; @@ -153,4 +153,4 @@ header { .digit-popup-close-icon { @apply flex justify-end; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/package.json b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/package.json index 2f4fe8dea72..da44daed98e 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/package.json +++ b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/package.json @@ -19,7 +19,7 @@ }, "dependencies": { "@egovernments/digit-ui-react-components": "1.8.1-beta.25", - "@egovernments/digit-ui-components": "0.0.1-beta.31", + "@egovernments/digit-ui-components": "0.0.2-beta.1", "@rjsf/core": "5.10.0", "@rjsf/utils": "5.10.0", "@rjsf/validator-ajv8": "5.10.0", diff --git a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignName.js b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignName.js index 59bae87777a..040406ab0d8 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignName.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignName.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from "react"; +import React, { useState, useEffect ,Fragment} from "react"; import { Header } from "@egovernments/digit-ui-react-components"; import { useTranslation } from "react-i18next"; import { LabelFieldPair } from "@egovernments/digit-ui-react-components"; @@ -51,6 +51,7 @@ const CampaignName = ({ onSelect, formData, control, formState, ...props }) => { error={error?.message ? t(error?.message) : ""} style={{ width: "40rem", marginBottom: "0" }} populators={{ name: "campaignName" }} + placeholder={"HCM_CAMPAIGN_NAME_EXAMPLE"} value={name} onChange={(event) => { setStartValidation(true); diff --git a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/UploadData.js b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/UploadData.js index c78d98166d5..2c7e4c34c9b 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/UploadData.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/UploadData.js @@ -1,11 +1,11 @@ -import { Button, Header, LoaderWithGap } from "@egovernments/digit-ui-react-components"; +import { Header, LoaderWithGap } from "@egovernments/digit-ui-react-components"; import React, { useRef, useState, useEffect, Fragment } from "react"; import { useTranslation } from "react-i18next"; -import { DownloadIcon, Card } from "@egovernments/digit-ui-react-components"; +import { DownloadIcon, Card, Modal, CardText } from "@egovernments/digit-ui-react-components"; import BulkUpload from "./BulkUpload"; import Ajv from "ajv"; import XLSX from "xlsx"; -import { InfoCard, Toast } from "@egovernments/digit-ui-components"; +import { InfoCard, PopUp, Toast ,Button } from "@egovernments/digit-ui-components"; import { schemaConfig } from "../configs/schemaConfig"; import { headerConfig } from "../configs/headerConfig"; import { PRIMARY_COLOR } from "../utils"; @@ -50,8 +50,8 @@ const UploadData = ({ formData, onSelect, ...props }) => { const [translatedSchema, setTranslatedSchema] = useState({}); const [readMeInfo, setReadMeInfo] = useState({}); const [enabled, setEnabled] = useState(false); + const [showPopUp, setShowPopUp] = useState(true); const currentKey = searchParams.get("key"); - useEffect(() => { if (type === "facilityWithBoundary") { @@ -172,6 +172,7 @@ const UploadData = ({ formData, onSelect, ...props }) => { setDownloadError(false); setIsError(false); setIsSuccess(props?.props?.sessionData?.HCM_CAMPAIGN_UPLOAD_BOUNDARY_DATA?.uploadBoundary?.isSuccess || null); + setShowPopUp(!props?.props?.sessionData?.HCM_CAMPAIGN_UPLOAD_BOUNDARY_DATA?.uploadBoundary?.uploadedFile.length); break; case "facilityWithBoundary": setUploadedFile(props?.props?.sessionData?.HCM_CAMPAIGN_UPLOAD_FACILITY_DATA?.uploadFacility?.uploadedFile || []); @@ -180,6 +181,7 @@ const UploadData = ({ formData, onSelect, ...props }) => { setDownloadError(false); setIsError(false); setIsSuccess(props?.props?.sessionData?.HCM_CAMPAIGN_UPLOAD_FACILITY_DATA?.uploadFacility?.isSuccess || null); + setShowPopUp(!props?.props?.sessionData?.HCM_CAMPAIGN_UPLOAD_FACILITY_DATA?.uploadFacility?.uploadedFile.length); break; default: setUploadedFile(props?.props?.sessionData?.HCM_CAMPAIGN_UPLOAD_USER_DATA?.uploadUser?.uploadedFile || []); @@ -188,6 +190,7 @@ const UploadData = ({ formData, onSelect, ...props }) => { setDownloadError(false); setIsError(false); setIsSuccess(props?.props?.sessionData?.HCM_CAMPAIGN_UPLOAD_USER_DATA?.uploadUser?.isSuccess || null); + setShowPopUp(!props?.props?.sessionData?.HCM_CAMPAIGN_UPLOAD_USER_DATA?.uploadUser?.uploadedFile.length); break; } }, [type, props?.props?.sessionData]); @@ -540,6 +543,7 @@ const UploadData = ({ formData, onSelect, ...props }) => { setIsSuccess(false); setIsValidation(false); setApiError(null); + setErrorsType({}); // setShowToast(null); }; @@ -553,7 +557,7 @@ const UploadData = ({ formData, onSelect, ...props }) => { useEffect(() => { const fetchData = async () => { if (!errorsType[type] && uploadedFile?.length > 0) { - setShowToast({ key: "info", label: t("HCM_VALIDATION_IN_PROGRESS") }); + // setShowToast({ key: "info", label: t("HCM_VALIDATION_IN_PROGRESS") }); setIsValidation(true); setIsError(true); @@ -870,6 +874,76 @@ const UploadData = ({ formData, onSelect, ...props }) => { ))} label={"Info"} /> + {showPopUp && ( + // {type === "boundary" ? t("ES_CAMPAIGN_UPLOAD_BOUNDARY_DATA_MODAL_HEADER") : type === "facilityWithBoundary" ? t("ES_CAMPAIGN_UPLOAD_FACILITY_DATA_MODAL_HEADER") : t("ES_CAMPAIGN_UPLOAD_USER_DATA_MODAL_HEADER")}} + + // // {type === "boundary" ? t("ES_CAMPAIGN_UPLOAD_BOUNDARY_DATA_MODAL_HEADER") : type === "facilityWithBoundary" ? t("ES_CAMPAIGN_UPLOAD_FACILITY_DATA_MODAL_HEADER") : t("ES_CAMPAIGN_UPLOAD_USER_DATA_MODAL_HEADER")} + // actionCancelLabel={t("HCM_CAMPAIGN_UPLOAD_CANCEL")} + // actionCancelOnSubmit={() => { setShowPopUp(false); }} + // actionSaveLabel={t("HCM_CAMPAIGN_DOWNLOAD_TEMPLATE")} + // actionSaveOnSubmit={() =>{downloadTemplate() ,setShowPopUp(false); }} + // customTheme="v-campaign" + // formId="modal-action" + // > + //
+ // {type === "boundary" ? t("ES_CAMPAIGN_UPLOAD_BOUNDARY_DATA_MODAL_HEADER") : type === "facilityWithBoundary" ? t("ES_CAMPAIGN_UPLOAD_FACILITY_DATA_MODAL_HEADER") : t("ES_CAMPAIGN_UPLOAD_USER_DATA_MODAL_HEADER")} + //
+ //
+ + + {type === "boundary" + ? t("ES_CAMPAIGN_UPLOAD_BOUNDARY_DATA_MODAL_TEXT") + : type === "facilityWithBoundary" + ? t("ES_CAMPAIGN_UPLOAD_FACILITY_DATA_MODAL_TEXT") + : t("ES_CAMPAIGN_UPLOAD_USER_DATA_MODAL_TEXT ")} + , + ]} + onOverlayClick={() => { + setShowPopUp(false); + }} + + footerChildren={[ +