-
-
Notifications
You must be signed in to change notification settings - Fork 340
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
[Autocomplete] Configurable results #2541
Conversation
I'm not sure why I am getting failures related to "direct deprecation notices" on [LiveComponent] (see https://github.com/symfony/ux/actions/runs/13069237861/job/36467092283?pr=2541 and https://github.com/symfony/ux/actions/runs/13069237861/job/36467096825?pr=2541) when I didn't update this component nor anything related to |
Thank you for the PR, this feature (and the effort to improve things passing by -- docblocks for static analysis)! Minor changes to match existing DX / wording in symfony/form, and maybe add one or two tests to check everything work if the method is not implemented, or does not override getValue/getText On an implementation level, you should probably do something like this in the formatResult method $attributes = [];
if (method_exists(.....
....
}
return [
...$attributes,
'value' => $autocompleter->getValue(),
'text' => $autocompleter->getText(),
]; |
Thanks for your review. I like your idea of merging extra attributes into an array containing the text and the value. WDYT of the latest version of my branch? |
src/Autocomplete/tests/Fixtures/Autocompleter/CustomAttributesProductAutocompleter.php
Outdated
Show resolved
Hide resolved
Tiny details, then lets see the CI failures and LGTM :) Would you be ok (on another PR) to write a paragraph + example about this in the documentation ? I can help if you need / want. |
Ok everything should be fine now 👍🏻 Regarding the failing tests however,
However there is no Edit: I found the failing tests and I fixed them 🥳 |
No worries for writing a bit of documentation, could you just point me the place and the kind of doc you expect? |
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.
👍 for me!
Nice PR and thank you @J-Ben87
@Kocal Is that all good for you too? Your change request is still pending |
What is the next step to have this PR merged? Sorry if it's obvious, but like I said I'm not used to contribute so I'm confused about the next steps 😕 |
@Kocal gave the second approval today, so we will merge it soon :) Often, we let some time for all maintainers to see the PR, as we are not all on the same timezone and we all need to find the good balance between day jobs, family life, and open source. So here, the next steps are: Merged: Released:
It's not obvious :) And welcome aboard! |
Thanks for your work on this new feature! |
Thanks for your guidance and your availability 🙏🏻 |
TomSelect accepts by default an array of results, each item containing a "text" and a "value".
Therefore this bundle exposes results formatted like so.
However one may need to expose additional data such as a "disabled" state to customize TomSelect's rendering.
This PR aims to offer this possibility by letting
EntityAutocompleter
s drive the creation of the results array.