Skip to content

Commit

Permalink
more steps
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak committed Dec 20, 2024
1 parent 9be686c commit 3916fbb
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions dec2024/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ const updateFlowData = (flowData) => {
console.log(`${timestamp} Updated project type value`);
}

// Help text
if (nodeData?.["data"]?.["policyRef"]?.includes("/made")) {
newFlowData[nodeId]["data"]["policyRef"] = nodeData["data"]["policyRef"].replaceAll("/made", "");
console.log(`${timestamp} Updated help text policy reference link`);
}

// About the property
if (nodeData?.["type"] === 12) {
newFlowData[nodeId]["data"] = defaultPropertyInformationNodeData;
Expand All @@ -82,6 +88,29 @@ const updateFlowData = (flowData) => {
delete newFlowData[nodeId]["data"]["output"];
console.log(`${timestamp} Updated Calculate prop`);
}

// DrawBoundary props
if (nodeData?.["type"] === 10 && nodeData?.["data"]?.["dataFieldBoundary"]) {
newFlowData[nodeId]["data"]["fn"] = "proposal.site";
delete newFlowData[nodeId]["data"]["dataFieldBoundary"];
delete newFlowData[nodeId]["data"]["dataFieldArea"];
console.log(`${timestamp} Updated DrawBoundary props`);
}

// Filter Options / Answers flag prop
if (nodeData?.["type"] === 200 && nodeData?.["data"]?.["flag"]) {
const currentFlagValue = nodeData["data"]["flag"];
if (typeof currentFlagValue === "string") {
// Legacy nodes are still string values
newFlowData[nodeId]["data"]["flags"] = [currentFlagValue];
delete newFlowData[nodeId]["data"]["flag"];
} else {
// New nodes are already arrays
newFlowData[nodeId]["data"]["flags"] = currentFlagValue;
delete newFlowData[nodeId]["data"]["flag"];
}
console.log(`${timestamp} Updated Answer flags prop`);
}
});

return newFlowData;
Expand Down

0 comments on commit 3916fbb

Please sign in to comment.