Skip to content

Fix gift card customer select#6515

Merged
lkostrowski merged 3 commits into
3.22from
fix-giftcard
Apr 16, 2026
Merged

Fix gift card customer select#6515
lkostrowski merged 3 commits into
3.22from
fix-giftcard

Conversation

@lkostrowski
Copy link
Copy Markdown
Member

Port of #6513

Fixes `pnpm install` command failing due to not having PNPM installed

Fix behavior of gift card customer selection
Copilot AI review requested due to automatic review settings April 15, 2026 12:55
@lkostrowski lkostrowski requested a review from a team as a code owner April 15, 2026 12:55
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 15, 2026

🦋 Changeset detected

Latest commit: d15c670

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

Adjusts the Gift Card “Customer” selector in the create dialog to avoid the previous buggy “type an email as an option” combobox behavior by introducing an explicit “use custom email” action.

Changes:

  • Removes injecting typed custom-email entries into the DynamicCombobox options list.
  • Adds derived customEmail state and renders a separate action button to select it.
  • Adds a changeset entry documenting the behavior change.

Reviewed changes

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

File Description
src/giftCards/GiftCardCreateDialog/GiftCardCustomerSelectField.tsx Refactors customer selection options and introduces a separate custom-email selection action.
.changeset/wacky-guests-joke.md Adds a patch changeset describing the updated customer attachment behavior.

Comment thread src/giftCards/GiftCardCreateDialog/GiftCardCustomerSelectField.tsx Outdated
Comment thread src/giftCards/GiftCardCreateDialog/GiftCardCustomerSelectField.tsx
Comment thread src/giftCards/GiftCardCreateDialog/GiftCardCustomerSelectField.tsx Outdated
"saleor-dashboard": patch
---

Changed behavior of Gift Card customer attachment, now it will show a separate button for custom value instead of buggy combobox
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

The changeset text reads a bit informal/unclear for a changelog entry (e.g., "buggy combobox"). Consider rephrasing as a concise, user-facing release note (and adding punctuation), describing that selecting a custom email for gift card customer is now done via a separate action/button.

Suggested change
Changed behavior of Gift Card customer attachment, now it will show a separate button for custom value instead of buggy combobox
Selecting a custom email for a gift card customer is now done using a separate button instead of the customer attachment combobox.

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2026

Codecov Report

❌ Patch coverage is 3.44828% with 28 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (3.22@488a9fc). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...ftCardCreateDialog/GiftCardCustomerSelectField.tsx 3.44% 28 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             3.22    #6515   +/-   ##
=======================================
  Coverage        ?   43.55%           
=======================================
  Files           ?     2585           
  Lines           ?    45025           
  Branches        ?    10550           
=======================================
  Hits            ?    19611           
  Misses          ?    25374           
  Partials        ?       40           

☔ 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.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 15, 2026 13:11
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

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

Comment on lines +136 to +147
{customEmail && (
<Box>
<Button
display="inline-block"
variant="tertiary"
onClick={() => {
setInputValue(customEmail);
setSelectedCustomer({
email: customEmail,
name: customEmail,
});
}}
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

The newly added "Use email" action remains clickable even when the field is disabled. This means users can still change selectedCustomer while the form is in a disabled/loading state. Pass the disabled prop through to the Button (or avoid rendering the action when disabled) to keep behavior consistent with the combobox.

Copilot uses AI. Check for mistakes.
Comment on lines +51 to +55
const customEmail = useMemo((): string | null => {
const trimmedCustomValue = inputValue.trim();

if (!hasExactMatch) {
opts.unshift({
label: `${intl.formatMessage(messages.useEmail)} ${trimmed}`,
value: trimmed,
});
}
if (
selectedCustomer.email &&
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

The newly introduced customEmail derivation is not covered by tests. Add a component-level test that types a valid, non-matching email and asserts the separate "Use email" action appears, then click it and assert it updates the selected customer and the action disappears.

Copilot uses AI. Check for mistakes.
@lkostrowski lkostrowski merged commit 040a627 into 3.22 Apr 16, 2026
19 of 21 checks passed
@lkostrowski lkostrowski deleted the fix-giftcard branch April 16, 2026 09:28
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