Skip to content

Commit

Permalink
Merge branch 'console' into HCMPRE-866
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhavya-egov authored Oct 17, 2024
2 parents eddd07c + 649f09c commit 8d38466
Show file tree
Hide file tree
Showing 40 changed files with 19,989 additions and 432 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" />

<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].79-campaign/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].82-campaign/dist/index.css" />


<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-css",
"version": "1.0.79-campaign",
"version": "1.0.82-campaign",
"license": "MIT",
"main": "dist/index.css",
"author": "Jagankumar <[email protected]>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,53 @@
}

.dm-code {
max-width: var(--dm-code-max-width, 10rem);
display: inline-block; /* Keep elements inline but respect width constraints */
max-width: 100%; /* Remove width constraint to avoid overflow */
display: block; /* Ensure each item appears on a new line */
white-space: normal; /* Allow text to wrap */
overflow: visible; /* Ensure text isn't cut off */
}

.dm-audit-info{
max-width: 70%; /* Ensure this section doesn't take too much space */
overflow: hidden;
text-overflow: ellipsis; /* Handle long text with ellipsis */
white-space: nowrap; /* Prevent wrapping */
overflow: hidden; /* Hide overflow text */
text-overflow: ellipsis; /* Add ellipsis to overflowing text */
color: #C84C0E;
margin-bottom: "1rem";
font-size: "0.875rem"
}


.as-table-like{
display: table;
width: 100%;
border-collapse: separate;
border-spacing: 0 1rem; /* 1rem space between rows */
}

.as-table-row{
display: table-row;

}

.as-table-cell{
display: table-cell;
padding: 10px;
vertical-align: top;
}

.as-key-cell{
font-weight: bold;
width: 40%; /* Adjust column width for keys */
background-color: #f8f8f8; /* Optional: light background for key column */
margin-right: 5rem;
}

