From de490b97dceb1544d5dc45b1a16c971d5bba4127 Mon Sep 17 00:00:00 2001 From: Maxime Huran Date: Thu, 5 Oct 2023 15:35:00 +0200 Subject: [PATCH 1/3] Add some missing translation for option form --- src/Form/Extension/ProductOptionTypeExtension.php | 6 +++--- src/Resources/translations/messages.en.yml | 2 ++ src/Resources/translations/messages.fr.yml | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Form/Extension/ProductOptionTypeExtension.php b/src/Form/Extension/ProductOptionTypeExtension.php index a4425452..b23baf62 100644 --- a/src/Form/Extension/ProductOptionTypeExtension.php +++ b/src/Form/Extension/ProductOptionTypeExtension.php @@ -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), ]) diff --git a/src/Resources/translations/messages.en.yml b/src/Resources/translations/messages.en.yml index 3eed8484..b6cc1142 100644 --- a/src/Resources/translations/messages.en.yml +++ b/src/Resources/translations/messages.en.yml @@ -10,6 +10,8 @@ monsieurbiz_searchplugin: form: title: Search filterable: Filterable + searchable: Searchable + search_weight: Search Weight setting_form: instant_search_enabled_monsieurbiz_product: 'Product: Instant search enabled' limit_search_monsieurbiz_product: 'Product: Available limits for search' diff --git a/src/Resources/translations/messages.fr.yml b/src/Resources/translations/messages.fr.yml index 305eab2b..6f31b13b 100644 --- a/src/Resources/translations/messages.fr.yml +++ b/src/Resources/translations/messages.fr.yml @@ -10,6 +10,8 @@ monsieurbiz_searchplugin: form: title: Recherche filterable: Filtrable + searchable: Recherchable + search_weight: Pondération dans la recherche setting_form: instant_search_enabled_monsieurbiz_product: 'Produit: Activer la recherche instantanée' limit_search_monsieurbiz_product: 'Produit: Limites disponibles pour la recherche' From 363bb0af481ba53fd32bb209c08d28b838039cd6 Mon Sep 17 00:00:00 2001 From: Maxime Huran Date: Thu, 5 Oct 2023 15:35:11 +0200 Subject: [PATCH 2/3] Add fields in attributes and options grids --- src/Resources/config/config.yaml | 1 + src/Resources/config/sylius/grids.yaml | 52 ++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 src/Resources/config/sylius/grids.yaml diff --git a/src/Resources/config/config.yaml b/src/Resources/config/config.yaml index 940e85b1..7bfc5043 100644 --- a/src/Resources/config/config.yaml +++ b/src/Resources/config/config.yaml @@ -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" } diff --git a/src/Resources/config/sylius/grids.yaml b/src/Resources/config/sylius/grids.yaml new file mode 100644 index 00000000..87a38200 --- /dev/null +++ b/src/Resources/config/sylius/grids.yaml @@ -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 + 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 + 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 From 30ff17c25746062d8a186af0506c2f266386a51b Mon Sep 17 00:00:00 2001 From: Maxime Huran Date: Thu, 5 Oct 2023 15:40:08 +0200 Subject: [PATCH 3/3] Add short label for search weight in grid --- src/Resources/config/sylius/grids.yaml | 4 ++-- src/Resources/translations/messages.en.yml | 2 ++ src/Resources/translations/messages.fr.yml | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Resources/config/sylius/grids.yaml b/src/Resources/config/sylius/grids.yaml index 87a38200..14e95adb 100644 --- a/src/Resources/config/sylius/grids.yaml +++ b/src/Resources/config/sylius/grids.yaml @@ -15,7 +15,7 @@ sylius_grid: options: template: "@SyliusUi/Grid/Field/yesNo.html.twig" searchWeight: - label: monsieurbiz_searchplugin.admin.product_attribute.form.search_weight + label: monsieurbiz_searchplugin.admin.product_attribute.form.search_weight_short_label type: string sortable: ~ filters: @@ -40,7 +40,7 @@ sylius_grid: options: template: "@SyliusUi/Grid/Field/yesNo.html.twig" searchWeight: - label: monsieurbiz_searchplugin.admin.product_option.form.search_weight + label: monsieurbiz_searchplugin.admin.product_option.form.search_weight_short_label type: string sortable: ~ filters: diff --git a/src/Resources/translations/messages.en.yml b/src/Resources/translations/messages.en.yml index b6cc1142..c3cde1be 100644 --- a/src/Resources/translations/messages.en.yml +++ b/src/Resources/translations/messages.en.yml @@ -6,12 +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' diff --git a/src/Resources/translations/messages.fr.yml b/src/Resources/translations/messages.fr.yml index 6f31b13b..85df4595 100644 --- a/src/Resources/translations/messages.fr.yml +++ b/src/Resources/translations/messages.fr.yml @@ -6,12 +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'