Skip to content

Commit

Permalink
minor #317 Replace Sonata block events with Sylius template events (G…
Browse files Browse the repository at this point in the history
…Sadee)

This PR was merged into the 1.0-dev branch.

Discussion
----------



Commits
-------

c6c6ea4 Replace Sonata block events with Sylius template events
f9db6ea Add note about replacing Sonata events to UPGRADE file
  • Loading branch information
Zales0123 authored Jun 18, 2021
2 parents 3cb046e + f9db6ea commit e366896
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
3 changes: 3 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
+ public function getProvinceCode(): ?string
```

1. `sylius_refund_plugin.block_event_listener.account.order_show` and `sylius_refund_plugin.block_event_listener.order_show.credit_memos`
listeners have been replaced by `sylius_ui` configuration

### UPGRADE FROM 1.0.0-RC.9 TO 1.0.0-RC.10

1. Support for Sylius 1.8 has been dropped, upgrade your application to [Sylius 1.9](https://github.com/Sylius/Sylius/blob/master/UPGRADE-1.9.md)
Expand Down
13 changes: 13 additions & 0 deletions src/Resources/config/app/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,19 @@ sylius_grid:
form_options:
class: "%sylius.model.channel.class%"

sylius_ui:
events:
sylius.admin.order.show.summary:
blocks:
credit_memos:
template: '@SyliusRefundPlugin/Order/Admin/creditMemos.html.twig'
priority: 5
sylius.shop.account.order.show.subcontent:
blocks:
credit_memos:
template: '@SyliusRefundPlugin/Order/Shop/creditMemos.html.twig'
priority: 5

doctrine:
dbal:
types:
Expand Down
10 changes: 0 additions & 10 deletions src/Resources/config/services/listeners.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,5 @@
<argument type="service" id="Sylius\RefundPlugin\Checker\OrderRefundsListAvailabilityChecker" />
<tag name="kernel.event_listener" event="sylius.menu.admin.order.show" method="addRefundsButton" />
</service>

<service id="sylius_refund_plugin.block_event_listener.account.order_show" class="Sylius\Bundle\UiBundle\Block\BlockEventListener">
<argument>@SyliusRefundPlugin/Order/Shop/creditMemos.html.twig</argument>
<tag name="kernel.event_listener" event="sonata.block.event.sylius.shop.account.order.show.after_summary" method="onBlockEvent" />
</service>

<service id="sylius_refund_plugin.block_event_listener.order_show.credit_memos" class="Sylius\Bundle\UiBundle\Block\BlockEventListener">
<argument>@SyliusRefundPlugin/Order/Admin/creditMemos.html.twig</argument>
<tag name="kernel.event_listener" event="sonata.block.event.sylius.admin.order.show.after_summary" method="onBlockEvent" />
</service>
</services>
</container>
2 changes: 1 addition & 1 deletion src/Resources/views/Order/Admin/creditMemos.html.twig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ render(path('sylius_refund_order_credit_memos_list', {'orderId': block.settings.resource.id})) }}
{{ render(path('sylius_refund_order_credit_memos_list', {'orderId': order.id})) }}
2 changes: 1 addition & 1 deletion src/Resources/views/Order/Shop/creditMemos.html.twig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ render(url('sylius_refund_plugin_shop_order_credit_memos_partial', {'orderId': block.settings.order.id})) }}
{{ render(url('sylius_refund_plugin_shop_order_credit_memos_partial', {'orderId': order.id})) }}

0 comments on commit e366896

Please sign in to comment.