From 34d0925d977333459c4a3be3712b4c054f806ffb Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Thu, 21 Nov 2024 13:37:21 +0100 Subject: [PATCH] Routes --- config/admin_routes.yaml | 12 ++++++------ config/shop_routes.yaml | 4 ++-- src/Ui/Menu/AdminMenuListener.php | 2 +- templates/Invoice/Admin/_downloadButton.html.twig | 2 +- templates/Invoice/Admin/_resendButton.html.twig | 2 +- templates/Invoice/Show/_backButton.html.twig | 2 +- templates/Invoice/Show/_breadcrumb.html.twig | 4 ++-- templates/Order/Admin/_invoices.html.twig | 2 +- templates/Order/Admin/fetchInvoices.html.twig | 2 +- templates/Order/Shop/_downloadButton.html.twig | 2 +- templates/Order/Shop/fetchInvoices.html.twig | 2 +- .../config/routes/sylius_invoicing_plugin.yaml | 4 ++-- tests/Behat/Page/Admin/Invoice/ShowPage.php | 2 +- tests/Behat/Page/Shop/Order/DownloadInvoicePage.php | 2 +- 14 files changed, 22 insertions(+), 22 deletions(-) diff --git a/config/admin_routes.yaml b/config/admin_routes.yaml index 5e38a286..5da194d9 100644 --- a/config/admin_routes.yaml +++ b/config/admin_routes.yaml @@ -1,10 +1,10 @@ -sylius_invoicing_plugin_invoice: +sylius_invoicing_invoice: resource: | alias: sylius_invoicing.invoice section: admin templates: "@SyliusAdmin\\Crud" only: ['index'] - grid: sylius_invoicing_plugin_invoice + grid: sylius_invoicing_invoice permission: true vars: all: @@ -15,7 +15,7 @@ sylius_invoicing_plugin_invoice: icon: inbox type: sylius.resource -sylius_invoicing_plugin_admin_invoice_show: +sylius_invoicing_admin_invoice_show: path: /invoices/{id} methods: [GET] defaults: @@ -25,19 +25,19 @@ sylius_invoicing_plugin_admin_invoice_show: permission: true template: "@SyliusInvoicingPlugin/Invoice/show.html.twig" -sylius_invoicing_plugin_admin_invoice_download: +sylius_invoicing_admin_invoice_download: path: /invoices/{id}/download methods: [GET] defaults: _controller: sylius_invoicing.ui.action.download_invoice -sylius_invoicing_plugin_admin_invoice_resend: +sylius_invoicing_admin_invoice_resend: path: /invoices/{id}/resend methods: [GET] defaults: _controller: sylius_invoicing.ui.action.resend_invoice -sylius_invoicing_plugin_admin_order_invoices_partial: +sylius_invoicing_admin_order_invoices_partial: path: /_partial/invoices/{orderNumber}/ methods: [GET] defaults: diff --git a/config/shop_routes.yaml b/config/shop_routes.yaml index 21265d80..1cc7ead1 100644 --- a/config/shop_routes.yaml +++ b/config/shop_routes.yaml @@ -1,10 +1,10 @@ -sylius_invoicing_plugin_shop_invoice_download: +sylius_invoicing_shop_invoice_download: path: /invoices/{id}/download methods: [GET] defaults: _controller: sylius_invoicing.ui.action.download_invoice -sylius_invoicing_plugin_shop_order_invoices_partial: +sylius_invoicing_shop_order_invoices_partial: path: /_partial/invoices/{orderNumber}/ methods: [GET] defaults: diff --git a/src/Ui/Menu/AdminMenuListener.php b/src/Ui/Menu/AdminMenuListener.php index 92896a34..b3d96d2a 100644 --- a/src/Ui/Menu/AdminMenuListener.php +++ b/src/Ui/Menu/AdminMenuListener.php @@ -26,7 +26,7 @@ public function __invoke(MenuBuilderEvent $event): void $salesMenu = $menu->getChild('sales'); $salesMenu - ->addChild('invoices', ['route' => 'sylius_invoicing_plugin_admin_invoice_index']) + ->addChild('invoices', ['route' => 'sylius_invoicing_admin_invoice_index']) ->setLabel('sylius_invoicing.ui.invoices') ->setLabelAttribute('icon', 'file') ; diff --git a/templates/Invoice/Admin/_downloadButton.html.twig b/templates/Invoice/Admin/_downloadButton.html.twig index e633930f..77d38468 100644 --- a/templates/Invoice/Admin/_downloadButton.html.twig +++ b/templates/Invoice/Admin/_downloadButton.html.twig @@ -1,5 +1,5 @@ {% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} -{% set path = path('sylius_invoicing_plugin_admin_invoice_download', {'id': invoice.id}) %} +{% set path = path('sylius_invoicing_admin_invoice_download', {'id': invoice.id}) %} {{ buttons.default(path, 'sylius_invoicing.ui.download_invoice'|trans, invoice.id, 'download', 'blue') }} diff --git a/templates/Invoice/Admin/_resendButton.html.twig b/templates/Invoice/Admin/_resendButton.html.twig index 46c4bec6..b1bd35e0 100644 --- a/templates/Invoice/Admin/_resendButton.html.twig +++ b/templates/Invoice/Admin/_resendButton.html.twig @@ -1,5 +1,5 @@ {% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} -{% set path = path('sylius_invoicing_plugin_admin_invoice_resend', {'id': invoice.id}) %} +{% set path = path('sylius_invoicing_admin_invoice_resend', {'id': invoice.id}) %} {{ buttons.default(path, 'sylius_invoicing.ui.resend_invoice'|trans, invoice.id, 'send') }} diff --git a/templates/Invoice/Show/_backButton.html.twig b/templates/Invoice/Show/_backButton.html.twig index 03096ac8..a0e7f049 100644 --- a/templates/Invoice/Show/_backButton.html.twig +++ b/templates/Invoice/Show/_backButton.html.twig @@ -1,5 +1,5 @@ {% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} -{% set path = path('sylius_invoicing_plugin_admin_invoice_index') %} +{% set path = path('sylius_invoicing_admin_invoice_index') %} {{ buttons.default(path, '', 'back', 'arrow alternate circle left outline') }} diff --git a/templates/Invoice/Show/_breadcrumb.html.twig b/templates/Invoice/Show/_breadcrumb.html.twig index 8f698570..657be8f9 100644 --- a/templates/Invoice/Show/_breadcrumb.html.twig +++ b/templates/Invoice/Show/_breadcrumb.html.twig @@ -2,8 +2,8 @@ {% set breadcrumbs = [ { label: 'sylius.ui.administration'|trans, url: path('sylius_admin_dashboard') }, - { label: 'sylius_invoicing.ui.invoices'|trans, url: path('sylius_invoicing_plugin_admin_invoice_index') }, - { label: invoice.id, url: path('sylius_invoicing_plugin_admin_invoice_show', { 'id': invoice.id }) } + { label: 'sylius_invoicing.ui.invoices'|trans, url: path('sylius_invoicing_admin_invoice_index') }, + { label: invoice.id, url: path('sylius_invoicing_admin_invoice_show', { 'id': invoice.id }) } ] %} diff --git a/templates/Order/Admin/_invoices.html.twig b/templates/Order/Admin/_invoices.html.twig index 6e0277e2..93e54612 100644 --- a/templates/Order/Admin/_invoices.html.twig +++ b/templates/Order/Admin/_invoices.html.twig @@ -15,7 +15,7 @@ {% for invoice in invoices %} - {{ invoice.number }} + {{ invoice.number }} {% include '@SyliusAdmin/Common/_channel.html.twig' with {'channel': invoice.channel} %} diff --git a/templates/Order/Admin/fetchInvoices.html.twig b/templates/Order/Admin/fetchInvoices.html.twig index 00a74c6d..fde5a916 100644 --- a/templates/Order/Admin/fetchInvoices.html.twig +++ b/templates/Order/Admin/fetchInvoices.html.twig @@ -1 +1 @@ -{{ render(url('sylius_invoicing_plugin_admin_order_invoices_partial', {'orderNumber': order.number, 'template': '@SyliusInvoicingPlugin/Order/Admin/_invoices.html.twig'})) }} +{{ render(url('sylius_invoicing_admin_order_invoices_partial', {'orderNumber': order.number, 'template': '@SyliusInvoicingPlugin/Order/Admin/_invoices.html.twig'})) }} diff --git a/templates/Order/Shop/_downloadButton.html.twig b/templates/Order/Shop/_downloadButton.html.twig index b37f5c20..b55586ad 100644 --- a/templates/Order/Shop/_downloadButton.html.twig +++ b/templates/Order/Shop/_downloadButton.html.twig @@ -1,5 +1,5 @@ {% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} -{% set path = path('sylius_invoicing_plugin_shop_invoice_download', { 'id': invoice.id }) %} +{% set path = path('sylius_invoicing_shop_invoice_download', { 'id': invoice.id }) %} {{ buttons.default(path, 'sylius_invoicing.ui.download_invoice'|trans, invoice.id, 'download') }} diff --git a/templates/Order/Shop/fetchInvoices.html.twig b/templates/Order/Shop/fetchInvoices.html.twig index d835839d..978d4df0 100644 --- a/templates/Order/Shop/fetchInvoices.html.twig +++ b/templates/Order/Shop/fetchInvoices.html.twig @@ -1 +1 @@ -{{ render(url('sylius_invoicing_plugin_shop_order_invoices_partial', {'orderNumber': order.number, 'template': '@SyliusInvoicingPlugin/Order/Shop/_invoices.html.twig'})) }} +{{ render(url('sylius_invoicing_shop_order_invoices_partial', {'orderNumber': order.number, 'template': '@SyliusInvoicingPlugin/Order/Shop/_invoices.html.twig'})) }} diff --git a/tests/Application/config/routes/sylius_invoicing_plugin.yaml b/tests/Application/config/routes/sylius_invoicing_plugin.yaml index 0a4f2018..44b42e1c 100644 --- a/tests/Application/config/routes/sylius_invoicing_plugin.yaml +++ b/tests/Application/config/routes/sylius_invoicing_plugin.yaml @@ -1,8 +1,8 @@ -sylius_invoicing_plugin_admin: +sylius_invoicing_admin: resource: "@SyliusInvoicingPlugin/config/admin_routes.yaml" prefix: /admin -sylius_invoicing_plugin_shop: +sylius_invoicing_shop: resource: "@SyliusInvoicingPlugin/config/shop_routes.yaml" prefix: /{_locale} requirements: diff --git a/tests/Behat/Page/Admin/Invoice/ShowPage.php b/tests/Behat/Page/Admin/Invoice/ShowPage.php index 871da676..63548a0a 100644 --- a/tests/Behat/Page/Admin/Invoice/ShowPage.php +++ b/tests/Behat/Page/Admin/Invoice/ShowPage.php @@ -33,7 +33,7 @@ public function getIssuedAtDate(): \DateTimeInterface public function getRouteName(): string { - return 'sylius_invoicing_plugin_admin_invoice_show'; + return 'sylius_invoicing_admin_invoice_show'; } public function hasBillingData( diff --git a/tests/Behat/Page/Shop/Order/DownloadInvoicePage.php b/tests/Behat/Page/Shop/Order/DownloadInvoicePage.php index 91478ec2..99251abf 100644 --- a/tests/Behat/Page/Shop/Order/DownloadInvoicePage.php +++ b/tests/Behat/Page/Shop/Order/DownloadInvoicePage.php @@ -10,6 +10,6 @@ final class DownloadInvoicePage extends SymfonyPage implements DownloadInvoicePa { public function getRouteName(): string { - return 'sylius_invoicing_plugin_shop_invoice_download'; + return 'sylius_invoicing_shop_invoice_download'; } }