),
@@ -300,7 +308,8 @@ const CampaignSummary = () => {
type: "DATA",
cardHeader: { value: t("TARGET_DETAILS"), inlineStyles: { marginTop: 0 } },
cardSecondaryAction: (
-
handleRedirect(2)}>
+
handleRedirect(4)}>
+ {t(`CAMPAIGN_EDIT`)}
),
@@ -318,7 +327,12 @@ const CampaignSummary = () => {
{
type: "COMPONENT",
cardHeader: { value: t("DELIVERY_CYCLE_DETAILS"), inlineStyles: { marginTop: 0 } },
- cardSecondaryAction:
,
+ cardSecondaryAction: (
+
handleRedirect(2)}>
+ {t(`CAMPAIGN_EDIT`)}
+
+
+ ),
component: "CycleDetaisPreview",
props: {
DUMMY_DATA: DUMMY_DATA?.[0],
@@ -367,16 +381,8 @@ const CampaignSummary = () => {
return (
<>
- {/*
*/}
-
- {t("ES_TQM_SUMMARY_HEADING")}
-
- {/*
*/}
-
-
- {/* {!isLoading && } */}
-
-
+
{t("ES_TQM_SUMMARY_HEADING")}
+
>
);
};
diff --git a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CycleDetaisPreview.js b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CycleDetaisPreview.js
index 9b64d1ab825..c15cb50031e 100644
--- a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CycleDetaisPreview.js
+++ b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CycleDetaisPreview.js
@@ -99,7 +99,7 @@ const CycleDetaisPreview = ({ data, item, index }) => {
columnsData={[
{
Header: t("Product"),
- accessor: "product",
+ accessor: "value",
},
{
Header: t("Count"),
diff --git a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js
index b7076c1e0a6..b395fcdca07 100644
--- a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js
+++ b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js
@@ -90,8 +90,8 @@ const SetupCampaign = () => {
cycle.deliveries.forEach((delivery, index) => {
delivery.deliveryRules.forEach((rule) => {
const restructuredRule = {
- startDate: Digit.Utils.date.convertDateToEpoch(dateData?.find((i) => i.key === cycle.cycleIndex)?.fromDate), // Hardcoded for now
- endDate: Digit.Utils.date.convertDateToEpoch(dateData?.find((i) => i?.key === cycle?.cycleIndex)?.toDate), // Hardcoded for now
+ startDate: Digit.Utils.date.convertDateToEpoch(dateData?.find((i) => i.key == cycle.cycleIndex)?.fromDate), // Hardcoded for now
+ endDate: Digit.Utils.date.convertDateToEpoch(dateData?.find((i) => i?.key == cycle?.cycleIndex)?.toDate), // Hardcoded for now
cycleNumber: parseInt(cycle.cycleIndex),
deliveryNumber: parseInt(delivery.deliveryIndex),
deliveryRuleNumber: parseInt(rule.ruleKey), // New key added
@@ -107,6 +107,13 @@ const SetupCampaign = () => {
});
});
+ rule.products.forEach((prod) => {
+ restructuredRule.products.push({
+ value: prod?.value,
+ count: prod?.count,
+ });
+ });
+
restructuredData.push(restructuredRule);
});
});
@@ -295,13 +302,12 @@ const SetupCampaign = () => {
const key = Object.keys(formData)?.[0];
switch (key) {
case "campaignName":
- if (typeof formData?.campaignName !== 'string' || !formData?.campaignName.trim() ) {
- setShowToast({ key: "error", label: "CAMPAIGN_NAME_MISSING_TYPE_ERROR" });
- return false;
- }
- else {
- return true;
- }
+ if (typeof formData?.campaignName !== "string" || !formData?.campaignName.trim()) {
+ setShowToast({ key: "error", label: "CAMPAIGN_NAME_MISSING_TYPE_ERROR" });
+ return false;
+ } else {
+ return true;
+ }
case "campaignDates":
const startDateObj = new Date(formData?.campaignDates?.startDate);
const endDateObj = new Date(formData?.campaignDates?.endDate);
diff --git a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/deliveryRule/AddDeliverycontext.js b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/deliveryRule/AddDeliverycontext.js
index 62c8d456782..cf63303953d 100644
--- a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/deliveryRule/AddDeliverycontext.js
+++ b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/deliveryRule/AddDeliverycontext.js
@@ -60,7 +60,7 @@ const AddAttributeField = ({ deliveryRuleIndex, delivery, deliveryRules, setDeli
// setAttributes((pre) => pre.map((item) => (item.key === attribute.key ? { ...item, value: e.target.value } : item)));
const updatedData = deliveryRules.map((item, index) => {
if (item.ruleKey === deliveryRuleIndex) {
- item.attributes.find((i) => i.key === attribute.key).value = value;
+ item.attributes.find((i) => i.key === attribute.key).value = value?.code;
}
return item;
});
@@ -457,11 +457,12 @@ const AddDeliveryRule = ({ targetedData, deliveryRules, setDeliveryRules, index,
};
const removeProduct = (item) => {
+ const temp = delivery;
setDeliveryRules((prevState) => {
const updatedDeliveryRules = prevState.map((delivery) => {
- if (delivery.ruleKey === delivery.ruleKey) {
+ if (delivery.ruleKey === temp.ruleKey) {
const updatedProducts = delivery.products
- .filter((product) => product.key !== item.key)
+ .filter((product) => product.value !== item.value)
.map((product, index) => ({ ...product, key: index + 1 }));
return { ...delivery, products: updatedProducts };
}
@@ -498,7 +499,7 @@ const AddDeliveryRule = ({ targetedData, deliveryRules, setDeliveryRules, index,
{delivery?.products?.length > 0 &&
delivery?.products?.map((i) => {
- i?.value && i.count ?
removeProduct(i)} /> : null;
+ return i?.value && i?.count ? removeProduct(i)} /> : null;
})}
-
+