diff --git a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/BoundaryWithDate.js b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/BoundaryWithDate.js index 83a84c4a3ef..8e26b99452d 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/BoundaryWithDate.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/BoundaryWithDate.js @@ -28,7 +28,7 @@ const BoundaryWithDate = ({ project, props, onSelect, dateReducerDispatch, canDe }, [project]); const handleDateChange = ({ date, endDate = false, cycleDate = false, cycleIndex }) => { - if (typeof date === "undefined") { + if (typeof date === "undefined" || date <= today) { return null; } if (!endDate) { @@ -47,7 +47,7 @@ const BoundaryWithDate = ({ project, props, onSelect, dateReducerDispatch, canDe }; const handleCycleDateChange = ({ date, endDate = false, cycleIndex }) => { - if (typeof date === "undefined") { + if (typeof date === "undefined" || date <= today) { return null; } if (!endDate) { @@ -169,7 +169,13 @@ const BoundaryWithDate = ({ project, props, onSelect, dateReducerDispatch, canDe withoutLabel={true} type="date" value={item?.endDate} - nonEditable={item?.endDate?.length > 0 && today >= item?.endDate && today >= cycleDates?.[index + 1]?.startDate ? true : false} + nonEditable={ + item?.endDate?.length > 0 && + today >= item?.endDate && + (cycleDates?.[index + 1] ? today >= cycleDates?.[index + 1]?.startDate : true) + ? true + : false + } placeholder={t("HCM_END_DATE")} populators={{ validation: { diff --git a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/configs/UICustomizations.js b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/configs/UICustomizations.js index 881d767a315..3cbc7824f75 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/configs/UICustomizations.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/configs/UICustomizations.js @@ -1,4 +1,4 @@ -import { Link, useHistory } from "react-router-dom"; +import { Link } from "react-router-dom"; import _ from "lodash"; import React from "react"; import { Fragment } from "react"; @@ -118,8 +118,8 @@ export const UICustomizations = { "", `/${window.contextPath}/employee/campaign/update-dates-boundary?id=${row?.id}` ); - window.location.href = `/${window.contextPath}/employee/campaign/update-dates-boundary?id=${row?.id}`; - + const navEvent = new PopStateEvent("popstate"); + window.dispatchEvent(navEvent); break; case "ACTION_LABEL_VIEW_TIMELINE": setTimeline(true); @@ -393,8 +393,8 @@ export const UICustomizations = { "", `/${window.contextPath}/employee/campaign/update-dates-boundary?id=${row?.id}` ); - window.location.href = `/${window.contextPath}/employee/campaign/update-dates-boundary?id=${row?.id}`; - + const navEvent = new PopStateEvent("popstate"); + window.dispatchEvent(navEvent); break; case "ACTION_LABEL_VIEW_TIMELINE": setTimeline(true); diff --git a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/DateAndCycleUpdate.js b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/DateAndCycleUpdate.js index 093e201d774..cdca043f048 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/DateAndCycleUpdate.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/DateAndCycleUpdate.js @@ -160,7 +160,7 @@ const DateAndCycleUpdate = ({ onSelect, formData, ...props }) => { }; const handleCycleDateChange = ({ date, endDate = false, cycleIndex }) => { - if (typeof date === "undefined") { + if (typeof date === "undefined" || date <= today) { return null; } if (!endDate) { @@ -278,7 +278,14 @@ const DateAndCycleUpdate = ({ onSelect, formData, ...props }) => { withoutLabel={true} type="date" value={item?.endDate} - nonEditable={item?.endDate && item?.endDate?.length > 0 && today >= item?.endDate ? true : false} + nonEditable={ + item?.endDate && + item?.endDate?.length > 0 && + today >= item?.endDate && + (cycleDates?.[index + 1] ? today >= cycleDates?.[index + 1]?.startDate : true) + ? true + : false + } placeholder={t("HCM_END_DATE")} populators={{ validation: { diff --git a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateDatesWithBoundaries.js b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateDatesWithBoundaries.js index 07a67e84f4d..11a685e698c 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateDatesWithBoundaries.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateDatesWithBoundaries.js @@ -3,7 +3,7 @@ import React, { useState, useEffect } from "react"; import { useTranslation } from "react-i18next"; import { useHistory, useLocation } from "react-router-dom"; import { dateChangeBoundaryConfig, dateChangeConfig } from "../../configs/dateChangeBoundaryConfig"; -import { Button, PopUp, Toast } from "@egovernments/digit-ui-components"; +import { Button, InfoCard, PopUp, Toast } from "@egovernments/digit-ui-components"; function UpdateDatesWithBoundaries() { const { t } = useTranslation(); @@ -152,6 +152,17 @@ function UpdateDatesWithBoundaries() { actionClassName={"dateUpdateAction"} noCardStyle={true} /> + {t(`UPDATE_DATE_CHANGE_INFO_TEXT`)}]} + label={"Info"} + headerClassName={"headerClassName"} + /> {showPopUp && (