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: Select all issue with "Dynamically search all filter values" in FilterBar #23400

Merged
merged 1 commit into from
Mar 17, 2023

Conversation

geido
Copy link
Member

@geido geido commented Mar 16, 2023

SUMMARY

When the search was conducted using the "Dynamically search all filter values" in FilterBar, the original options got lost and the Select component was selecting all values as a consequence.

This PR fixes that by keeping the initial data in state and merging it with the new options as they are added.

BEFORE

sc-66800.mp4

AFTER

Unicode.Test.mp4

TESTING INSTRUCTIONS

  1. In FilterBar add a new filter with the "Dynamically search all filter values"
  2. Write a new value
  3. Select the value
  4. Make sure only the selected value is selected

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented Mar 16, 2023

Codecov Report

Merging #23400 (3ca291e) into master (870bf6d) will increase coverage by 0.00%.
The diff coverage is 70.83%.

❗ Current head 3ca291e differs from pull request most recent head 1d6d613. Consider uploading reports for the commit 1d6d613 to get more accurate results

@@           Coverage Diff           @@
##           master   #23400   +/-   ##
=======================================
  Coverage   67.58%   67.59%           
=======================================
  Files        1907     1907           
  Lines       73530    73536    +6     
  Branches     7980     7981    +1     
=======================================
+ Hits        49697    49703    +6     
  Misses      21785    21785           
  Partials     2048     2048           
Flag Coverage Δ
javascript 53.83% <70.83%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...c/filters/components/Select/SelectFilterPlugin.tsx 65.47% <70.83%> (+2.65%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jinghua-qa
Copy link
Member

/testenv up FEATURE_DASHBOARD_CROSS_FILTERS=true FEATURE_HORIZONTAL_FILTER_BAR=true

@github-actions
Copy link
Contributor

@jinghua-qa Ephemeral environment spinning up at http://34.214.29.212:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@jinghua-qa
Copy link
Member

Test the PR locally, the issue have been fixed. LGTM

@@ -120,6 +121,7 @@ export default function PluginFilterSelect(props: PluginFilterSelectProps) {
}),
[],
);
const [initialData, setInitialData] = useState<typeof data>([]);
Copy link
Member

Choose a reason for hiding this comment

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

Could we explicitly type it as DataRecord[]?

Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

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

Tested, works great! 1 non blocking nit

@geido geido merged commit 2fe695d into master Mar 17, 2023
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

jinghua-qa pushed a commit to preset-io/superset that referenced this pull request Mar 17, 2023
jinghua-qa pushed a commit to preset-io/superset that referenced this pull request Mar 20, 2023
eschutho pushed a commit that referenced this pull request Jul 7, 2023
@mistercrunch mistercrunch added 🍒 2.1.1 🍒 2.1.2 🍒 2.1.3 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 labels Mar 13, 2024
@mistercrunch mistercrunch deleted the fix/select-all-multi branch March 26, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.1.1 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels preset:2023.11 size/M v2.1 🍒 2.1.1 🍒 2.1.2 🍒 2.1.3 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants