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

refactor(async-select-and-search-select): refactor types in async-select- & search-select-input #3043

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

misama-ct
Copy link
Contributor

This are the changes from a previous PR. I cherry-picked those changes, added them on top of the current main-branch and resolved merge-issues as well as the remaining-issues caused by the changes that we did meanwhile.

Michael

🤖 Summary

This pull request focuses on enhancing type safety and flexibility for the TSearchSelectFieldProps and TAsyncSelectInputProps types in the search-select-field and async-select-input components. The changes introduce generic type parameters to these types, allowing for more precise typing and better support for various option, multi-select, and group configurations.

Key changes include:

Enhancements to Type Safety and Flexibility:

  • Generic Type Parameters for ReactSelectAsyncProps and TCustomEvent:

    • Introduced generic type parameters for ReactSelectAsyncProps and TCustomEvent to allow for more precise typing of options, multi-select, and groups. ([[1]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-d37b3a6d219648d2c7a5c398afed99038657c169c87f8cfff85ca8fbd6e920d4L23-R37), [[2]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-8583bf9581373c6db9fbe10aa7035c10cb55918d683af5f0d6dfee9f9e45c8fbL37-R63))
  • Generic Type Parameters for TSearchSelectFieldProps:

    • Added generic type parameters to TSearchSelectFieldProps to enhance type safety and support various configurations. Updated all relevant properties to use these generic parameters. ([[1]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-d37b3a6d219648d2c7a5c398afed99038657c169c87f8cfff85ca8fbd6e920d4L48-R60), [[2]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-d37b3a6d219648d2c7a5c398afed99038657c169c87f8cfff85ca8fbd6e920d4L74-R158), [[3]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-d37b3a6d219648d2c7a5c398afed99038657c169c87f8cfff85ca8fbd6e920d4L165-R199), [[4]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-d37b3a6d219648d2c7a5c398afed99038657c169c87f8cfff85ca8fbd6e920d4L181-R233), [[5]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-d37b3a6d219648d2c7a5c398afed99038657c169c87f8cfff85ca8fbd6e920d4L211-R292), [[6]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-d37b3a6d219648d2c7a5c398afed99038657c169c87f8cfff85ca8fbd6e920d4L251-R308))
  • Generic Type Parameters for TAsyncSelectInputProps:

    • Added generic type parameters to TAsyncSelectInputProps to improve type safety and flexibility. Updated all relevant properties to use these generic parameters. ([[1]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-8583bf9581373c6db9fbe10aa7035c10cb55918d683af5f0d6dfee9f9e45c8fbL1-R8), [[2]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-8583bf9581373c6db9fbe10aa7035c10cb55918d683af5f0d6dfee9f9e45c8fbL95-R140), [[3]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-8583bf9581373c6db9fbe10aa7035c10cb55918d683af5f0d6dfee9f9e45c8fbL124-R213), [[4]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-8583bf9581373c6db9fbe10aa7035c10cb55918d683af5f0d6dfee9f9e45c8fbL184-R271), [[5]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-8583bf9581373c6db9fbe10aa7035c10cb55918d683af5f0d6dfee9f9e45c8fbL232-R346))
  • Introduction of TOptionInnerPropsData Type:

    • Defined a new type TOptionInnerPropsData to represent the inner properties of options, enhancing clarity and type safety in the SearchSelectField component. ([packages/components/fields/search-select-field/src/search-select-field.tsxR382-R387](https://github.com/commercetools/ui-kit/pull/3043/files#diff-d37b3a6d219648d2c7a5c398afed99038657c169c87f8cfff85ca8fbd6e920d4R382-R387))

@misama-ct misama-ct requested a review from a team as a code owner January 16, 2025 12:12
@misama-ct misama-ct requested review from stephsprinkle, jaikamat, ddouglasz, tylermorrisford and ByronDWall and removed request for a team January 16, 2025 12:12
Copy link

changeset-bot bot commented Jan 16, 2025

⚠️ No Changeset found

Latest commit: d45d221

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

vercel bot commented Jan 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ui-kit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 17, 2025 10:04am

@ByronDWall
Copy link
Contributor

@misama-ct would it be possible to update the types for all the components that use react-select?

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