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

feat(cross-filters): add option to clear set cross filters #15500

Merged
merged 3 commits into from Jul 2, 2021

Conversation

villebro
Copy link
Member

@villebro villebro commented Jul 1, 2021

SUMMARY

This adds the option to clear emitted cross filters by adding an onClick to the cross filter indicator. Also fixes

AFTER

image

BEFORE

image

TESTING INSTRUCTIONS

  1. Enable the DASHBOARD_CROSS_FILTERS feature flag
  2. create a chart that supports cross filters and check the "emit cross filters" control
  3. add the chart to a dashboard
  4. emit a cross filter
  5. Hover on the cross filter indicator, see the updated tooltip and click on the indicator to clear emitted filters

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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

@apache apache deleted a comment from github-actions bot Jul 1, 2021
@apache apache deleted a comment from github-actions bot Jul 1, 2021
@michael-s-molina
Copy link
Member

/testenv up FEATURE_DASHBOARD_CROSS_FILTERS=true FEATURE_DASHBOARD_NATIVE_FILTERS=true

@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2021

@michael-s-molina Container image not yet published for this PR. Please try again when build is complete.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2021

@michael-s-molina Ephemeral environment creation failed. Please check the Actions logs for details.

@amitmiran137
Copy link
Member

/testenv up FEATURE_DASHBOARD_CROSS_FILTERS=true FEATURE_DASHBOARD_NATIVE_FILTERS=true

@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2021

@amitmiran137 Container image not yet published for this PR. Please try again when build is complete.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2021

@amitmiran137 Ephemeral environment creation failed. Please check the Actions logs for details.

@codecov
Copy link

codecov bot commented Jul 1, 2021

Codecov Report

Merging #15500 (c4f2752) into master (e606477) will decrease coverage by 0.17%.
The diff coverage is 57.60%.

❗ Current head c4f2752 differs from pull request most recent head 80f13f8. Consider uploading reports for the commit 80f13f8 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15500      +/-   ##
==========================================
- Coverage   77.20%   77.03%   -0.18%     
==========================================
  Files         975      976       +1     
  Lines       50842    51247     +405     
  Branches     6728     6897     +169     
==========================================
+ Hits        39251    39476     +225     
- Misses      11376    11552     +176     
- Partials      215      219       +4     
Flag Coverage Δ
javascript 71.51% <57.00%> (-0.25%) ⬇️

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

Impacted Files Coverage Δ
...et-frontend/src/SqlLab/reducers/getInitialState.js 50.00% <ø> (ø)
...rset-frontend/src/components/ErrorMessage/types.ts 100.00% <ø> (ø)
...ashboard/components/gridComponents/ChartHolder.jsx 74.73% <ø> (ø)
...ters/FiltersConfigModal/FiltersConfigForm/utils.ts 88.88% <0.00%> (ø)
...mponents/nativeFilters/FiltersConfigModal/utils.ts 75.34% <ø> (+7.84%) ⬆️
...filters/components/GroupBy/GroupByFilterPlugin.tsx 0.00% <0.00%> (ø)
...ntend/src/filters/components/Range/controlPanel.ts 100.00% <ø> (ø)
...RUD/data/database/DatabaseModal/SqlAlchemyForm.tsx 92.30% <0.00%> (-7.70%) ⬇️
...set-frontend/src/views/CRUD/data/database/types.ts 100.00% <ø> (ø)
...set-frontend/src/views/CRUD/welcome/EmptyState.tsx 87.17% <ø> (ø)
... and 55 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e606477...80f13f8. Read the comment docs.

@villebro
Copy link
Member Author

villebro commented Jul 1, 2021

/testenv up FEATURE_DASHBOARD_CROSS_FILTERS=true FEATURE_DASHBOARD_NATIVE_FILTERS=true

@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2021

@villebro Ephemeral environment spinning up at http://54.188.176.58:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@michael-s-molina
Copy link
Member

@villebro Some suggestions:

  • Vertical align the emit icon and the filter icon
  • Make the emit icon and the filter icon the same size (emit is bigger)
  • I think "Click to clear emitted filter" does not need to be bold because it's secondary information. After the first interaction, the user won't even read that anymore.

Comment on lines 156 to 164

export const FilterIndicatorText = styled.div`
padding-top: ${({ theme }) => theme.gridUnit * 3}px;
font-weight: ${({ theme }) => theme.typography.weights.bold};
max-width: 100%;
flex-grow: 1;
overflow: auto;
color: ${({ theme }) => theme.colors.grayscale.light5};
`;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
export const FilterIndicatorText = styled.div`
padding-top: ${({ theme }) => theme.gridUnit * 3}px;
font-weight: ${({ theme }) => theme.typography.weights.bold};
max-width: 100%;
flex-grow: 1;
overflow: auto;
color: ${({ theme }) => theme.colors.grayscale.light5};
`;
export const FilterIndicatorText = styled.div`
${({ theme }) => `
padding-top: ${theme.gridUnit * 3}px;
font-weight: ${theme.typography.weights.bold};
max-width: 100%;
flex-grow: 1;
overflow: auto;
color: ${theme.colors.grayscale.light5};
`}
`;

@villebro
Copy link
Member Author

villebro commented Jul 2, 2021

@villebro Some suggestions:

  • Vertical align the emit icon and the filter icon
  • Make the emit icon and the filter icon the same size (emit is bigger)

Good catch, I hadn't noticed that.

  • I think "Click to clear emitted filter" does not need to be bold because it's secondary information. After the first interaction, the user won't even read that anymore.

I agree, will make the change

@villebro
Copy link
Member Author

villebro commented Jul 2, 2021

/testenv down

@villebro villebro closed this Jul 2, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jul 2, 2021

Ephemeral environment shutdown and build artifacts deleted.

@villebro villebro reopened this Jul 2, 2021
@villebro
Copy link
Member Author

villebro commented Jul 2, 2021

/testenv up FEATURE_DASHBOARD_CROSS_FILTERS=true FEATURE_DASHBOARD_NATIVE_FILTERS=true

@github-actions
Copy link
Contributor

github-actions bot commented Jul 2, 2021

@villebro Ephemeral environment spinning up at http://35.166.31.72:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

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.

LGTM

@amitmiran137 amitmiran137 merged commit ee2ee48 into apache:master Jul 2, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jul 2, 2021

Ephemeral environment shutdown and build artifacts deleted.

amitmiran137 pushed a commit that referenced this pull request Jul 4, 2021
* feat(cross-filters): add option to clear set cross filters

* lint

* fix indicator size, remove bolded text and rephrase text

(cherry picked from commit ee2ee48)
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
)

* feat(cross-filters): add option to clear set cross filters

* lint

* fix indicator size, remove bolded text and rephrase text
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
)

* feat(cross-filters): add option to clear set cross filters

* lint

* fix indicator size, remove bolded text and rephrase text
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
)

* feat(cross-filters): add option to clear set cross filters

* lint

* fix indicator size, remove bolded text and rephrase text
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 labels Mar 12, 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 preset-io size/M v1.3 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants