superset icon indicating copy to clipboard operation
superset copied to clipboard

chore(explore): Hide non-droppable metric and column list

Open justinpark opened this issue 1 year ago • 10 comments

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

justinpark avatar Mar 27 '24 20:03 justinpark

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.

codecov[bot] avatar Mar 27 '24 21:03 codecov[bot]

/testenv up

michael-s-molina avatar Mar 29 '24 18:03 michael-s-molina

@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 avatar Mar 29 '24 18:03 michael-s-molina

@michael-s-molina If you are interested in considering feedback, this proposal suggests adopting a Gmail-style approach. _DEV__Superset

cc: @kasiazjc

justinpark avatar Apr 02 '24 22:04 justinpark

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.

michael-s-molina avatar Apr 03 '24 11:04 michael-s-molina

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.

justinpark avatar Apr 03 '24 18:04 justinpark

/testenv up

michael-s-molina avatar Apr 04 '24 11:04 michael-s-molina

@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.

github-actions[bot] avatar Apr 04 '24 11:04 github-actions[bot]

@justinpark If you resize the left panel, it's cutting the text.

Screenshot 2024-04-04 at 08 48 03

michael-s-molina avatar Apr 04 '24 11:04 michael-s-molina

justinpark If you resize the left panel, it's cutting the text.

@michael-s-molina I fixed by the text ellipsis.

eclipsis

justinpark avatar Apr 05 '24 00:04 justinpark

Ephemeral environment shutdown and build artifacts deleted.

github-actions[bot] avatar Apr 05 '24 16:04 github-actions[bot]