tiagobento commented on code in PR #2130:
URL:
https://github.com/apache/incubator-kie-tools/pull/2130#discussion_r1475330749
##########
packages/dmn-editor/src/diagram/Diagram.tsx:
##########
@@ -414,24 +404,73 @@ export const Diagram = React.forwardRef<DiagramRef, {
container: React.RefObject
},
},
});
+
+ // TODO: Decide what to do with Decision Services and multiple
DRDs.
+ //
+ // When adding a Decision Service to a DRD, we need to bring all
its encapsulated and output Decisions with it, already formatted with
autolayout.
+ //
+ // if (drgElement.__$$element === "decisionService") {
+ // const defaultDecisionDimensions =
DEFAULT_NODE_SIZES[NODE_TYPES.decision](state.diagram.snapGrid);
+
+ // let i = 0;
+ // for (const decision of [
+ // ...(drgElement.outputDecision ?? []),
+ // ...(drgElement.encapsulatedDecision ?? []),
+ // ]) {
+ // i++;
+
+ // const decisionHref = parseXmlHref(decision["@_href"]);
+
+ // const decisionQNamePrefix = decisionHref.namespace
+ // ? getXmlNamespaceDeclarationName({
+ // model: state.dmn.model.definitions,
+ // namespace: decisionHref.namespace,
+ // })
+ // : undefined;
+
+ // // If there's a shape for this Decision in the DRD already,
we don't need to add anything.
+ // // If not, we add a new shape for it.
+ // if
(!state.computed(state).indexes().dmnShapesByHref.has(decision["@_href"])) {
+ // addShape({
+ // definitions: state.dmn.model.definitions,
+ // drdIndex: state.diagram.drdIndex,
+ // nodeType,
+ // shape: {
+ // "@_dmnElementRef": buildXmlQName({
+ // type: "xml-qname",
+ // localPart: decisionHref.id,
+ // prefix: decisionQNamePrefix,
+ // }),
+ // "dc:Bounds": {
+ // "@_x": dropPoint.x + 40 * i,
+ // "@_y": dropPoint.y + 40 * i,
+ // "@_width": defaultDecisionDimensions["@_width"],
+ // "@_height": defaultDecisionDimensions["@_height"],
+ // },
+ // },
+ // });
+ // }
+ // }
+ // }
Review Comment:
Good catch. I'll create an issue and remove the commented code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]