-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
feat(explore): collapse time section if no ts columns #14493
Conversation
4318d53
to
60fcecf
Compare
Codecov Report
@@ Coverage Diff @@
## master #14493 +/- ##
==========================================
- Coverage 76.90% 76.90% -0.01%
==========================================
Files 958 958
Lines 48241 48268 +27
Branches 5636 5645 +9
==========================================
+ Hits 37102 37120 +18
- Misses 10938 10947 +9
Partials 201 201
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -111,7 +111,7 @@ describe('VizType control', () => { | |||
// should load mathjs for line chart | |||
cy.get('script[src*="mathjs"]').should('have.length', 1); | |||
cy.get('script').then(nodes => { | |||
expect(nodes.length).to.eq(numScripts); | |||
expect(nodes.length).to.greaterThan(numScripts); |
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.
I wasn't able to reproduce this locally (locally I was only getting 11 script nodes, but cypress is finding nodes.length === 13
, numScripts === 12
), but I noticed that this used to be greaterThan
before this PR: #12218 , so I assume this can be flipped back.
b1e7605
to
20cbcd8
Compare
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.
LGTM. Thanks, Ville.
* feat(explore): collapse time section if no ts columns * fix viz change bug * fix test
* feat(explore): collapse time section if no ts columns * fix viz change bug * fix test
* feat(explore): collapse time section if no ts columns * fix viz change bug * fix test
SUMMARY
This is a follow-up of #12093 , which aims to automatically hide/expand the time section based on presence of temporal columns in the dataset.
Previously the
ControlPanelsContainer
component was using thedefaultActiveKey
prop inCollapse
to control which panels were active. To be able to make the panels collapse automatically when we change datasources to one with/without temporal columns, we have to switch toactiveKey
and manage the state within the component. To do this some code had to be moved out of the render method, but the majority of the logic is untouched.Previous flow:
New flow:
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Previously the time section was always expanded, and changing the dataset to/from one with/without any temporal columns didn't change anything:
https://user-images.githubusercontent.com/33317356/117162820-ca5d2380-adcb-11eb-923d-d1281668f5a0.mp4
AFTER
Now the time section is automatically expanded/collapsed when changing to a dataset with/without a temporal column.
https://user-images.githubusercontent.com/33317356/117162867-d2b55e80-adcb-11eb-9dae-3f26fcaf9e45.mp4
TEST PLAN
ADDITIONAL INFORMATION