Skip to content

[3.22] Fix filter for boolean attributes#6523

Merged
lkostrowski merged 1 commit into
3.22from
fix-boolean-attribute
Apr 17, 2026
Merged

[3.22] Fix filter for boolean attributes#6523
lkostrowski merged 1 commit into
3.22from
fix-boolean-attribute

Conversation

@lkostrowski
Copy link
Copy Markdown
Member

port of #6522

@lkostrowski lkostrowski requested a review from a team as a code owner April 17, 2026 11:30
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 17, 2026

🦋 Changeset detected

Latest commit: 742daba

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes ConditionalFilter option fetching for boolean attributes by returning static Yes/No options instead of querying attribute choices from the API (port of saleor-dashboard#6522).

Changes:

  • Pass attribute type through AttributeQueryVarsBuilder into AttributeChoicesHandler.
  • Short-circuit AttributeChoicesHandler.fetch() for AttributeInputTypeEnum.BOOLEAN to return createBooleanOptions() without an API call.
  • Add a unit test asserting no GraphQL query is executed and the static boolean options are returned.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/components/ConditionalFilter/FiltersQueryBuilder/queryVarsBuilders/AttributeQueryVarsBuilder.ts Threads attribute type into the default attribute choices handler.
src/components/ConditionalFilter/FiltersQueryBuilder/queryVarsBuilders/AttributeQueryVarsBuilder.test.ts Adds coverage to ensure boolean attributes return static options and skip API calls.
src/components/ConditionalFilter/API/Handler.ts Implements boolean short-circuit in AttributeChoicesHandler using createBooleanOptions().
.changeset/purple-glasses-try.md Records a patch changeset for the boolean attribute filter fix.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (3.22@e8507ff). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             3.22    #6523   +/-   ##
=======================================
  Coverage        ?   43.56%           
=======================================
  Files           ?     2585           
  Lines           ?    45029           
  Branches        ?    10592           
=======================================
  Hits            ?    19615           
  Misses          ?    24080           
  Partials        ?     1334           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lkostrowski lkostrowski merged commit cfb7076 into 3.22 Apr 17, 2026
19 of 21 checks passed
@lkostrowski lkostrowski deleted the fix-boolean-attribute branch April 17, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants