Skip to content

Commit

Permalink
updated summary redirection (#1488)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhavya-egov authored Oct 9, 2024
1 parent e9d3c68 commit f2212f2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const BoundarySummary = (props) => {
config: {
select: (data) => {
const boundaryData = boundaryDataGrp(data?.[0]?.boundaries);
const hierarchyType= data?.[0]?.hierarchyType;
return {
cards: [
...boundaryData?.map((item, index) => {
Expand All @@ -92,7 +93,7 @@ const BoundarySummary = (props) => {
{
name: `HIERARCHY_${index + 1}`,
type: "COMPONENT",
cardHeader: { value: `${t(item?.type)}` , inlineStyles: { color : "#0B4B66" } },
cardHeader: { value: `${t(( hierarchyType + "_" + item?.type).toUpperCase())}` , inlineStyles: { color : "#0B4B66" } },
// cardHeader: { value: t("item?.boundaries?.type") },
component: "BoundaryDetailsSummary",
// cardSecondaryAction: noAction !== "false" && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ const CampaignSummary = (props) => {
const target = data?.[0]?.deliveryRules;
const boundaryData = boundaryDataGrp(data?.[0]?.boundaries);
const cycleData = reverseDeliveryRemap(target, t);
const hierarchyType= data?.[0]?.hierarchyType;
return {
cards: [
{
Expand Down Expand Up @@ -371,7 +372,9 @@ const CampaignSummary = (props) => {
{
name: `HIERARCHY_${index + 1}`,
type: "COMPONENT",
cardHeader: { value: `${t(item?.type)}`, inlineStyles: { color: "#0B4B66" } },

cardHeader: { value: `${t(( hierarchyType + "_" + item?.type).toUpperCase())}` , inlineStyles: { color : "#0B4B66" } },

// cardHeader: { value: t("item?.boundaries?.type") },
component: "BoundaryDetailsSummary",
cardSecondaryAction: noAction !== "false" && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ const SetupCampaign = ({ hierarchyType, hierarchyData }) => {
useEffect(() => {
if (isPreview === "true") {
setIsDraftCreated(true);
setCurrentKey(13);
setCurrentKey(14);
return;
}
if (isDraft === "true") {
Expand Down Expand Up @@ -409,9 +409,9 @@ const SetupCampaign = ({ hierarchyType, hierarchyData }) => {

useEffect(() => {
setIsSubmitting(false);
if (currentKey === 13 && isSummary !== "true") {
if (currentKey === 14 && isSummary !== "true") {
updateUrlParams({ key: currentKey, summary: true });
} else if (currentKey !== 13) {
} else if (currentKey !== 14) {
updateUrlParams({ key: currentKey, summary: false });
// setSummaryErrors(null);
}
Expand Down Expand Up @@ -583,15 +583,15 @@ const SetupCampaign = ({ hierarchyType, hierarchyData }) => {
updateUrlParams({ id: data?.CampaignDetails?.id });
draftRefetch();
if (currentKey == 6) {
setCurrentKey(13);
setCurrentKey(14);
} else {
setCurrentKey(currentKey + 1);
}
},
});
} else {
if (currentKey == 6) {
setCurrentKey(13);
setCurrentKey(14);
} else {
setCurrentKey(currentKey + 1);
}
Expand Down Expand Up @@ -1321,7 +1321,7 @@ const SetupCampaign = ({ hierarchyType, hierarchyData }) => {
setShouldUpdate(true);
}
if (isChangeDates === "true" && currentKey == 6) {
setCurrentKey(13);
setCurrentKey(14);
}

if (!filteredConfig?.[0]?.form?.[0]?.isLast && !filteredConfig[0].form[0].body[0].mandatoryOnAPI) {
Expand All @@ -1347,7 +1347,7 @@ const SetupCampaign = ({ hierarchyType, hierarchyData }) => {
const name = filteredSteps[0].name;

if (step === 6 && Object.keys(totalFormData).includes("HCM_CAMPAIGN_UPLOAD_USER_DATA")) {
setCurrentKey(13);
setCurrentKey(14);
setCurrentStep(5);
} else if (step === 1 && totalFormData["HCM_CAMPAIGN_NAME"] && totalFormData["HCM_CAMPAIGN_TYPE"] && totalFormData["HCM_CAMPAIGN_DATE"]) {
setCurrentKey(5);
Expand Down Expand Up @@ -1394,7 +1394,7 @@ const SetupCampaign = ({ hierarchyType, hierarchyData }) => {
const draftFilterStep = (totalFormData) => {
const stepFind = (name) => {
const step = campaignConfig?.[0]?.form.find((step) => step.name === name);
return step ? parseInt(step.stepCount, 13) : null;
return step ? parseInt(step.stepCount, 14) : null;
};
let v = [];
if (totalFormData?.HCM_CAMPAIGN_NAME?.campaignName) v.push(stepFind("HCM_CAMPAIGN_NAME"));
Expand Down Expand Up @@ -1522,7 +1522,7 @@ const SetupCampaign = ({ hierarchyType, hierarchyData }) => {
// noCardStyle={currentStep === 7 ? false : true}
onSecondayActionClick={onSecondayActionClick}
label={
isChangeDates === "true" && currentKey == 13
isChangeDates === "true" && currentKey == 14
? t("HCM_UPDATE_DATE")
: isChangeDates === "true"
? null
Expand Down

0 comments on commit f2212f2

Please sign in to comment.