Skip to content

Conversation

@mattsherman
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

This PR adds support for a suffix prop on __experimentalSelectControl.

New tests and stories were also added.

According to the acceptance criteria in #35426:

  • The suffix is shown on the right hand side of the select control's input field
  • If no suffix is set, a search icon is shown as the suffix
  • If a suffix is set, it is used instead of the default

Additionally (this wasn't spelled out in the acceptance criteria):

  • If suffix is set to null, no suffix is shown

I decided that a SelectControlSuffixWrapper wasn't necessary at this time. We have no immediate need for it, and we are providing a SuffixIcon component that can be used to easily set a custom icon while maintaining the correct styling.

If a need for a SelectControlSuffixWrapper arises in the future it will be addressed in a separate PR.

Closes #35426.

  • This PR is a very minor change/addition and does not require testing instructions (if checked you can ignore/remove the next section).

How to test the changes in this Pull Request:

  1. Run unit tests: pnpm --filter=@woocommerce/components run test -- src/experimental-select-control
  2. Interact with Storybook and make sure experimental > SelectControl stories render correctly. Especially the new, suffix-specific ones:
    • Custom Suffix
    • Custom Suffix icon
    • Default Suffix
    • No Suffix
  3. Go to Products > Add new (MVP)
  4. Verify the Categories select control renders properly

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you created a changelog file for each project being changed, ie pnpm --filter=<project> changelog add?

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

@mattsherman mattsherman added package: @woocommerce/components issues related to @woocommerce/components focus: components labels Dec 1, 2022
@mattsherman mattsherman self-assigned this Dec 1, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2022

Test Results Summary

Commit SHA: 7690f7f

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 57s
E2E Tests186006019215m 26s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@mattsherman mattsherman marked this pull request as ready for review December 1, 2022 22:08
Copy link
Contributor

@mdperez86 mdperez86 left a comment

Choose a reason for hiding this comment

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

LGTM. Nice work @mattsherman

@mattsherman mattsherman merged commit 4b58bef into trunk Dec 2, 2022
@mattsherman mattsherman deleted the add/select-control-suffix branch December 2, 2022 16:53
@github-actions github-actions bot added this to the 7.3.0 milestone Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: @woocommerce/components issues related to @woocommerce/components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

__experimentalSelectControl: Add suffix prop

3 participants