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

Add columns in options and attributes grid #194

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Form/Extension/ProductOptionTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ public function buildForm(FormBuilderInterface $builder, array $options): void

$builder
->add('searchable', CheckboxType::class, [
'label' => 'monsieurbiz_searchplugin.admin.product_attribute.form.searchable',
'label' => 'monsieurbiz_searchplugin.admin.product_option.form.searchable',
'required' => true,
])
->add('filterable', CheckboxType::class, [
'label' => 'monsieurbiz_searchplugin.admin.product_attribute.form.filterable',
'label' => 'monsieurbiz_searchplugin.admin.product_option.form.filterable',
'required' => true,
])
->add('search_weight', ChoiceType::class, [
'label' => 'monsieurbiz_searchplugin.admin.product_attribute.form.search_weight',
'label' => 'monsieurbiz_searchplugin.admin.product_option.form.search_weight',
'required' => true,
'choices' => array_combine($searchWeightValues, $searchWeightValues),
])
Expand Down
1 change: 1 addition & 0 deletions src/Resources/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ imports:
- { resource: "monsieurbiz_search.yaml" }
- { resource: "sylius/ui.yaml" }
- { resource: "sylius/fixtures.yaml" }
- { resource: "sylius/grids.yaml" }
- { resource: "monsieurbiz/settings.yaml" }
- { resource: "messenger.yaml" }

Expand Down
52 changes: 52 additions & 0 deletions src/Resources/config/sylius/grids.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
sylius_grid:
grids:
sylius_admin_product_attribute:
fields:
filterable:
type: twig
label: monsieurbiz_searchplugin.admin.product_attribute.form.filterable
sortable: ~
options:
template: "@SyliusUi/Grid/Field/yesNo.html.twig"
searchable:
type: twig
label: monsieurbiz_searchplugin.admin.product_attribute.form.searchable
sortable: ~
options:
template: "@SyliusUi/Grid/Field/yesNo.html.twig"
searchWeight:
label: monsieurbiz_searchplugin.admin.product_attribute.form.search_weight_short_label
type: string
sortable: ~
filters:
filterable:
type: boolean
label: monsieurbiz_searchplugin.admin.product_attribute.form.filterable
searchable:
type: boolean
label: monsieurbiz_searchplugin.admin.product_attribute.form.searchable
sylius_admin_product_option:
fields:
filterable:
type: twig
label: monsieurbiz_searchplugin.admin.product_option.form.filterable
sortable: ~
options:
template: "@SyliusUi/Grid/Field/yesNo.html.twig"
searchable:
type: twig
label: monsieurbiz_searchplugin.admin.product_option.form.searchable
sortable: ~
options:
template: "@SyliusUi/Grid/Field/yesNo.html.twig"
searchWeight:
label: monsieurbiz_searchplugin.admin.product_option.form.search_weight_short_label
type: string
sortable: ~
filters:
filterable:
type: boolean
label: monsieurbiz_searchplugin.admin.product_option.form.filterable
searchable:
type: boolean
label: monsieurbiz_searchplugin.admin.product_option.form.searchable
4 changes: 4 additions & 0 deletions src/Resources/translations/messages.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ monsieurbiz_searchplugin:
filterable: Filterable
searchable: Searchable
search_weight: Search Weight
search_weight_short_label: Weight
product_option:
form:
title: Search
filterable: Filterable
searchable: Searchable
search_weight: Search Weight
search_weight_short_label: Weight
setting_form:
instant_search_enabled_monsieurbiz_product: 'Product: Instant search enabled'
limit_search_monsieurbiz_product: 'Product: Available limits for search'
Expand Down
4 changes: 4 additions & 0 deletions src/Resources/translations/messages.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ monsieurbiz_searchplugin:
filterable: Filtrable
searchable: Recherchable
search_weight: Pondération dans la recherche
search_weight_short_label: Poids
product_option:
form:
title: Recherche
filterable: Filtrable
searchable: Recherchable
search_weight: Pondération dans la recherche
search_weight_short_label: Poids
setting_form:
instant_search_enabled_monsieurbiz_product: 'Produit: Activer la recherche instantanée'
limit_search_monsieurbiz_product: 'Produit: Limites disponibles pour la recherche'
Expand Down
Loading