refine icon indicating copy to clipboard operation
refine copied to clipboard

feat(core): added custom optionLabel

Open Conqxeror opened this issue 1 year ago • 5 comments

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] The commit message follows our guidelines: https://refine.dev/docs/guides-concepts/contributing/#commit-convention

Bugs / Features

  • [x] Related issue(s) linked
  • [x] Tests for the changes have been added
  • [ ] Docs have been added / updated
  • [x] Changesets have been added https://refine.dev/docs/guides-concepts/contributing/#creating-a-changeset

What is the current behavior?

What is the new behavior?

fixes #4880

Notes for reviewers

‼️ If provided changes meet the required changes than I should go further with docs. ‼️

Conqxeror avatar Feb 07 '24 13:02 Conqxeror

🦋 Changeset detected

Latest commit: 13c3e48abdb0013aa9610a659a3a956f94c2d382

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

changeset-bot[bot] avatar Feb 07 '24 13:02 changeset-bot[bot]

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 13c3e48abdb0013aa9610a659a3a956f94c2d382. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 73 targets

Sent with 💌 from NxCloud.

nx-cloud[bot] avatar Feb 07 '24 13:02 nx-cloud[bot]

Hey @Conqxeror thanks for the PR with great description as always!

Let's do the implementation according to the comment here: https://github.com/refinedev/refine/issues/4880#issuecomment-1742600902

optionValue and optionLabel params are currently string only, let's make each of them a union of string or function. And invoke the given function with item as in your implementation.

It would be amazing to implement similar changes for similar hooks other than @refinedev/core's useSelect.

@refinedev/antd has following hooks which can be refactored in a similar way:

  • useSelect
  • useRadioGroup
  • useCheckboxGroup

BatuhanW avatar Feb 08 '24 13:02 BatuhanW

Hey @Conqxeror thanks for the PR with great description as always!

Let's do the implementation according to the comment here: #4880 (comment)

optionValue and optionLabel params are currently string only, let's make each of them a union of string or function. And invoke the given function with item as in your implementation.

It would be amazing to implement similar changes for similar hooks other than @refinedev/core's useSelect.

@refinedev/antd has following hooks which can be refactored in a similar way:

  • useSelect
  • useRadioGroup
  • useCheckboxGroup

Thanks, @BatuhanW ! Your feedback is always appreciated. I always find your reviews great! I'll update optionValue and optionLabel as per the comment in #4880 (comment). Also, extending these changes to @refinedev/antd's useSelect, useRadioGroup, and useCheckboxGroup sounds great.

Conqxeror avatar Feb 08 '24 14:02 Conqxeror

Hello @BatuhanW I wanted to know if all the required changes are satisfied or not. If so then I can go further with the docs.

Review it whenever you are free, its okay if you take time.

Conqxeror avatar Feb 09 '24 21:02 Conqxeror