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

fix(native-filters): fix removing native filter #13688

Merged
merged 5 commits into from
Mar 18, 2021

Conversation

simcha90
Copy link
Contributor

@simcha90 simcha90 commented Mar 18, 2021

SUMMARY

Fix next flow:

  1. Have one native filter
  2. Add new native filter
  3. Choose values for second one
  4. Remove it

Actual: Charts not updated after second filter was removed
Expected: Charts should be updated after second filter was removed

Also it fix case that when native filters changed it was remove cross filters metadata

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@pull-request-size pull-request-size bot added size/M and removed size/S labels Mar 18, 2021
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM, small non-blocking comment

Comment on lines 31 to 35
export const getInitialMask = (id: string): MaskWithId => ({
id,
extraFormData: {},
currentState: {},
});
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason we're changing this to an arrow function? Personally I prefer to keep exported functions as vanilla functions vs arrows.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just preferred to use arrow functions to save order of functions declarations, but it's not critical, I can revert it

@codecov
Copy link

codecov bot commented Mar 18, 2021

Codecov Report

Merging #13688 (5ac87bb) into master (adc247b) will decrease coverage by 4.43%.
The diff coverage is 92.06%.

❗ Current head 5ac87bb differs from pull request most recent head 52389ef. Consider uploading reports for the commit 52389ef to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13688      +/-   ##
==========================================
- Coverage   77.40%   72.96%   -4.44%     
==========================================
  Files         924      614     -310     
  Lines       46863    22039   -24824     
  Branches     5657     5867     +210     
==========================================
- Hits        36272    16081   -20191     
+ Misses      10455     5822    -4633     
  Partials      136      136              
Flag Coverage Δ
cypress 56.47% <73.21%> (-0.12%) ⬇️
hive ?
javascript 63.17% <49.20%> (+0.01%) ⬆️
mysql ?
postgres ?
presto ?
python ?
sqlite ?

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

Impacted Files Coverage Δ
...et-frontend/src/dashboard/actions/nativeFilters.ts 60.00% <ø> (-4.11%) ⬇️
superset-frontend/src/dataMask/actions.ts 75.00% <ø> (ø)
...et-frontend/src/filters/components/Select/types.ts 100.00% <ø> (ø)
...nd/src/filters/components/Select/transformProps.ts 81.81% <71.42%> (-3.90%) ⬇️
...c/filters/components/Select/SelectFilterPlugin.tsx 80.95% <75.00%> (+1.46%) ⬆️
...d/components/nativeFilters/FilterBar/FilterBar.tsx 92.42% <100.00%> (+0.55%) ⬆️
superset-frontend/src/dataMask/reducer.ts 100.00% <100.00%> (ø)
...ontend/src/filters/components/Select/buildQuery.ts 77.77% <100.00%> (+20.63%) ⬆️
superset-frontend/src/filters/utils.ts 95.23% <100.00%> (+6.34%) ⬆️
superset-frontend/src/utils/common.js 87.71% <100.00%> (+0.44%) ⬆️
... and 323 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 adc247b...52389ef. Read the comment docs.

@villebro villebro merged commit 7e6beb5 into apache:master Mar 18, 2021
@junlincc junlincc added the dashboard:native-filters Related to the native filters of the Dashboard label Mar 18, 2021
allanco91 pushed a commit to allanco91/superset that referenced this pull request May 21, 2021
* fix: fix removeing native filter

* fix: fix native-cross filters

* fix: fix native-cross filters

* fix: fix native-cross filters

* fix: fix function declaration
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.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 dashboard:native-filters Related to the native filters of the Dashboard size/M 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants