Skip to content
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

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

Merged

Conversation

justinpark
Copy link
Member

@justinpark justinpark commented Mar 27, 2024

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:

before--hide-disallow-list.mov

After:

after--hide-disallow-list.mov

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

Copy link

codecov bot commented Mar 27, 2024

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 ⚠️
.../src/explore/components/ExploreContainer/index.tsx 90.00% 1 Missing ⚠️
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%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR @justinpark.

const allowedColumns = useMemo(() => {
const validators = Object.values(dropzones);
if (!isArray(_columns)) return [];
return allowlistOnly
Copy link
Member

@michael-s-molina michael-s-molina Mar 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justinpark If we have the concept of validators where every item is checked to see if it's allowed, similar to a security check, wouldn't be the responsibility of the validator to check for disallow_adhoc_metrics? In other words, could we always validate the items with the default implementation being that all items are allowed? This would give us the flexibility to show/hide items depending on any type of condition.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other words, could we always validate the items with the default implementation being that all items are allowed?

@michael-s-molina As mentioned earlier, in the adhoc query, all columns and metrics are accepted. Therefore, applying additional filtering in cases where non-disallowed-adhoc case can be considered unnecessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We synced offline and will ensure that these filters are not affected by the 'disallow-adhoc' condition.

@john-bodley john-bodley added the review:checkpoint Last PR reviewed during the daily review standup label Mar 28, 2024
@justinpark justinpark changed the title chore(explore): Hide ineligible metric and column list chore(explore): Hide non-droppable metric and column list Mar 28, 2024
@justinpark justinpark force-pushed the chore--explore-filter-out-ineligible-list branch from 92ea7fe to 7fb999a Compare March 28, 2024 18:44
@john-bodley john-bodley removed the review:checkpoint Last PR reviewed during the daily review standup label Mar 29, 2024
@michael-s-molina
Copy link
Member

/testenv up

@michael-s-molina
Copy link
Member

michael-s-molina commented Mar 29, 2024

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

@justinpark
Copy link
Member Author

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

cc: @kasiazjc

@michael-s-molina
Copy link
Member

michael-s-molina commented Apr 3, 2024

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.

@justinpark
Copy link
Member Author

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.

@michael-s-molina
Copy link
Member

/testenv up

Copy link
Contributor

github-actions bot commented Apr 4, 2024

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

@michael-s-molina
Copy link
Member

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

Screenshot 2024-04-04 at 08 48 03

@pull-request-size pull-request-size bot added size/XL and removed size/L labels Apr 5, 2024
@justinpark
Copy link
Member Author

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

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

eclipsis

@justinpark justinpark merged commit eda304b into apache:master Apr 5, 2024
34 of 35 checks passed
Copy link
Contributor

github-actions bot commented Apr 5, 2024

Ephemeral environment shutdown and build artifacts deleted.

EandrewJones pushed a commit to UMD-ARLIS/superset that referenced this pull request Apr 5, 2024
@john-bodley john-bodley added the v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch label Apr 10, 2024
michael-s-molina pushed a commit that referenced this pull request Apr 10, 2024
EnxDev pushed a commit to EnxDev/superset that referenced this pull request Apr 12, 2024
qleroy pushed a commit to qleroy/superset that referenced this pull request Apr 28, 2024
@mistercrunch mistercrunch added 🍒 4.0.1 🍒 4.0.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Jul 24, 2024
irublev pushed a commit to HighviewPower/superset that referenced this pull request Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XL v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch 🍒 4.0.1 🍒 4.0.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants