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(native-filters): decouple params from filter config modal (first phase) #13021

Merged
merged 9 commits into from
Feb 14, 2021

Conversation

simcha90
Copy link
Contributor

@simcha90 simcha90 commented Feb 9, 2021

SUMMARY

This PR decouple hardcoded per filter params from Filter config modal.
Now they generated dynamically based on controlPanel config.
In first phase we take all params that have renderTrigger property and render them in the bottom of the Modal.
also we added new property resetConfig to reset defaultValue if current property is changed

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen.Recording.2021-02-09.at.9.12.21.mov

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

@junlincc junlincc added the dashboard:native-filters Related to the native filters of the Dashboard label Feb 9, 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.

A few first pass comments, let me know what you think.

@codecov-io
Copy link

codecov-io commented Feb 9, 2021

Codecov Report

Merging #13021 (d276974) into master (2ce7982) will increase coverage by 19.78%.
The diff coverage is 51.07%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #13021       +/-   ##
===========================================
+ Coverage   53.06%   72.84%   +19.78%     
===========================================
  Files         489      553       +64     
  Lines       17314    20276     +2962     
  Branches     4482     5301      +819     
===========================================
+ Hits         9187    14770     +5583     
+ Misses       8127     5381     -2746     
- Partials        0      125      +125     
Flag Coverage Δ
cypress 53.40% <57.81%> (+0.34%) ⬆️
javascript 61.69% <32.97%> (?)

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

Impacted Files Coverage Δ
...end/src/SqlLab/components/RunQueryActionButton.tsx 64.28% <ø> (+11.50%) ⬆️
superset-frontend/src/chart/ChartContainer.jsx 100.00% <ø> (ø)
superset-frontend/src/chart/ChartRenderer.jsx 77.02% <0.00%> (+0.31%) ⬆️
...perset-frontend/src/common/components/Dropdown.tsx 54.76% <ø> (+4.76%) ⬆️
...ontend/src/components/ListViewCard/ImageLoader.tsx 86.36% <0.00%> (+11.36%) ⬆️
...set-frontend/src/components/URLShortLinkButton.jsx 100.00% <ø> (ø)
...src/dashboard/components/HeaderActionsDropdown.jsx 71.23% <ø> (+3.66%) ⬆️
...end/src/dashboard/components/StickyVerticalBar.tsx 100.00% <ø> (ø)
...iveFilters/FilterConfigModal/FilterConfigModal.tsx 89.79% <ø> (+10.79%) ⬆️
...omponents/nativeFilters/FilterConfigModal/types.ts 100.00% <ø> (ø)
... and 468 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 bc4c837...d276974. Read the comment docs.

amitmiran137 and others added 4 commits February 10, 2021 10:34
* master:
  fix: UI toast typo (apache#13026)
  feat(db engines): add support for Opendistro Elasticsearch (AWS ES) (apache#12602)
  fix(build): black failing on master, add to required checks (apache#13039)
  fix: time filter db migration optimization (apache#13015)
  fix: untranslated text content of Dashboard page (apache#13024)
  fix(ci): remove signature requirements for commits to master (apache#13034)
  fix: add alerts and report to default config (apache#12999)
  docs(changelog): add entries for 1.0.1 (apache#12981)
  ci: skip cypress if no code changes (apache#12982)
  chore: add cypress required checks for branch protection (apache#12970)
  Refresh dashboard list after bulk delete (apache#12945)
  Updates storybook to version 6.1.17 (apache#13014)
  feat: Save datapanel state in local storage (apache#12996)
  fix: added text and changed margins (apache#12923)
  chore: Swap Slack Url 2 more places (apache#13004)
…sen/incubator-superset into decouple_filter_config_params
Comment on lines +321 to +323
if (!controlItem.config.resetConfig) {
return;
}
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
if (!controlItem.config.resetConfig) {
return;
}
if (!isValidChange(controlItem.config)) {
return;
}

extract !controlItem.config.resetConfig to isValidChange(config)

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.

Small nit; other than that + a rebase to resolve conflict this LGTM and one of the last steps needed to fully decouple filters 🎉

…ter_config_params

� Conflicts:
�	superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterValue.tsx
@villebro villebro merged commit 2010e64 into apache:master Feb 14, 2021
amitmiran137 pushed a commit to nielsen-oss/superset that referenced this pull request Feb 14, 2021
…irst phase) (apache#13021)

* refactor: decouple params from filter config modal (first phase)

* refactor: remove unnecessary fields

* refactor: fix CR notes

* fix: fix controlValues

* refactor: fix Cr notes

Co-authored-by: amitmiran137 <[email protected]>
amitmiran137 pushed a commit to nielsen-oss/superset that referenced this pull request Feb 14, 2021
* master: (30 commits)
  refactor(native-filters): decouple params from filter config modal (first phase) (apache#13021)
  fix(native-filters): set currentValue null when empty (apache#13000)
  Custom superset_config.py + secret envs (apache#13096)
  Update http error code from 400 to 403 (apache#13061)
  feat(native-filters): add storybook entry for select filter (apache#13005)
  feat(native-filters): Time native filter (apache#12992)
  Force pod restart on config changes (apache#13056)
  feat(cross-filters): add cross filters (apache#12662)
  fix(explore): Enable selecting an option not included in suggestions (apache#13029)
  Improves RTL configuration (apache#13079)
  Added a note about the ! prefix for breaking changes to CONTRIBUTING.md (apache#13083)
  chore: lock down npm to v6 (apache#13069)
  fix: API tests, make them possible to run independently again (apache#13076)
  fix: add config to disable dataset ownership on the old api (apache#13051)
  add required * indicator to message content/notif method (apache#12931)
  fix: Retroactively add granularity param to charts (apache#12960)
  fix(ci): multiline regex in change detection (apache#13075)
  feat(style): hide dashboard header by url parameter (apache#12918)
  fix(explore): pie chart label bugs (apache#13052)
  fix: Disabled state button transition time (apache#13008)
  ...
@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/L 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants