Skip to content

Commit

Permalink
[Admin][DX] Add default aliases to autocomplete fields
Browse files Browse the repository at this point in the history
  • Loading branch information
NoResponseMate authored and GSadee committed May 13, 2024
1 parent 9516ad0 commit 72411ad
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
use Symfony\UX\Autocomplete\Form\AsEntityAutocompleteField;
use Symfony\UX\Autocomplete\Form\BaseEntityAutocompleteType;

#[AsEntityAutocompleteField(route: 'sylius_admin_entity_autocomplete_admin')]
#[AsEntityAutocompleteField(
alias: 'sylius_admin_product_attribute',
route: 'sylius_admin_entity_autocomplete_admin',
)]
final class ProductAttributeAutocompleteType extends AbstractType
{
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
use Symfony\UX\Autocomplete\Form\AsEntityAutocompleteField;
use Symfony\UX\Autocomplete\Form\BaseEntityAutocompleteType;

#[AsEntityAutocompleteField(route: 'sylius_admin_entity_autocomplete_admin')]
#[AsEntityAutocompleteField(
alias: 'sylius_admin_product',
route: 'sylius_admin_entity_autocomplete_admin',
)]
final class ProductAutocompleteType extends AbstractType
{
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
use Symfony\UX\Autocomplete\Form\AsEntityAutocompleteField;
use Symfony\UX\Autocomplete\Form\BaseEntityAutocompleteType;

#[AsEntityAutocompleteField(route: 'sylius_admin_entity_autocomplete_admin')]
#[AsEntityAutocompleteField(
alias: 'sylius_admin_product_variant',
route: 'sylius_admin_entity_autocomplete_admin',
)]
final class ProductVariantAutocompleteType extends AbstractType
{
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
use Symfony\UX\Autocomplete\Form\AsEntityAutocompleteField;
use Symfony\UX\Autocomplete\Form\BaseEntityAutocompleteType;

#[AsEntityAutocompleteField(route: 'sylius_admin_entity_autocomplete_admin')]
#[AsEntityAutocompleteField(
alias: 'sylius_admin_taxon',
route: 'sylius_admin_entity_autocomplete_admin',
)]
final class TaxonAutocompleteType extends AbstractType
{
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name="product_attributes"
data-model="selectedAttributeCodes"
{{ stimulus_controller('product-attribute-autocomplete', {
url: path('sylius_admin_entity_autocomplete_admin', { alias: 'product_attribute_autocomplete_type', 'extra_options': extraOptions }),
url: path('sylius_admin_entity_autocomplete_admin', { alias: 'sylius_admin_product_attribute', 'extra_options': extraOptions }),
selectedAttributeCodes: selectedAttributeCodes|join(','),
}) }}
/>
Expand Down

0 comments on commit 72411ad

Please sign in to comment.