.as-value-cell {
width: 60%; /* Adjust column width for values */
position: absolute;
left: 36rem;
}



Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const BoundaryDetailsSummary = (props) => {
<PopUp
// className={"boundaries-pop-module"}
type={"default"}
// heading={t("ES_CAMPAIGN_UPDATE_TYPE_MODAL_HEADER")}
heading= {t(( props?.hierarchyType + "_" + props?.boundaries?.type).toUpperCase())}
children={[]}
onOverlayClick={() => {
setShowPopUp(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const BoundarySummary = (props) => {
// ),
props: {
boundaries: item,
hierarchyType: hierarchyType
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ const CampaignSummary = (props) => {
),
props: {
boundaries: item,
hierarchyType: hierarchyType
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const CampaignUpdateSummary = (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 All @@ -197,6 +197,7 @@ const CampaignUpdateSummary = (props) => {
),
props: {
boundaries: item,
hierarchyType: hierarchyType
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,31 @@ export const useResourceData = async (data, hierarchyType, type, tenantId, id ,
const baseDelay = baseTimeOut?.baseTimeout?.[0]?.baseTimeOut;
const maxTime = baseTimeOut?.baseTimeout?.[0]?.maxTime;
let retryInterval = Math.min(baseDelay * jsonDataLength , maxTime);
if(typeof retryInterval !== "number"){
retryInterval = 1000;
}

await new Promise((resolve) => setTimeout(resolve, retryInterval));

// Retry until a response is received
while (status !== "failed" && status !== "invalid" && status !== "completed") {
searchResponse = await Digit.CustomService.getResponse({
url: "/project-factory/v1/data/_search",
body: {
SearchCriteria: {
id: [response?.ResourceDetails?.id],
tenantId: tenantId,
type: Type,
try {
searchResponse = await Digit.CustomService.getResponse({
url: "/project-factory/v1/data/_search",
body: {
SearchCriteria: {
id: [response?.ResourceDetails?.id],
tenantId: tenantId,
type: Type,
},
},
},
});
status = searchResponse?.ResourceDetails?.[0]?.status;
if (status !== "failed" && status !== "invalid" && status !== "completed") {
await new Promise((resolve) => setTimeout(resolve, retryInterval));
});
status = searchResponse?.ResourceDetails?.[0]?.status;
if (status !== "failed" && status !== "invalid" && status !== "completed") {
await new Promise((resolve) => setTimeout(resolve, retryInterval));
}
} catch (error) {
console.error("Error while fetching data:", error);
}
}
if (Error.isError) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ function getOperatorSymbol(operator) {
// tt.resources = resources;
// }


// console.log("ttoo" , tt);
// return [tt];
// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ const UpdateBoundary = ({hierarchyData }) => {
let payloadData = { ...draftData };
payloadData.hierarchyType = hierarchyType;
payloadData.endDate = CampaignData?.CampaignDetails?.[0]?.endDate;
payloadData.startDate = CampaignData?.CampaignDetails?.[0]?.startDate;;
payloadData.startDate = CampaignData?.CampaignDetails?.[0]?.startDate;
payloadData.tenantId = tenantId;
payloadData.action = "create";
payloadData.parentId = parentId;
Expand Down Expand Up @@ -600,45 +600,8 @@ const UpdateBoundary = ({hierarchyData }) => {
setShowToast(null);
return true;
}

case "cycleConfigure":
const cycleNumber = formData?.cycleConfigure?.cycleConfgureDate?.cycle;
const deliveryNumber = formData?.cycleConfigure?.cycleConfgureDate?.deliveries;
if (cycleNumber === "" || cycleNumber === 0 || deliveryNumber === "" || deliveryNumber === 0) {
setShowToast({ key: "error", label: "DELIVERY_CYCLE_ERROR" });
return false;
} else {
setShowToast(null);
return true;
}
case "deliveryRule":
const isAttributeValid = checkAttributeValidity(formData);
if (isAttributeValid) {
setShowToast({ key: "error", label: isAttributeValid });
return false;
}
setShowToast(null);
return;
case "DeliveryDetailsSummary":
const cycleConfigureData = totalFormData?.HCM_CAMPAIGN_CYCLE_CONFIGURE;
const isCycleError = validateCycleData(cycleConfigureData);
const deliveryCycleData = totalFormData?.HCM_CAMPAIGN_DELIVERY_DATA;
const isDeliveryError = validateDeliveryRules(
deliveryCycleData,
totalFormData?.["HCM_CAMPAIGN_TYPE"]?.projectType?.code?.toUpperCase(),
cycleConfigureData
);
if (isCycleError?.length > 0) {
setShowToast({ key: "error", label: "DELIVERY_CYCLE_MISMATCH_LENGTH_ERROR" });
return false;
}
if (isDeliveryError === false) {
setShowToast({ key: "error", label: "DELIVERY_RULES_ERROR" });
return false;
}
setShowToast(null);
return true;
case "DataUploadSummary":
case "summary":
const updateBoundary = restructureBoundaryData(totalFormData?.HCM_CAMPAIGN_SELECTING_BOUNDARY_DATA?.boundaryType?.selectedData);
const isTargetError = totalFormData?.HCM_CAMPAIGN_UPLOAD_BOUNDARY_DATA?.uploadBoundary?.uploadedFile?.[0]?.filestoreId
? false
: (setSummaryErrors((prev) => {
Expand Down Expand Up @@ -681,6 +644,10 @@ const UpdateBoundary = ({hierarchyData }) => {
};
}),
true);
if (updateBoundary.length === 0 && isTargetError && isFacilityError && isUserError) {
setShowToast({ key: "error", label: "AT_LEAST_ONE_FILE_REQUIRED_ERROR" });
return false;
}
if (isTargetError) {
setShowToast({ key: "error", label: "TARGET_DETAILS_ERROR" });
return false;
Expand All @@ -695,79 +662,6 @@ const UpdateBoundary = ({hierarchyData }) => {
}
setShowToast(null);
return true;
case "summary":
// const cycleConfigureData = totalFormData?.HCM_CAMPAIGN_CYCLE_CONFIGURE;
// const isCycleError = validateCycleData(cycleConfigureData);
// const deliveryCycleData = totalFormData?.HCM_CAMPAIGN_DELIVERY_DATA;
// const isDeliveryError = validateDeliveryRules(
// deliveryCycleData,
// totalFormData?.["HCM_CAMPAIGN_TYPE"]?.projectType?.code?.toUpperCase(),
// cycleConfigureData
// );
// const isTargetError = totalFormData?.HCM_CAMPAIGN_UPLOAD_BOUNDARY_DATA?.uploadBoundary?.uploadedFile?.[0]?.filestoreId
// ? false
// : (setSummaryErrors((prev) => {
// return {
// ...prev,
// target: [
// {
// name: `target`,
// error: t(`TARGET_FILE_MISSING`),
// },
// ],
// };
// }),
// true);
// const isFacilityError = totalFormData?.HCM_CAMPAIGN_UPLOAD_FACILITY_DATA?.uploadFacility?.uploadedFile?.[0]?.filestoreId
// ? false
// : (setSummaryErrors((prev) => {
// return {
// ...prev,
// facility: [
// {
// name: `facility`,
// error: t(`FACILITY_FILE_MISSING`),
// },
// ],
// };
// }),
// true);
// const isUserError = totalFormData?.HCM_CAMPAIGN_UPLOAD_USER_DATA?.uploadUser?.uploadedFile?.[0]?.filestoreId
// ? false
// : (setSummaryErrors((prev) => {
// return {
// ...prev,
// user: [
// {
// name: `user`,
// error: t(`USER_FILE_MISSING`),
// },
// ],
// };
// }),
// true);
// if (isCycleError?.length > 0) {
// setShowToast({ key: "error", label: "DELIVERY_CYCLE_MISMATCH_LENGTH_ERROR" });
// return false;
// }
// if (isDeliveryError === false) {
// setShowToast({ key: "error", label: "DELIVERY_RULES_ERROR" });
// return false;
// }
// if (isTargetError) {
// setShowToast({ key: "error", label: "TARGET_DETAILS_ERROR" });
// return false;
// }
// if (isFacilityError) {
// setShowToast({ key: "error", label: "FACILITY_DETAILS_ERROR" });
// return false;
// }
// if (isUserError) {
// setShowToast({ key: "error", label: "USER_DETAILS_ERROR" });
// return false;
// }
setShowToast(null);
return true;
default:
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ const AddAttributeWrapper = ({ targetedData, deliveryRuleIndex, delivery, delive
setDeliveryRules(newData);
};


const selectedStructureCodes = campaignData?.flatMap((cycle) =>
cycle?.deliveries?.flatMap((delivery) => delivery?.deliveryRules?.flatMap((rule) => rule?.attributes?.map((attribute) => attribute?.value)))
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ const getDeliveryConfig = ({ data, projectType }) => {
count: variant.quantity,
value: variant.productVariantId,
name: variant.name

};
});
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import FormulaView from "./components/FormulaView";
import SummaryScreen from "./pages/employee/SummaryScreen";
import CampaignBoundary from "./components/CampaignBoundary";
import FormulaConfigWrapper from "./components/FormulaConfigWrapper";

import AssumptionsList from "./components/AssumptionsList";
import FormulaConfigScreen from "./components/FormulaConfigScreen";

export const MicroplanModule = ({ stateCode, userType, tenants }) => {
const { path, url } = useRouteMatch();
Expand Down Expand Up @@ -69,7 +70,9 @@ const componentsToRegister = {
FormulaView,
FormulaSection,
SummaryScreen,
CampaignBoundary
CampaignBoundary,
AssumptionsList,
FormulaConfigScreen


};
Expand Down
Loading

0 comments on commit 8d38466

Please sign in to comment.