Skip to content

Commit

Permalink
Routes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMilek committed Nov 21, 2024
1 parent 07f37e6 commit 34d0925
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions config/admin_routes.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand 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:
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions config/shop_routes.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/Ui/Menu/AdminMenuListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
;
Expand Down
2 changes: 1 addition & 1 deletion templates/Invoice/Admin/_downloadButton.html.twig
Original file line number Diff line number Diff line change
@@ -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') }}
2 changes: 1 addition & 1 deletion templates/Invoice/Admin/_resendButton.html.twig
Original file line number Diff line number Diff line change
@@ -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') }}
2 changes: 1 addition & 1 deletion templates/Invoice/Show/_backButton.html.twig
Original file line number Diff line number Diff line change
@@ -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') }}
4 changes: 2 additions & 2 deletions templates/Invoice/Show/_breadcrumb.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) }
]
%}

Expand Down
2 changes: 1 addition & 1 deletion templates/Order/Admin/_invoices.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{% for invoice in invoices %}
<tr>
<td>
<a href="{{ path('sylius_invoicing_plugin_admin_invoice_show', {'id': invoice.id}) }}" >{{ invoice.number }}</a>
<a href="{{ path('sylius_invoicing_admin_invoice_show', {'id': invoice.id}) }}" >{{ invoice.number }}</a>
</td>
<td>
{% include '@SyliusAdmin/Common/_channel.html.twig' with {'channel': invoice.channel} %}
Expand Down
2 changes: 1 addition & 1 deletion templates/Order/Admin/fetchInvoices.html.twig
Original file line number Diff line number Diff line change
@@ -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'})) }}
2 changes: 1 addition & 1 deletion templates/Order/Shop/_downloadButton.html.twig
Original file line number Diff line number Diff line change
@@ -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') }}
2 changes: 1 addition & 1 deletion templates/Order/Shop/fetchInvoices.html.twig
Original file line number Diff line number Diff line change
@@ -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'})) }}
4 changes: 2 additions & 2 deletions tests/Application/config/routes/sylius_invoicing_plugin.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/Behat/Page/Admin/Invoice/ShowPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion tests/Behat/Page/Shop/Order/DownloadInvoicePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
}

0 comments on commit 34d0925

Please sign in to comment.