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

refactor: Sync Scoping tree with Forms data #12171

Merged
merged 14 commits into from
Jan 20, 2021
Merged

Conversation

simcha90
Copy link
Contributor

@simcha90 simcha90 commented Dec 22, 2020

SUMMARY

This PR add some functionality to Native Filters Modal config:

  1. Sync scoping tree in Native filters config modal:
  • Save selected scopes to redux
  • Get selected scopes from redux and populate them to the tree
  • Correct processing scoping per selected filter on left side of modal
  • Fixed Filters Scope in Native Filters form
  • Done some general refactoring in Scope tree

☝️ Scoping tree clone logic of old scope tree that worked with FilterBox filters. This tree save data in redux nativeFilters domain and in future this data will be used to filter specific charts

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Here example of redux/ui equality after tree items selected:
image (7)
image (6)

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

@codecov-io
Copy link

codecov-io commented Dec 22, 2020

Codecov Report

Merging #12171 (f934dae) into master (4d74cb3) will increase coverage by 0.14%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12171      +/-   ##
==========================================
+ Coverage   66.42%   66.56%   +0.14%     
==========================================
  Files        1015     1017       +2     
  Lines       49632    49691      +59     
  Branches     4839     4856      +17     
==========================================
+ Hits        32968    33078     +110     
+ Misses      16536    16489      -47     
+ Partials      128      124       -4     
Flag Coverage Δ
cypress 50.92% <28.00%> (-1.39%) ⬇️
javascript 60.79% <75.00%> (+0.05%) ⬆️
python 63.63% <ø> (-0.34%) ⬇️

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

Impacted Files Coverage Δ
superset-frontend/src/common/components/index.tsx 100.00% <ø> (ø)
...ard/components/nativeFilters/FilterConfigModal.tsx 62.80% <ø> (-0.23%) ⬇️
...nd/src/dashboard/components/nativeFilters/types.ts 100.00% <ø> (ø)
superset-frontend/src/dashboard/reducers/types.ts 0.00% <0.00%> (ø)
...nd/src/dashboard/components/nativeFilters/utils.ts 62.96% <71.42%> (+5.06%) ⬆️
...dashboard/components/nativeFilters/FilterScope.tsx 76.92% <76.92%> (ø)
...dashboard/components/nativeFilters/ScopingTree.tsx 81.81% <85.71%> (+4.04%) ⬆️
...oard/components/nativeFilters/FilterConfigForm.tsx 90.47% <100.00%> (+8.33%) ⬆️
...nd/src/dashboard/components/nativeFilters/state.ts 66.03% <100.00%> (+5.16%) ⬆️
superset/db_engines/hive.py 0.00% <0.00%> (-85.72%) ⬇️
... and 25 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 4d74cb3...f934dae. Read the comment docs.

@graceguo-supercat
Copy link

Can you summarize what are changes made in this PR? filter scope components are shared by filter_box and native filter component, we need to understand why these changes are necessary. thanks!

/** Chart state of redux */
export type Chart = {
id: number;
slice_id: 2107;

Choose a reason for hiding this comment

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

what is 2107 used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, you are right no need it, updating

@simcha90
Copy link
Contributor Author

Can you summarize what are changes made in this PR? filter scope components are shared by filter_box and native filter component, we need to understand why these changes are necessary. thanks!

We build this Scoping tree component instead old one, it placed in ConfigModal for native filters, it duplicates behaviour of old Scoping tree, but save it in nativeFilters redux location...
It's only part of work, we still need connect dashboard charts to this redux location instead old one
cc @amitmiran137 @villebro

@junlincc junlincc requested a review from ktmud January 1, 2021 22:37
@junlincc junlincc added the assigned:nielsen Assigned to the nielsen team label Jan 1, 2021
@villebro villebro closed this Jan 4, 2021
@villebro villebro reopened this Jan 4, 2021
@pull-request-size pull-request-size bot added size/L and removed size/XL labels Jan 4, 2021
@simcha90 simcha90 closed this Jan 11, 2021
@simcha90 simcha90 reopened this Jan 11, 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.

Code looks good and tested to correctly populate redux, thanks for this improvement! In the future let's split up refactoring and functional PRs.

@villebro villebro merged commit 2463215 into apache:master Jan 20, 2021
@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
assigned:nielsen Assigned to the nielsen team 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants