-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add filtering by code to vouchers in UI, fix e2e #6409
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
base: main
Are you sure you want to change the base?
Changes from all commits
d9c64f1
a0e68ca
0225d79
dc66282
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "saleor-dashboard": patch | ||
| --- | ||
|
|
||
| Gift cards filters now have option to filder by gift card code explicitly. Previously this was available only in search box, which uses `search` query, this however might not be available immediately after creating a gift card, due to indexing running in the background. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ import { | |||||
| CustomerHandler, | ||||||
| GiftCardTagsHandler, | ||||||
| type Handler, | ||||||
| NoopValuesHandler, | ||||||
| ProductsHandler, | ||||||
| } from "../Handler"; | ||||||
| import { getFilterElement } from "../utils"; | ||||||
|
|
@@ -35,6 +36,10 @@ const createAPIHandler = ( | |||||
| return new CustomerHandler(client, inputValue); | ||||||
| } | ||||||
|
|
||||||
| if (rowType === "giftCardCode") { | ||||||
|
||||||
| if (rowType === "giftCardCode") { | |
| if (rowType === "code") { |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -63,6 +63,7 @@ export const STATIC_CONDITIONS = { | |||||
| isPreorder: [{ type: "select", label: "is", value: "input-1" }], | ||||||
| isGiftCardUsed: [{ type: "select", label: "is", value: "input-1" }], | ||||||
| isGiftCardBought: [{ type: "select", label: "is", value: "input-1" }], | ||||||
| giftCardCode: [{ type: "text", label: "is", value: "input-1" }], | ||||||
|
||||||
| giftCardCode: [{ type: "text", label: "is", value: "input-1" }], | |
| code: [{ type: "text", label: "is", value: "input-1" }], |
Copilot
AI
Mar 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This left-operand entry sets type: "giftCardCode" but slug/value: "code". Because FilterElement.rowType() returns value.value (the slug), the API provider / query builder will see this row as "code", not "giftCardCode", and ConditionOptions will also look up conditions by the slug when parsing URL tokens. Consider making type match the slug (e.g. type: "code") to keep the filter consistent end-to-end.
| type: "giftCardCode", | |
| type: "code", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InitialGiftCardsStateResponsenow supports resolvingcodetokens viagetEntryByName, but the existing unit tests forfilterByUrlToken()don’t cover this new case (they cover currency/tags/products/usedBy/isActive). Add a test for thecodefield to ensure URL rehydration works and to catch regressions when adjusting thecode/giftCardCodenaming.