Skip to content

Commit

Permalink
Merge pull request #194 from maximehuran/feature/add-columns-grids
Browse files Browse the repository at this point in the history
Add columns in options and attributes grid
  • Loading branch information
maximehuran authored Oct 9, 2023
2 parents 4b063d4 + 30ff17c commit 28d4ff5
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 3 deletions.
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

0 comments on commit 28d4ff5

Please sign in to comment.