-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dynamic drag-and-drop connections between objects on designer workflows (with x6) #3404
Add dynamic drag-and-drop connections between objects on designer workflows (with x6) #3404
Conversation
…ithub.com/karavajka/elsa-core into feature/dynamic-connections-of-activities
…ttps://github.com/karavajka/elsa-core into feature/dynamic-connections-of-activities-with-x6
So by default x6 graphs will not be enabled. To enable them, you need to edit package.json and add "--x6graph" argument to the start and build scripts. |
Hi @karavajka, I tested your work and it is looking really good. I did find the following two issues:
Thanks for the hard work! |
I just found out that it works when I press & hold the SHIFT key, so it is actually possible to draw a selection rectangle. |
A few more items (some are taken from the other PR):
|
Indeed, it only happens when zooming out it seems. The screenshot was take from the other PR, so it's true that it' not exactly the same. |
Okay I can see it now, when scrolling 100% out, but only when the 0-border exists I think. |
Understood. The problem with this however is that it is not a good UX for the diagram to change like that when adding activities. A better approach would be to position the activity by taking a screen coordinate of e.g. 250,250 and translate that to local coordinates (local to the design surface). For example, if the design surface is 10000x10000 pixels, and the user has panned to e.g. 5000x1000, the position of the new activity would be 5250x1250. The zoom level has to be taken into account also. The v3 branch contains logic to translate from the "drop" position to local coordinates, so it would be the same. The only difference is that in your case, you hard-code the "drop position" to e.g. 250x250. An alternative approach could be to get rid of the green Add Activity button entirely and add a panel to the left that represents the activity picker, from which users can now drag & drop activities directly Obviously, this would be more work, but more consistent with the V3 designer also. |
…into feature/dynamic-connections-of-activities-with-x6
Except for the layout one, the issues you mentioned, should be solved. I solved the zoom to fit problem, by just creating the activity node to the corner of the view. |
About the layout problem. I think I found a solution by using the dagre library that already exists inside v2 directly. It looks like it is giving very good results. I will commit it soon. |
That's a clever solution 👍🏻 |
I noticed the following behavior when opening a workflow definition where the connections appear to be starting from the top-left corner of an activity. But as soon as I move around an activity, the connections are replaced correctly. Please take a look at the following recording to see what I mean: Screen.Recording.2022-11-11.at.21.38.29.mov |
I tried the switching between workflow versions, and although it now indeed reflects the currently selected version in the designer, the autolayout logic gets applied as well, which is not desirable: when a user positions activities, those positions should not be overridden by autolayout. Here are the rules for applying autolayout:
Here's a recording to demonstrate the issue: Screen.Recording.2022-11-11.at.21.46.10.mov |
When running the workflow from the designer, the status icons have disappeared. To show what it should look like, please take a look at the following recording: Screen.Recording.2022-11-11.at.21.58.45.movNotice the symbols on the top-right of each activity to indicate that an activity has executed, is executing or has faulted. |
When I create a workflow and add the RunJavaScript activity, run the workflow and try to view the workflow instance, the design canvas appears to be empty. This is most likely due to the JS error visible in the console (duplicate port ID detected). Please see the following recording to reproduce the issue: Screen.Recording.2022-11-11.at.22.10.03.mov |
I think I managed to fix these issues to a satisfactory degree. Please have a look. |
@tanelkuhi I just pulled the latest updates, and noticed the following: Are you getting this too? |
@tanelkuhi I can confirm that you fixed all the issues mentioned 🎉 Thank you for the hard work! |
Actually the graph was centering content even before, but just like the connections being broken, when opened from the list (not when refreshing on the page), it was broken as well. So I fixed it. But I realize, centering, when there are no activities, is probably not the best idea. |
Nice. Then let's get this merged in 👍🏻 |
It seems, I don't have the rights to merge it, so can you do it, please? |
Yeah, sorry that's what I meant: I'll get it merged :) |
@tanelkuhi can you please, just for reference, write here a clear example what needs to be changed in html (or wherever else) for this change to be activated? |
@tomy2105 For x6 graphs to be activated, in the workflow studio index.html file, you have to attach an attribute named |
No description provided.