-
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
Add collapse all and expand all buttons to Tree component #574
Conversation
Today I just did the template after reading the design issue, tomorrow will do more testing with a real workflow. @oliver-sanders, @hjoliver I couldn't find where to put the collapse/expand all buttons in the design issue. Any suggestions? Thanks! |
Codecov Report
@@ Coverage Diff @@
## master #574 +/- ##
==========================================
- Coverage 81.66% 80.97% -0.70%
==========================================
Files 66 45 -21
Lines 1320 1072 -248
Branches 81 71 -10
==========================================
- Hits 1078 868 -210
+ Misses 223 185 -38
Partials 19 19
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@kinow I think we'd want expand-all to stop at the task level. i.e. expand all task families, but don't expand the jobs (the icons show how many jobs there are anyway) and definitely don't expand the job details leaves. |
Done! The function already supported a filter function :-) so just passed a filter that looks for the types we don't want to expand ( |
The button positions seem good to me. Noticed a couple of issues though, from a quick play:
|
Ah, sorry, I misunderstood it. That'll be easy to fix.
👍 will make it a flex element, and adjust how it behaves (wrap, justify, etc). I'm more concerned about the location, whether the icon is OK (I used the first that came to my mind). And the feature could be a bit different. We could make it stateful. So if you click expand all, then every subsequent delta will be expanded too. Meaning that the UI keeps the "expand all" state, until you click the expand all icon again. That can be tricky to implement/test, but new deltas would be expanded too. Thanks @hjoliver ! |
There is an issue for this, although the answer is pretty much "where you've put them". #471 |
33be555
to
ea389c8
Compare
Thanks @oliver-sanders ! |
ea389c8
to
9ccf7ee
Compare
} | ||
] | ||
} | ||
localVue.use(CylcObjectPlugin) |
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.
The code above removes several warnings from the console about missing the directive for cylc-object
.
@@ -39,7 +58,7 @@ describe('Tree component', () => { | |||
// mount function from Vuetify docs https://vuetifyjs.com/ru/getting-started/unit-testing/ | |||
/** | |||
* @param options | |||
* @returns {Tree} | |||
* @returns {Wrapper<Tree>} |
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.
The wrapper has different attributes and functions, so the proper annotation gives the IDE better auto-complete (e.g. findAllComponents
and displays its signature)
// task proxy is displayed | ||
expect(taskProxy.$children[0].filtered).to.equal(true) | ||
expect(taskProxy.vm.filtered).to.equal(true) |
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 tests were broken!!!
I thought children
would return the children components of Tree
. And it does, but I thought the children were TreeItem
. Turns out it brings several components, like the TreeItem
s, but also all the Vuetify components (like VTextField
and whatnot).
So fixed it by using the Wrapper
and WrapperArray
objects functions (and with some debugging 😬 ).
They got broken in this PR as I added new children components for the plus and minus icons.
Still pending
|
Last commit expands workflows, cycle points, and family proxies. Tasks, jobs, and job details won't be expanded. |
@hjoliver I've fixed the plus and minus icons wrapping. However, I noticed that the filter elements (task search name, task statuses) are responsive. That means that when you are using a small viewport, they adjust to be displayed in a different way. But when you have a small widget area, they are not responsive. Here's what I mean: The filter elements are reducing the width, but I think they shouldn't. And there is no way to tell the filter or expand/collapse toggle that they need to be displayed in a different way. In this case, I think making a fixed width would fix it. But, in the end, I believe this will be fixed when we adjust the filter to match the design toolbar @oliver-sanders mentioned earlier #471 Once we adopt that design, this issue will be gone. Note too, that this happens before this PR, that's why I stopped messing with layout/responsive/flexbox/etc. Otherwise this change would grow more, making it harder to review/revert/conflicts/etc. WDYT? |
Seems fine to me, as we have a plan that will fix it. |
Started writing the tests for expand/collapse methods. Even though that's not part of this PR, as it had been implemented since the initial version of the tree component, only now we are using that code. Should be done by tomorrow, then this one will be ready for review. |
154633c
to
b6a2e5d
Compare
Added unit test and changelog. Had some issues writing the tests because I used an array of test parameters (wish there was something like parametrized tests in mocha+chai), and was calling Turns out these functions mutate the objects I was passing to the tests, so the first test mutated the data, the second mutated again, etc. Until one failed. 😥 Fixed with Lodash's mutate (because |
b6a2e5d
to
68575bb
Compare
Rebased, making sure I didn't accidentally re-introduce the |
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.
Thanks!
Ah! Tested locally, and you are correct. The tooltip appears over the Add View link, giving the wrong impression that they are related somehow. I've added the |
063acc8
to
7b73df5
Compare
Also rebased 👍 |
The CI failure is related to #590 not related to this PR |
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.
Works for me, nice 👍
These changes close #246
Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.