From f5d79bd740bdd41396cf34be534d649d6f36ead8 Mon Sep 17 00:00:00 2001 From: TomaszLach2 Date: Wed, 9 Aug 2023 12:02:34 +0200 Subject: [PATCH 1/2] Disabling localised urls in test app --- config/routing/shop_routing.yaml | 8 ++++---- tests/Application/config/packages/security.yaml | 3 +++ tests/Application/config/routes/sylius_shop.yaml | 9 --------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/config/routing/shop_routing.yaml b/config/routing/shop_routing.yaml index c8d3e65..880f129 100644 --- a/config/routing/shop_routing.yaml +++ b/config/routing/shop_routing.yaml @@ -1,11 +1,11 @@ speardevs_push_notifications_section: - path: /{_locale}/account/push-notifications + path: /account/push-notifications defaults: _controller: 'SpearDevs\SyliusPushNotificationsPlugin\Controller\Shop\PushNotificationAction' template: '@SpearDevsSyliusPushNotificationsPlugin/Shop/Account/push_notification.html.twig' speardevs_push_notifications_history_index: - path: /{_locale}/account/push-notifications-history + path: /account/push-notifications-history methods: [ GET ] defaults: _controller: speardevs_sylius_push_notifications_plugin.controller.push_notification_history::indexAction @@ -23,7 +23,7 @@ speardevs_push_notifications_history_index: - "expr:service('sylius.context.customer').getCustomer()" speardevs_push_notifications_history_mark_as_received: - path: /{_locale}/account/push-notifications-history/{id}/mark-as-received + path: /account/push-notifications-history/{id}/mark-as-received methods: [ PUT ] defaults: _controller: speardevs_sylius_push_notifications_plugin.controller.push_notification_history::applyStateMachineTransitionAction @@ -36,4 +36,4 @@ speardevs_push_notifications_history_mark_as_received: bentools_webpush: resource: '@WebPushBundle/Resources/config/routing.xml' - prefix: /{_locale}/webpush + prefix: /webpush diff --git a/tests/Application/config/packages/security.yaml b/tests/Application/config/packages/security.yaml index 4ed342f..b3a515a 100644 --- a/tests/Application/config/packages/security.yaml +++ b/tests/Application/config/packages/security.yaml @@ -1,3 +1,6 @@ +parameters: + sylius.security.shop_regex: "^(?:/(?!%sylius_admin.path_name%|api/.*|api$|media/.*)[^/]++)?" + security: enable_authenticator_manager: true providers: diff --git a/tests/Application/config/routes/sylius_shop.yaml b/tests/Application/config/routes/sylius_shop.yaml index fae46cb..2222a66 100644 --- a/tests/Application/config/routes/sylius_shop.yaml +++ b/tests/Application/config/routes/sylius_shop.yaml @@ -1,14 +1,5 @@ sylius_shop: resource: "@SyliusShopBundle/Resources/config/routing.yml" - prefix: /{_locale} - requirements: - _locale: ^[A-Za-z]{2,4}(_([A-Za-z]{4}|[0-9]{3}))?(_([A-Za-z]{2}|[0-9]{3}))?$ sylius_shop_payum: resource: "@SyliusShopBundle/Resources/config/routing/payum.yml" - -sylius_shop_default_locale: - path: / - methods: [GET] - defaults: - _controller: sylius.controller.shop.locale_switch::switchAction From 56d3e45dcaa19f1767c3aa69a7b8617e91ff5fc1 Mon Sep 17 00:00:00 2001 From: TomaszLach2 Date: Wed, 9 Aug 2023 12:02:42 +0200 Subject: [PATCH 2/2] Disabling localised urls in plugin --- .../PushNotifications/_push_notifications_controls.html.twig | 2 +- tests/Application/config/packages/_sylius.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/Shop/PushNotifications/_push_notifications_controls.html.twig b/templates/Shop/PushNotifications/_push_notifications_controls.html.twig index d0c6bf4..1c40b2f 100644 --- a/templates/Shop/PushNotifications/_push_notifications_controls.html.twig +++ b/templates/Shop/PushNotifications/_push_notifications_controls.html.twig @@ -2,7 +2,7 @@ {{ stimulus_controller('shop/push-notifications', { publicKey: app.request.server.get('WEBPUSH_PUBLIC_KEY'), serviceWorkerPath: '/serviceWorker.js', - subscribeUrl: '/' ~ app.request.locale ~ '/webpush/' + subscribeUrl: '/webpush/' }) }} >