From f27a33f34e03c1c3104d9de6f747f8a9a0f115ba Mon Sep 17 00:00:00 2001 From: jkindly Date: Mon, 30 Sep 2024 14:10:30 +0200 Subject: [PATCH] OP-558: init --- composer.json | 26 ++-- ...AutomaticBlacklistingConfigurationType.php | 24 +++- src/Resources/config/config.yaml | 1 + .../automatic_blacklisting_configuration.yaml | 4 +- .../routing/admin/blacklisting_rule.yaml | 2 +- .../config/routing/admin/fraud_suspicion.yaml | 2 +- src/Resources/config/services/form.xml | 1 + .../config/services/twig/component.xml | 25 ++++ .../create.yaml | 13 ++ .../Admin/_form.html.twig | 54 -------- .../Admin/form.html.twig | 0 src/Resources/views/Form/theme.html.twig | 39 ++++++ tests/Application/Kernel.php | 4 +- tests/Application/assets/admin/entry.js | 2 +- .../Application/assets/admin/product-entry.js | 1 + tests/Application/assets/controllers.json | 5 + tests/Application/assets/shop/entry.js | 2 +- tests/Application/config/bundles.php | 7 +- tests/Application/config/routes/ux.yaml | 3 + .../Application/config/sylius/2.0/bundles.php | 14 ++ .../config/sylius/2.0/packages/_sylius.yaml | 10 ++ .../config/sylius/2.0/packages/security.yaml | 123 ++++++++++++++++++ tests/Application/package.json | 15 ++- tests/Application/webpack.config.js | 3 + 24 files changed, 305 insertions(+), 75 deletions(-) create mode 100644 src/Resources/config/services/twig/component.xml create mode 100644 src/Resources/config/twig_hooks/automatic_blacklisting_configuration/create.yaml delete mode 100644 src/Resources/views/AutomaticBlacklistingConfiguration/Admin/_form.html.twig create mode 100644 src/Resources/views/AutomaticBlacklistingConfiguration/Admin/form.html.twig create mode 100644 tests/Application/assets/admin/product-entry.js create mode 100644 tests/Application/assets/controllers.json create mode 100644 tests/Application/config/routes/ux.yaml create mode 100644 tests/Application/config/sylius/2.0/bundles.php create mode 100644 tests/Application/config/sylius/2.0/packages/_sylius.yaml create mode 100644 tests/Application/config/sylius/2.0/packages/security.yaml diff --git a/composer.json b/composer.json index 1076bc9c..543d644f 100644 --- a/composer.json +++ b/composer.json @@ -6,8 +6,16 @@ "license": "MIT", "require": { "php": "^8.0 || ^8.1 || ^8.2 || ^8.3", - "sylius/sylius": "~1.12.0 || ~1.13.0", - "doctrine/annotations": "^2.0.0" + "doctrine/annotations": "^2.0.0", + "sylius-labs/polyfill-symfony-security": "^1.1", + "sylius/calendar": "^0.5.0", + "sylius/grid-bundle": "1.13.0-ALPHA.3", + "sylius/sylius": "2.0.0-alpha.2", + "sylius/twig-hooks": "^0.3.0", + "symfony/stimulus-bundle": "^2.20", + "symfony/ux-autocomplete": "^2.20", + "symfony/ux-live-component": "^2.20", + "symfony/ux-twig-component": "^2.20" }, "require-dev": { "behat/behat": "^3.7.0", @@ -33,13 +41,13 @@ "phpstan/phpstan-webmozart-assert": "^1.0", "phpunit/phpunit": "^9.5", "polishsymfonycommunity/symfony-mocker-container": "^1.0", - "symfony/browser-kit": "^5.4 || 6.4", - "symfony/debug-bundle": "^5.4 || ^6.4", - "symfony/dotenv": "^5.4 || ^6.4", - "symfony/intl": "^5.4 || ^6.4", - "symfony/web-profiler-bundle": "^5.4 || ^6.4", - "vimeo/psalm": "^4.7 || ^5.0", - "symfony/webpack-encore-bundle": "^1.17" + "symfony/browser-kit": "^6.4", + "symfony/debug-bundle": "^6.4", + "symfony/dotenv": "^6.4", + "symfony/intl": "^6.4", + "symfony/web-profiler-bundle": "^6.4", + "symfony/webpack-encore-bundle": "^2.1", + "vimeo/psalm": "^4.7 || ^5.0" }, "autoload": { "psr-4": { diff --git a/src/Form/Type/AutomaticBlacklistingConfigurationType.php b/src/Form/Type/AutomaticBlacklistingConfigurationType.php index 044c1767..ee9d396a 100644 --- a/src/Form/Type/AutomaticBlacklistingConfigurationType.php +++ b/src/Form/Type/AutomaticBlacklistingConfigurationType.php @@ -12,7 +12,9 @@ namespace BitBag\SyliusBlacklistPlugin\Form\Type; use BitBag\SyliusBlacklistPlugin\Entity\FraudPrevention\AutomaticBlacklistingRuleInterface; +use Sylius\Bundle\AdminBundle\Form\Type\AddButtonType; use Sylius\Bundle\ChannelBundle\Form\Type\ChannelChoiceType; +use Sylius\Bundle\PromotionBundle\Form\Type\PromotionRuleType; use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; @@ -20,6 +22,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Validator\Constraints\GreaterThanOrEqual; +use Symfony\UX\LiveComponent\Form\Type\LiveCollectionType; final class AutomaticBlacklistingConfigurationType extends AbstractResourceType { @@ -30,6 +33,7 @@ public function __construct( string $dataClass, array $attributeChoices, array $validationGroups = [], + private array $rules, ) { parent::__construct($dataClass, $validationGroups); $this->attributeChoices = $attributeChoices; @@ -72,9 +76,23 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ], 'placeholder' => 'bitbag_sylius_blacklist_plugin.ui.choose_time_range', ]) - ->add('rules', AutomaticBlacklistingRuleCollectionType::class, [ - 'label' => 'bitbag_sylius_blacklist_plugin.form.automatic_blacklisting_rule.rules', - 'button_add_label' => 'sylius.form.promotion.add_rule', +// ->add('rules', AutomaticBlacklistingRuleCollectionType::class, [ +// 'label' => 'bitbag_sylius_blacklist_plugin.form.automatic_blacklisting_rule.rules', +// 'button_add_label' => 'sylius.form.promotion.add_rule', +// ]) + ->add('rules', LiveCollectionType::class, [ + 'entry_type' => AutomaticBlacklistingRuleType::class, + 'allow_add' => true, + 'allow_delete' => true, + 'by_reference' => false, + 'button_add_type' => AddButtonType::class, + 'button_add_options' => [ + 'label' => 'sylius.ui.add_rule', + 'types' => $this->rules, + ], + 'button_delete_options' => [ + 'label' => false, + ], ]) ; } diff --git a/src/Resources/config/config.yaml b/src/Resources/config/config.yaml index a655a62a..d8f55a74 100644 --- a/src/Resources/config/config.yaml +++ b/src/Resources/config/config.yaml @@ -1,4 +1,5 @@ imports: + - { resource: "twig_hooks/**/*.yaml" } - { resource: "resources.yaml" } - { resource: "services.xml" } - { resource: "grids.yaml" } diff --git a/src/Resources/config/routing/admin/automatic_blacklisting_configuration.yaml b/src/Resources/config/routing/admin/automatic_blacklisting_configuration.yaml index fb70ef58..a9767fa6 100644 --- a/src/Resources/config/routing/admin/automatic_blacklisting_configuration.yaml +++ b/src/Resources/config/routing/admin/automatic_blacklisting_configuration.yaml @@ -2,10 +2,12 @@ bitbag_sylius_blacklist_plugin_admin_automatic_blacklisting_configuration: resource: | alias: bitbag_sylius_blacklist_plugin.automatic_blacklisting_configuration section: admin - templates: "@SyliusAdmin\\Crud" + templates: "@SyliusAdmin\\shared\\crud" grid: bitbag_sylius_blacklist_plugin_automatic_blacklisting_configuration except: ['show'] permission: true + form: + type: BitBag\SyliusBlacklistPlugin\Form\Type\AutomaticBlacklistingConfigurationType vars: all: subheader: bitbag_sylius_blacklist_plugin.ui.configure_automatic_blacklisting_configurations diff --git a/src/Resources/config/routing/admin/blacklisting_rule.yaml b/src/Resources/config/routing/admin/blacklisting_rule.yaml index b6f5b040..1f12d59f 100644 --- a/src/Resources/config/routing/admin/blacklisting_rule.yaml +++ b/src/Resources/config/routing/admin/blacklisting_rule.yaml @@ -2,7 +2,7 @@ bitbag_sylius_blacklist_plugin_admin_blacklisting_rule: resource: | alias: bitbag_sylius_blacklist_plugin.blacklisting_rule section: admin - templates: "@SyliusAdmin\\Crud" + templates: "@SyliusAdmin\\shared\\crud" grid: bitbag_sylius_blacklist_plugin_blacklisting_rule except: ['show'] permission: true diff --git a/src/Resources/config/routing/admin/fraud_suspicion.yaml b/src/Resources/config/routing/admin/fraud_suspicion.yaml index 60b457e1..26bf091e 100644 --- a/src/Resources/config/routing/admin/fraud_suspicion.yaml +++ b/src/Resources/config/routing/admin/fraud_suspicion.yaml @@ -2,7 +2,7 @@ bitbag_sylius_blacklist_plugin_admin_fraud_suspicion: resource: | alias: bitbag_sylius_blacklist_plugin.fraud_suspicion section: admin - templates: "@SyliusAdmin\\Crud" + templates: "@SyliusAdmin\\shared\\crud" grid: bitbag_sylius_blacklist_plugin_fraud_suspicion permission: true vars: diff --git a/src/Resources/config/services/form.xml b/src/Resources/config/services/form.xml index 7e19afe6..faa93baa 100644 --- a/src/Resources/config/services/form.xml +++ b/src/Resources/config/services/form.xml @@ -50,6 +50,7 @@ %bitbag_sylius_blacklist_plugin.model.automatic_blacklisting_configuration.class% %bitbag.sylius_blacklist_plugin.form.type.automatic_blacklisting_configuration.validation_groups% %bitbag.sylius_blacklist_plugin.form.type.validation_groups% + %bitbag.sylius_blacklist_plugin.automatic_blacklisting_rules% + + + + + + + %bitbag_sylius_blacklist_plugin.model.automatic_blacklisting_configuration.class% + BitBag\SyliusBlacklistPlugin\Form\Type\AutomaticBlacklistingConfigurationType + + + + + diff --git a/src/Resources/config/twig_hooks/automatic_blacklisting_configuration/create.yaml b/src/Resources/config/twig_hooks/automatic_blacklisting_configuration/create.yaml new file mode 100644 index 00000000..84806c9f --- /dev/null +++ b/src/Resources/config/twig_hooks/automatic_blacklisting_configuration/create.yaml @@ -0,0 +1,13 @@ +twig_hooks: + hooks: + 'bitbag_sylius_blacklist_plugin.automatic_blacklisting_configuration.create.content': + form: + component: 'bitbag_sylius_blacklist_plugin:automatic_blacklisting_configuration:form' + props: + resource: '@=_context.resource' + form: '@=_context.form' + configuration: + render_rest: false + 'bitbag_sylius_blacklist_plugin.automatic_blacklisting_configuration.create.content.form': + sections: + template: '@SyliusAdmin/promotion/form/sections.html.twig' diff --git a/src/Resources/views/AutomaticBlacklistingConfiguration/Admin/_form.html.twig b/src/Resources/views/AutomaticBlacklistingConfiguration/Admin/_form.html.twig deleted file mode 100644 index f74da1d6..00000000 --- a/src/Resources/views/AutomaticBlacklistingConfiguration/Admin/_form.html.twig +++ /dev/null @@ -1,54 +0,0 @@ -
-
- {{ form_errors(form) }} -
-

{{ 'sylius.ui.general'|trans }}

- - - -
- {{ form_row(form.name) }} -
-
- {{ form_row(form.channels) }} -
-
- {{ form_row(form.enabled) }} -
-
-
-
-
-

{{ 'bitbag_sylius_blacklist_plugin.ui.fraud_suspicions'|trans }}

- - - -
- {{ form_row(form.addFraudSuspicion) }} -
-
- {{ form_row(form.permittedFraudSuspicionsNumber) }} -
-
- {{ form_row(form.permittedFraudSuspicionsTime) }} -
-
-
-
-
-

{{ 'bitbag_sylius_blacklist_plugin.ui.settings'|trans }}

- - - -
-
- -
- {{ 'bitbag_sylius_blacklist_plugin.ui.rules_are_connected_by_or'|trans }}! -
-
-
- {{ form_row(form.rules) }} -
-
-
diff --git a/src/Resources/views/AutomaticBlacklistingConfiguration/Admin/form.html.twig b/src/Resources/views/AutomaticBlacklistingConfiguration/Admin/form.html.twig new file mode 100644 index 00000000..e69de29b diff --git a/src/Resources/views/Form/theme.html.twig b/src/Resources/views/Form/theme.html.twig index 2c51bf5f..c462a2cf 100644 --- a/src/Resources/views/Form/theme.html.twig +++ b/src/Resources/views/Form/theme.html.twig @@ -6,3 +6,42 @@ 'load_edit_url': path('bitbag_sylius_blacklist_plugin_admin_ajax_customer_by_id') }) }} {% endblock %} + +{% block bitbag_sylius_blacklist_plugin_automatic_blacklisting_rule_widget %} +
+ {{ block('form_widget') }} +
+{% endblock %} + +{%- block bitbag_sylius_blacklist_plugin_automatic_blacklisting_rule_row -%} +
+ {{- form_errors(form) -}} + {{- form_row(form.type) -}} +
+
+
ads
+ {{- form_row(button_delete, sylius_test_form_attribute('delete')|sylius_merge_recursive({'attr': {'class': 'btn-close'}})) -}} +
+
+ {{- form_row(form.settings, {'label': false}) -}} +
+
+
+{%- endblock bitbag_sylius_blacklist_plugin_automatic_blacklisting_rule_row -%} + +{% block add_button_row %} + {% if types is not empty %} + + {% endif %} +{% endblock %} diff --git a/tests/Application/Kernel.php b/tests/Application/Kernel.php index f72d72c1..f6dc0233 100644 --- a/tests/Application/Kernel.php +++ b/tests/Application/Kernel.php @@ -5,7 +5,7 @@ namespace Tests\BitBag\SyliusBlacklistPlugin\Application; use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer; -use Sylius\Bundle\CoreBundle\Application\Kernel as SyliusKernel; +use Sylius\Bundle\CoreBundle\SyliusCoreBundle; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\Config\Resource\FileResource; @@ -113,7 +113,7 @@ private function registerBundlesFromFile(string $bundlesFile): iterable private function getConfigurationDirectories(): iterable { yield $this->getProjectDir() . '/config'; - $syliusConfigDir = $this->getProjectDir() . '/config/sylius/' . SyliusKernel::MAJOR_VERSION . '.' . SyliusKernel::MINOR_VERSION; + $syliusConfigDir = $this->getProjectDir() . '/config/sylius/' . SyliusCoreBundle::MAJOR_VERSION . '.' . SyliusCoreBundle::MINOR_VERSION; if (is_dir($syliusConfigDir)) { yield $syliusConfigDir; } diff --git a/tests/Application/assets/admin/entry.js b/tests/Application/assets/admin/entry.js index 635f5acc..063df3e0 100644 --- a/tests/Application/assets/admin/entry.js +++ b/tests/Application/assets/admin/entry.js @@ -1 +1 @@ -import 'sylius/bundle/AdminBundle/Resources/private/entry'; +import 'sylius/bundle/AdminBundle/Resources/assets/entrypoint'; diff --git a/tests/Application/assets/admin/product-entry.js b/tests/Application/assets/admin/product-entry.js new file mode 100644 index 00000000..eda48352 --- /dev/null +++ b/tests/Application/assets/admin/product-entry.js @@ -0,0 +1 @@ +import 'sylius/bundle/AdminBundle/Resources/assets/scripts/product/attribute-tabs-refresher'; diff --git a/tests/Application/assets/controllers.json b/tests/Application/assets/controllers.json new file mode 100644 index 00000000..696ad495 --- /dev/null +++ b/tests/Application/assets/controllers.json @@ -0,0 +1,5 @@ +{ + "controllers": { + }, + "entrypoints": [] +} diff --git a/tests/Application/assets/shop/entry.js b/tests/Application/assets/shop/entry.js index aadc3174..dbb7d931 100644 --- a/tests/Application/assets/shop/entry.js +++ b/tests/Application/assets/shop/entry.js @@ -1 +1 @@ -import 'sylius/bundle/ShopBundle/Resources/private/entry'; +import 'sylius/bundle/ShopBundle/Resources/assets/entrypoint'; diff --git a/tests/Application/config/bundles.php b/tests/Application/config/bundles.php index 77b90df6..880d0d4d 100644 --- a/tests/Application/config/bundles.php +++ b/tests/Application/config/bundles.php @@ -56,7 +56,7 @@ Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true, 'test_cached' => true], Sylius\Behat\Application\SyliusTestPlugin\SyliusTestPlugin::class => ['test' => true, 'test_cached' => true], - ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], + ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true], Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true], SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true], @@ -67,4 +67,9 @@ Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true], BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true], SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true], + Sylius\TwigHooks\TwigHooksBundle::class => ['all' => true], + Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true], + Symfony\UX\LiveComponent\LiveComponentBundle::class => ['all' => true], + Symfony\UX\Autocomplete\AutocompleteBundle::class => ['all' => true], + Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true], ]; diff --git a/tests/Application/config/routes/ux.yaml b/tests/Application/config/routes/ux.yaml new file mode 100644 index 00000000..6acafc2c --- /dev/null +++ b/tests/Application/config/routes/ux.yaml @@ -0,0 +1,3 @@ +live_component: + resource: "@LiveComponentBundle/config/routes.php" + prefix: /{_locale}/_components diff --git a/tests/Application/config/sylius/2.0/bundles.php b/tests/Application/config/sylius/2.0/bundles.php new file mode 100644 index 00000000..e615f85b --- /dev/null +++ b/tests/Application/config/sylius/2.0/bundles.php @@ -0,0 +1,14 @@ + ['all' => true], +]; diff --git a/tests/Application/config/sylius/2.0/packages/_sylius.yaml b/tests/Application/config/sylius/2.0/packages/_sylius.yaml new file mode 100644 index 00000000..baa3d7ed --- /dev/null +++ b/tests/Application/config/sylius/2.0/packages/_sylius.yaml @@ -0,0 +1,10 @@ +parameters: + test_default_state_machine_adapter: 'symfony_workflow' + test_sylius_state_machine_adapter: '%env(string:default:test_default_state_machine_adapter:TEST_SYLIUS_STATE_MACHINE_ADAPTER)%' + +sylius_state_machine_abstraction: + graphs_to_adapters_mapping: + sylius_refund_refund_payment: '%test_sylius_state_machine_adapter%' + +sylius_api: + enabled: true diff --git a/tests/Application/config/sylius/2.0/packages/security.yaml b/tests/Application/config/sylius/2.0/packages/security.yaml new file mode 100644 index 00000000..b8c377bf --- /dev/null +++ b/tests/Application/config/sylius/2.0/packages/security.yaml @@ -0,0 +1,123 @@ +security: + providers: + sylius_admin_user_provider: + id: sylius.admin_user_provider.email_or_name_based + sylius_api_admin_user_provider: + id: sylius.admin_user_provider.email_or_name_based + sylius_shop_user_provider: + id: sylius.shop_user_provider.email_or_name_based + sylius_api_shop_user_provider: + id: sylius.shop_user_provider.email_or_name_based + + password_hashers: + Sylius\Component\User\Model\UserInterface: argon2i + firewalls: + admin: + switch_user: true + context: admin + pattern: "%sylius.security.admin_regex%" + provider: sylius_admin_user_provider + form_login: + provider: sylius_admin_user_provider + login_path: sylius_admin_login + check_path: sylius_admin_login_check + failure_path: sylius_admin_login + default_target_path: sylius_admin_dashboard + use_forward: false + use_referer: true + enable_csrf: true + csrf_parameter: _csrf_admin_security_token + csrf_token_id: admin_authenticate + remember_me: + secret: "%env(APP_SECRET)%" + path: "/%sylius_admin.path_name%" + name: APP_ADMIN_REMEMBER_ME + lifetime: 31536000 + remember_me_parameter: _remember_me + logout: + path: sylius_admin_logout + target: sylius_admin_login + + new_api_admin_user: + pattern: "%sylius.security.new_api_admin_regex%/.*" + provider: sylius_api_admin_user_provider + stateless: true + entry_point: jwt + json_login: + check_path: "%sylius.security.new_api_admin_route%/authentication-token" + username_path: email + password_path: password + success_handler: lexik_jwt_authentication.handler.authentication_success + failure_handler: lexik_jwt_authentication.handler.authentication_failure + jwt: true + + new_api_shop_user: + pattern: "%sylius.security.new_api_shop_regex%/.*" + provider: sylius_api_shop_user_provider + stateless: true + entry_point: jwt + json_login: + check_path: "%sylius.security.new_api_shop_route%/authentication-token" + username_path: email + password_path: password + success_handler: lexik_jwt_authentication.handler.authentication_success + failure_handler: lexik_jwt_authentication.handler.authentication_failure + jwt: true + + shop: + switch_user: { role: ROLE_ALLOWED_TO_SWITCH } + context: shop + pattern: "%sylius.security.shop_regex%" + provider: sylius_shop_user_provider + form_login: + success_handler: sylius.authentication.success_handler + failure_handler: sylius.authentication.failure_handler + provider: sylius_shop_user_provider + login_path: sylius_shop_login + check_path: sylius_shop_login_check + failure_path: sylius_shop_login + default_target_path: sylius_shop_homepage + use_forward: false + use_referer: true + enable_csrf: true + csrf_parameter: _csrf_shop_security_token + csrf_token_id: shop_authenticate + remember_me: + secret: "%env(APP_SECRET)%" + name: APP_SHOP_REMEMBER_ME + lifetime: 31536000 + remember_me_parameter: _remember_me + logout: + path: sylius_shop_logout + target: sylius_shop_homepage + invalidate_session: false + + dev: + pattern: ^/(_(profiler|wdt)|css|images|js)/ + security: false + + image_resolver: + pattern: ^/media/cache/resolve + security: false + + access_control: + - { path: "%sylius.security.admin_regex%/_partial", role: PUBLIC_ACCESS, ips: [127.0.0.1, ::1] } + - { path: "%sylius.security.admin_regex%/_partial", role: ROLE_NO_ACCESS } + - { path: "%sylius.security.shop_regex%/_partial", role: PUBLIC_ACCESS, ips: [127.0.0.1, ::1] } + - { path: "%sylius.security.shop_regex%/_partial", role: ROLE_NO_ACCESS } + + - { path: "%sylius.security.admin_regex%/login", role: PUBLIC_ACCESS } + - { path: "%sylius.security.shop_regex%/login", role: PUBLIC_ACCESS } + + - { path: "%sylius.security.shop_regex%/register", role: PUBLIC_ACCESS } + - { path: "%sylius.security.shop_regex%/verify", role: PUBLIC_ACCESS } + + - { path: "%sylius.security.admin_regex%", role: ROLE_ADMINISTRATION_ACCESS } + - { path: "%sylius.security.shop_regex%/account", role: ROLE_USER } + + - { path: "%sylius.security.new_api_admin_route%/reset-password-requests", role: PUBLIC_ACCESS } + - { path: "%sylius.security.new_api_admin_regex%/.*", role: ROLE_API_ACCESS } + - { path: "%sylius.security.new_api_admin_route%/authentication-token", role: PUBLIC_ACCESS } + - { path: "%sylius.security.new_api_user_account_regex%/.*", role: ROLE_USER } + - { path: "%sylius.security.new_api_shop_route%/authentication-token", role: PUBLIC_ACCESS } + - { path: "%sylius.security.new_api_shop_regex%/.*", role: PUBLIC_ACCESS } diff --git a/tests/Application/package.json b/tests/Application/package.json index ac5c1436..571fc1ba 100644 --- a/tests/Application/package.json +++ b/tests/Application/package.json @@ -3,7 +3,13 @@ "@babel/core": "^7.24.9", "@babel/preset-env": "^7.14.7", "babel-polyfill": "^6.26.0", + "@popperjs/core": "^2.11.8", + "@tabler/core": "^1.0.0-beta21", + "apexcharts": "^3.53.0", + "bootstrap": "^5.3.3", "chart.js": "^3.9.1", + "flag-icons": "^7.2.3", + "infinite-tree": "^1.18.0", "jquery": "^3.6.0", "jquery.dirtyforms": "^2.0.0", "lightbox2": "^2.11.0", @@ -11,6 +17,10 @@ "slick-carousel": "^1.8.1" }, "devDependencies": { + "@hotwired/stimulus": "^3.2.2", + "@symfony/stimulus-bridge": "^3.2.2", + "@symfony/ux-autocomplete": "file:../../vendor/symfony/ux-autocomplete/assets", + "@symfony/ux-live-component": "file:../../vendor/symfony/ux-live-component/assets", "@symfony/webpack-encore": "^4.0.0", "babel-core": "^6.26.3", "babel-plugin-external-helpers": "^6.22.0", @@ -26,7 +36,10 @@ "fast-async": "^7.0.6", "merge-stream": "^2.0.0", "sass": "^1.77.8", - "sass-loader": "^13.0.0", + "sass-loader": "^14.0.0", + "slugify": "^1.6.6", + "stimulus-use": "^0.52.2", + "tom-select": "^2.3.1", "upath": "^2.0.0", "webpack": "^5.93.0", "webpack-cli": "^5.1.4", diff --git a/tests/Application/webpack.config.js b/tests/Application/webpack.config.js index 4ca25fdd..e6ae6921 100644 --- a/tests/Application/webpack.config.js +++ b/tests/Application/webpack.config.js @@ -11,6 +11,7 @@ Encore .setOutputPath('public/build/shop/') .setPublicPath('/build/shop') .addEntry('shop-entry', './assets/shop/entry.js') + .enableStimulusBridge('./assets/controllers.json') .disableSingleRuntimeChunk() .cleanupOutputBeforeBuild() .enableSourceMaps(!Encore.isProduction()) @@ -31,6 +32,8 @@ Encore .setOutputPath('public/build/admin/') .setPublicPath('/build/admin') .addEntry('admin-entry', './assets/admin/entry.js') + .addEntry('admin-product-entry', './assets/admin/product-entry.js') + .enableStimulusBridge('./assets/controllers.json') .disableSingleRuntimeChunk() .cleanupOutputBeforeBuild() .enableSourceMaps(!Encore.isProduction())