-
Notifications
You must be signed in to change notification settings - Fork 27
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
Create Workflow component with Lumino #325
Conversation
I was just going to get my toes wet learning Lumino, then when I realized it wasn't really hard decided to start digging in the TypeScript code (no docs) and examples. Tried to match as much as possible the design sketch. There are some limitations to how much we can tweak due to the way it builds screens with multiple widgets, each having some logic to decide the height/width. For instance, I wanted to increase font size and give it more space (padding/margins) to the tabs, but this is quite complicated without docs/examples. One major issue now is reactivity. I am attaching the Vue component, and destroying it (I think, hard to spot the exact object in the browser memory, but will confirm later). But the component is not being updated. i.e., here's what it looks like at the moment: So each time I add a new Tree component, it picks up the current workflow status, then freezes. Not being updated even though Vuex data is still changing. So I've got to sort this out before this is ready for review. Then need to check which commits need to be squashed, check if it's possible to add any tests (don't think so at this stage), add the changelog, and it should be ready for review 🎊 |
Also, almost forgot, not sure if we can use the Graph component. In order to add the Graph here, we must be able to create the Graph component programmatically. If the Graph component (not the view) depends on VueRouter, extra objects, or if we are not able to create multiple instances of the Graph component, then we will need to refine the component code. But once that's done, adding a new Graph Widget (Lumino layout uses widgets, not components) shouldn't be too hard (<1 day work, couple hours perhaps or less). |
Eureka moment going for a walk. Insteas of creatijg a new tree component myself, it should be possible to instead simply add some value to an array, then use a v-for to get vue to create the component for me. May have to hide the component, or find a way to tell vue where it should go in the dom tho. But a possible fix for reactivity. |
Came back from NIWA x-mas function and had to finish it otherwise I wouldn't be able to enjoy the weekend 😄 Next week will review the commits, add changelog, and then wait until @oliver-sanders or somebody else has time to review the current draft, before adding any more code. But so far, I'm really happy with Lumino 👍 |
That looks brilliant, well done 💐 |
Ready for review. Will try to add a few unit tests, but that shouldn't alter the current code, so happy to take any reviews. The last commit alters the Tested with latest Chrome/Ffox on Ubuntu LTS, and IE Edge on Win10Pro. Here's what it should look like: A few known issues:
The issues above are not blockers IMO, as they are not directly caused by the new |
NB: No CI on this PR as #324 is still pending review 👍 but just ran lint/tests/build locally and it worked fine on my environment. |
Unit tests added, change log too. Commits are as organized as I could, without re-writing code. They are more or less grouped, there some CSS/style commits that could have been grouped together but I worked on separate parts of the code while trying to integrate Lumino, sometimes on the JS part, sometimes on the CSS. Tested again on Ffox/Chrome. Ran the CI commands locally and everything passed. The CI passed on my repository when I pushed it, so it's possible to confirm it should have passed here too: https://github.com/kinow/cylc-ui/actions (only not running because we need #324 in order to trigger the action on pull requests and on push). Coverage is not being uploaded in the action. It will reduce, probably, as we have some code for a view added here that is not being tested, only the component is. Will fix the coverage in another PR. |
Ah, good to know. I chose a special character for the X close button, but should have done the simple first. I'm pushing one commit to use a simple letter X now.
Maybe if you try on a different browser. Though I am afraid the graph component needs a few more changes in order to be used as a widget with lumino (and we need to run a few more tests with cytoscape/etc, as IE Edge is not working, though I believe I've used Cytoscape apps with IE before)
This is a bit tricky with lumino. If you position two widgets side by side, then you should be able to resize their width, respecting a minimum-width that I set (otherwise when opening on mobile or smaller screens you wouldn't see the widget content. But as for height, the hard limit is the screen size I think. Initially I don't set a height for lumino widgets. I set a min-height, and then it computes the widget height. I couldn't pinpoint exactly where they are doing that in their TypeScript code... but the best I could do was to change the height of the content div to occupy as much as possible (see screenshot below) and also define a min-height. (content is the whole area, which includes the toolbar and the workflow area, as well as footer, that's why it has 100 height of viewport) |
Sorry, I meant resizing the "panes" within Lumino by hovering over the gap between panes until you get the arrow icon, then using click+drag. |
Ah, if that's working in JupyterLab maybe we can copy it from there. I used their examples to implement this PR. Here's how it works in one of their examples. It should be working similarly in this PR. |
Will try to fix the conflicts here today. |
338e29b
to
0e34a1d
Compare
PR updated. Conflicts fixed. Had to update the Tested with the recently merged subscriptions/websockets, and two workflows. Almost everything seems to be working as expected. There is one thing that I may fix after the Tree component. If you have 2 workflows, and you open one and add some views (e.g. one tree, and one graph). Then, when you switch to another workflow, the two views are kept, and the tasks/jobs are replaced by the new component. Here's what I mean. Between bug and feature, I think this probably falls in the category of bug/unexpected behaviour. |
Argh, one test failing 😠 |
GitHub action happy. This is officially ready for review! Will keep an eye for comments/reviews, but focusing now on the treeview as holiday homework (read: nerdy fun). |
…a lumino widget and standalone vue component
Squashed commits 👍 but still pending one item from Oliver's review. |
Fixed #323 while testing this PR with the "Add View" link. |
Finished moving the subscriptions to the view. The The widget has the same ID as the subscription. Later, when the user closes the widget, we capture the Lumino event, and emit a new Vue event. That event then triggers the deletion of the Vue components (wrapper et al) and the removal of the subscription. This a compromise for the discussion around where to keep subscriptions. The components are free of GraphQL details or queries. The subscription code ( Final notes: this PR has a commit that I picked from the Infinite Tree PR to fix the offline mode. Whichever goes first, the other PR will need amending. It is not really important, as they will cause conflicts anyway in the tree component. The conflicts will take a couple of days for fixing and testing, as I haven't experimented the infinite tree with lumino 👍 |
Okay, so you've copied the queries from the tree and graph view into the workflow component? If so should the query in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay the "compromise" makes sense, it restores the "only subscribe to what you need" model, further refinement should be attempted separately.
Replied on Riot, copying here for reference Yes, I think @hjoliver mentioned he'd like to keep the old table at /workflows working. That one where users can see a listing of workflows, and under Actions I think there are links for the Tree view and for the Graph view. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woohoo, looks good, works, all happy.
I think this is perfectly usable and further enhancements / tweaks can be punted as this is already a sizeable change - hence #358 which we can live with until |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
These changes close #90, and close #323
Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.