-
Notifications
You must be signed in to change notification settings - Fork 14.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
fix: data column in SQL lab left panel open by default #13624
Conversation
Codecov Report
@@ Coverage Diff @@
## master #13624 +/- ##
==========================================
- Coverage 77.21% 73.02% -4.20%
==========================================
Files 912 608 -304
Lines 46449 21639 -24810
Branches 5725 5725
==========================================
- Hits 35866 15801 -20065
+ Misses 10447 5702 -4745
Partials 136 136
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
.filter(({ expanded }) => expanded) | ||
.map(({ id }) => id)} |
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 love Javascript's object unpacking, it's really elegant.
@michael-s-molina ^ fyi collapse default behavior is not all the same in the product. i should have caught it. my bad. 🙏 |
No problem at all 😉. Thank you all for the fix. |
@eschutho I was thinking about what the most effective way of testing that expanded is true when a table is added. I decided that checking the reducer would be the most effective way of making sure that when the action is taken, that the new table has an expanded value of true. Is this the correct thinking? Or should I be testing sqlLab action as well? In the latter case, looking through https://redux.js.org/recipes/writing-tests says that I should be importing the reducer and checking it (that's why I decided to just test the reducer itself). Am I thinking of this correctly? Lastly --long note sorry-- I was thinking about testing the functionality of adding a column. Currently, I wrote an RTL test that checks to make sure that a table with expanded == true is shown in the document. I wanted to add a test that tests the functionality of clicking the each individual collapse panel (though there is a spec written for the Collapse panel component that checks this, so maybe not necessary). Also, I wanted to write a test that has you adding a table and that should come in expanded. The problem that I ran into here was that I think that I'd have to write a dataset/schema/table combination and then have fetchMocks that adds them to initial state? Does that sound correct? Would the test reside in SqlLeftEditor bar? Is this test necessary given that the reducer shows that tables come in with expanded == true and that expanded tables show in the document? I want to be thorough but not overzealous. ahh sorry for the note, been thinking about this a lot. |
* fix table expand * Left Panel Expand * added tests Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
SUMMARY
Fix to Left Panel tables being auto-expanded when added. This was a feature they had previous to the switch to antd Collapse.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Screen.Recording.2021-03-15.at.10.32.11.AM.mov
ADDITIONAL INFORMATION