Skip to content

Commit

Permalink
Merge pull request #339 from GSadee/improve-invoice-grid
Browse files Browse the repository at this point in the history
[Admin] Remove unneeded route + grid improvements
  • Loading branch information
mpysiak authored Nov 20, 2024
2 parents e643edc + 68619e2 commit 4bea6d1
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 66 deletions.
35 changes: 35 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,38 @@
- `Sylius\InvoicingPlugin\Generator\SequentialInvoiceNumberGenerator`

1. The translation keys have been changed from `sylius_invoicing_plugin` and `sylius_admin_order_creation` to `sylius_invoicing`.

1. The `sylius_invoicing_admin_order_show_by_number` route and `Sylius\InvoicingPlugin\Ui\RedirectToOrderShowAction` controller
have been removed and replaced by the `sylius_admin_order_show` route from the Sylius Core.

1. The following templates have been removed:
- `@SyliusInvoicingPlugin/Invoice/Grid/Field/orderNumber.html.twig`
- `@SyliusInvoicingPlugin/Invoice/Grid/Field/channel.html.twig`

1. The invoice grid configuration has been updated accordingly to the above changes:

```diff
sylius_grid:
grids:
sylius_invoicing_plugin_invoice:
# ...
fields:
# ...
orderNumber:
type: twig
label: sylius.ui.order
- path: order.number
- options:
- template: '@SyliusInvoicingPlugin/Invoice/Grid/Field/orderNumber.html.twig'
+ path: order
+ options:
+ template: "@SyliusAdmin/Order/Grid/Field/number.html.twig"
sortable: order.number
channel:
type: twig
label: sylius.ui.channel
options:
- template: "@SyliusInvoicingPlugin/Invoice/Grid/Field/channel.html.twig"
+ template: "@SyliusAdmin/Order/Grid/Field/channel.html.twig"
# ...
```
10 changes: 0 additions & 10 deletions src/Resources/config/app/routing/admin_invoicing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,3 @@ sylius_invoicing_plugin_admin_order_invoices_partial:
repository:
method: findByOrderNumber
arguments: $orderNumber

sylius_invoicing_admin_order_show_by_number:
path: /orders/by-number/{number}
methods: [GET]
defaults:
_controller: Sylius\InvoicingPlugin\Ui\RedirectToOrderShowAction
_sylius:
section: admin
permission: true
alias: invoicing_plugin
6 changes: 3 additions & 3 deletions src/Resources/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ sylius_grid:
orderNumber:
type: twig
label: sylius.ui.order
path: order.number
path: order
options:
template: '@SyliusInvoicingPlugin/Invoice/Grid/Field/orderNumber.html.twig'
template: "@SyliusAdmin/Order/Grid/Field/number.html.twig"
sortable: order.number
channel:
type: twig
label: sylius.ui.channel
options:
template: "@SyliusInvoicingPlugin/Invoice/Grid/Field/channel.html.twig"
template: "@SyliusAdmin/Order/Grid/Field/channel.html.twig"
total:
type: twig
label: sylius.ui.total
Expand Down
5 changes: 0 additions & 5 deletions src/Resources/config/services/ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,5 @@
<service id="sylius_invoicing_plugin.grid.filter.channel" class="Sylius\InvoicingPlugin\Grid\Filter\ChannelFilter">
<tag name="sylius.grid_filter" type="invoice_channel" form_type="Sylius\InvoicingPlugin\Form\Type\ChannelFilterType" />
</service>

<service id="Sylius\InvoicingPlugin\Ui\RedirectToOrderShowAction">
<argument type="service" id="router" />
<argument type="service" id="sylius.repository.order" />
</service>
</services>
</container>
1 change: 0 additions & 1 deletion src/Resources/views/Invoice/Grid/Field/channel.html.twig

This file was deleted.

This file was deleted.

46 changes: 0 additions & 46 deletions src/Ui/RedirectToOrderShowAction.php

This file was deleted.

0 comments on commit 4bea6d1

Please sign in to comment.