-
-
Notifications
You must be signed in to change notification settings - Fork 364
[Autocompleter] New Ajax-powered, autocomplete component #330
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
Conversation
use Symfony\Component\Uid\Ulid; | ||
use Symfony\Component\Uid\Uuid; | ||
|
||
class EntitySearchUtil |
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.
Most of the code in this directory - including this file - are taken directly from EasyAdmin. Hence the already-mature-looking code.
G R E A T 💯 |
Apparently, I just tripped over my keyboard :)
Tom Select (and this package) is focused on transforming |
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.
This is great, thanks Ryan!
@@ -17,7 +17,8 @@ | |||
"@babel/preset-env": "^7.15.8", | |||
"@babel/preset-react": "^7.15.8", | |||
"@babel/preset-typescript": "^7.15.8", | |||
"@rollup/plugin-node-resolve": "^13.0.0", | |||
"@rollup/plugin-commonjs": "^22.0.0", | |||
"@rollup/plugin-node-resolve": "^13.0.6", |
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.
Is this bump needed? The changelog doesn't seem to be related, but I may be wrong.
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.
Yea, it was - when I brought in commonjs, it gave me an error that said that 13.0.6 was required. A bit specific... but that was the reason :)
class CustomProductAutocompleter implements EntityAutocompleterInterface | ||
{ | ||
public function __construct( | ||
private RequestStack $requestStack |
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.
Single line
src/Autocomplete/tests/Fixtures/Form/CategoryAutocompleteType.php
Outdated
Show resolved
Hide resolved
public function mapDataToForms($data, $forms) | ||
{ | ||
$form = current(iterator_to_array($forms, false)); | ||
$form->setData($data); | ||
} | ||
|
||
public function mapFormsToData($forms, &$data) | ||
{ | ||
$form = current(iterator_to_array($forms, false)); | ||
$data = $form->getData(); | ||
} |
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.
what does this do?
Hi! A new component! One I've wanted for a LONG time. In short, it creates things that look like this, where the autocomplete search is backed by Ajax.
Big thanks to EasyAdmin, whose AssociationField heavily inspired this.
query_builder
(or perhaps other options that we might not want to include in the URL, likesecurity
), then you would still be required to have the extra class. It's something to explore.Cheers!
Recipe: symfony/recipes#1094