danielzhe commented on code in PR #2508:
URL: 
https://github.com/apache/incubator-kie-tools/pull/2508#discussion_r1705483899


##########
packages/dmn-editor/tests-e2e/__fixtures__/nodes.ts:
##########
@@ -140,9 +140,19 @@ export class Nodes {
   }
 
   public async move(args: { name: string; targetPosition: { x: number; y: 
number } }) {
-    await this.get({ name: args.name }).dragTo(this.diagram.get(), {
-      targetPosition: args.targetPosition,
-    });
+    if (DefaultNodeName.DECISION_SERVICE === args.name) {
+      // Decision Services only have some draggable areas near the borders.
+      // If you drag it to the center, you'll drag the divide line.
+      // Also, neither the entire upper area nor the entire downer area is 
draggable.
+      await this.get({ name: args.name }).dragTo(this.diagram.get(), {
+        targetPosition: args.targetPosition,
+        sourcePosition: { x: 20, y: 20 },
+      });

Review Comment:
   I made a recent change where the name must now contain 
`DefaultNodeName.DECISION_SERVICE`, but not exactly it. But I agree, it isn't 
good to rely on the name. What we can do? A separate "move" for Decision 
Service or add a doc in the code? 
   
   We also can just change the `move` to always get the node from a corner not 
from the middle. Then it will work for every node. Can add an optional 
parameter where the user can add the `sourcePosition` also. I think this is the 
best option. What do you guys think? @jomarko @tiagobento 



-- 
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]

Reply via email to