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: Displaying filter indicators #12252

Merged
merged 2 commits into from Jan 14, 2021

Conversation

agatapst
Copy link
Contributor

@agatapst agatapst commented Jan 4, 2021

SUMMARY

The problem was that chart indicator did not match native filter indicator and this PR fixes that.
Be aware that there is still filter component next to the charts. It is separated from the native filters, but has impact on the same charts. It also counts as "Applied filter".

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
indicator_1_before
image

After:
indicator_1_after
indicator_2_after

TEST PLAN

Verify manually. Go to config.py and set "DASHBOARD_NATIVE_FILTERS": True
Go to a dashboard and create Native Filter.
Click an indicator presented on the charts (dark gray pill with a number). See if the information matches your filter.

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

cc @junlincc @villebro
@adam-stasiak could you please test?

@agatapst agatapst changed the title fix: Chart filter indicator matches native filter indicator fix: Displaying filter indicators Jan 4, 2021
@codecov-io
Copy link

codecov-io commented Jan 4, 2021

Codecov Report

Merging #12252 (9d02034) into master (7aba4c2) will decrease coverage by 2.21%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12252      +/-   ##
==========================================
- Coverage   66.29%   64.08%   -2.22%     
==========================================
  Files        1015      486     -529     
  Lines       49554    29921   -19633     
  Branches     5079        0    -5079     
==========================================
- Hits        32854    19176   -13678     
+ Misses      16562    10745    -5817     
+ Partials      138        0     -138     
Flag Coverage Δ
cypress ?
javascript ?
python 64.08% <ø> (ø)

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

Impacted Files Coverage Δ
...components/AdhocFilterEditPopoverSqlTabContent.jsx
superset-frontend/src/components/Button/index.tsx
...rontend/src/dashboard/util/shouldWrapChildInRow.js
superset-frontend/src/chart/Chart.jsx
superset-frontend/src/components/ListView/index.ts
superset-frontend/src/components/Popover/index.tsx
...d/src/visualizations/TimeTable/FormattedNumber.jsx
...explore/components/controls/ColorSchemeControl.jsx
...d/src/dashboard/components/gridComponents/index.js
...frontend/src/dashboard/reducers/dashboardLayout.js
... and 517 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 7aba4c2...9d02034. Read the comment docs.

@adam-stasiak
Copy link
Contributor

@agatapst I can see situation where child filters are not displayed as set when I use them:
Zrzut ekranu 2021-01-5 o 11 55 17
Zrzut ekranu 2021-01-5 o 11 55 23
I think it should be displayed under APPLIED FILTERS section

@adam-stasiak
Copy link
Contributor

After second test it is ok! no issue from above message

@junlincc junlincc self-requested a review January 12, 2021 18:02
Copy link
Member

@junlincc junlincc left a comment

Choose a reason for hiding this comment

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

LGTM!
After
Screen Shot 2021-01-12 at 8 56 52 AM

Before
Screen Shot 2021-01-12 at 8 31 42 AM

NOTE⚠️:

  • This is only Product and QA approval with NO code reviews
  • This approval indicates that all UI changes meet product requirements, no noticeable regression
  • This approval gives the green light to code review, thus saving the PMC's effort from reviewing the code repeatedly before the PR is ready
  • Please do NOT merge this PR without at least one code review approval from PMC member
  • Please do NOT merge PRs in(Explore and Dashboard) without Product and QA approval

chartId,
dashboardFilters,
datasources,
charts,
);

const nativeIndicators = selectNativeIndicatorsForChart(nativeFilters);

const indicators = nativeIndicators.reduce((acc, indicator) => {
Copy link
Member

@suddjian suddjian Jan 12, 2021

Choose a reason for hiding this comment

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

I would suggest using uniqBy here instead of reduce.

Copy link
Member

Choose a reason for hiding this comment

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

On second thought, you'd probably have to use uniqWith, not uniqBy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, that's a nice tip!

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

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

LGTM!

@rusackas
Copy link
Member

Pinged @suddjian for feedback, and he left some seconds before I approved! I think it's good advice if you don't mind the quick tweak.

@rusackas rusackas merged commit 57e37ed into apache:master Jan 14, 2021
@junlincc junlincc added the dashboard:native-filters Related to the native filters of the Dashboard label Jan 16, 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
🏷️ 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.

None yet

7 participants