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

Adding support for filter box in annotations #8057

Merged
merged 3 commits into from
Aug 20, 2019
Merged

Conversation

KKcorps
Copy link
Contributor

@KKcorps KKcorps commented Aug 16, 2019

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

Filter box values are now passed to the annotation layer. This resolves the issue when you use Time series chart as an annotation.
Before this change, changing the time range or other filters in Filter box only modifying the chart but not the annotations. However, now the annotations are modified as well.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

BEFORE

Screen Shot 2019-08-16 at 3 54 43 PM

AFTER

Screen Shot 2019-08-16 at 3 56 19 PM

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

REVIEWERS

@LilianXie
Copy link

src/visualizations/FilterBox/FilterBox.jsx

    // Add created options to filtersChoices, even though it doesn't exist,
    // or these options will exist in query sql but invisible to end user.
    Object.keys(selectedValues)
      .filter(key => !selectedValues.hasOwnProperty(key)
        || !(key in filtersChoices))
      .forEach((key) => {
        const choices = filtersChoices[key] || [];
        const choiceIds = new Set(choices.map(f => f.id));
        Array.isArray(selectedValues[key])?selectedValues[key]:[selectedValues[key]]
          .filter(value => !choiceIds.has(value))
          .forEach((value) => {
            choices.unshift({
              filter: key,
              id: value,
              text: value,
              metric: 0,
            });
          });
      });

@kristw kristw merged commit ae16e69 into apache:master Aug 20, 2019
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.35.0 labels Feb 28, 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 size/XS 🚢 0.35.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants