chore(explore): Hide non-droppable metric and column list
SUMMARY
There can be certain items that cannot be accepted in all options. (For instance, metrics cannot be accepted in the columns selection. In cases where the controls solely consist of the columns selection, none of the metrics will be accepted in the overall dropzone, as shown in the screenshot below.)
To address this, the commit takes a step forward by checking the eligibility of each filter and hiding the item when there are no eligible options available.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
https://github.com/apache/superset/assets/1392866/3d3e6b92-c461-49ba-ad24-f23528acf22c
After:
https://github.com/apache/superset/assets/1392866/7bc72d2d-f9b8-4603-b607-926c49af9004
TESTING INSTRUCTIONS
- Create a table chart with the dataset
- Switch to "Raw Records" and then "Metrics" should be hidden
ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in SIP-59)
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
Codecov Report
Attention: Patch coverage is 84.00000% with 8 lines in your changes are missing coverage. Please review.
Project coverage is 67.50%. Comparing base (
38eecfc) to head (7fb999a). Report is 31 commits behind head on master.
| Files | Patch % | Lines |
|---|---|---|
| ...d/src/explore/components/DatasourcePanel/index.tsx | 77.41% | 3 Missing and 4 partials :warning: |
| .../src/explore/components/ExploreContainer/index.tsx | 90.00% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #27717 +/- ##
==========================================
+ Coverage 67.47% 67.50% +0.02%
==========================================
Files 1911 1913 +2
Lines 75020 75142 +122
Branches 8355 8403 +48
==========================================
+ Hits 50621 50722 +101
- Misses 22349 22358 +9
- Partials 2050 2062 +12
| Flag | Coverage Δ | |
|---|---|---|
| javascript | 57.55% <84.00%> (+0.07%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
/testenv up
@justinpark I think it would be important to show some kind of message/feedback to users when we have hidden columns or metrics because they can't be used anywhere. Maybe @kasiazjc can help us here.
@michael-s-molina If you are interested in considering feedback, this proposal suggests adopting a Gmail-style approach.
cc: @kasiazjc
This looks nice @justinpark. I would only keep the background white to not mix it with the draggable items and because this looks like a secondary information that does not need to be highlighted frequently. Once users view this for the first time, they will get used to it.
We won't have the Undo link right? I'm assuming that you can't undo the applicability of columns because they depend on what's already configured in the controls.
I would only keep the background white to not mix it with the draggable items and because this looks like a secondary information that does not need to be highlighted frequently. Once users view this for the first time, they will get used to it.
Sounds good. I'll update accordingly.
We won't have the Undo link right? I'm assuming that you can't undo the applicability of columns because they depend on what's already configured in the controls.
I agree with your opinion. Let me remove "undo" now.
/testenv up
@michael-s-molina Ephemeral environment spinning up at http://35.94.26.119:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.
@justinpark If you resize the left panel, it's cutting the text.
justinpark If you resize the left panel, it's cutting the text.
@michael-s-molina I fixed by the text ellipsis.
Ephemeral environment shutdown and build artifacts deleted.