Skip to content

Commit

Permalink
Support for Sylius 1.14 (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpysiak authored Dec 16, 2024
2 parents 2b4328f + b133d6c commit 7cb34fe
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
matrix:
php: ["8.1", "8.2", "8.3"]
symfony: ["^5.4", "^6.4"]
sylius: ["~1.12.0", "~1.13.0"]
sylius: ["~1.13.0", "~1.14.0"]
node: ["20.x"]
mysql: ["8.0"]
mysql: ["8.4"]
env:
APP_ENV: test
DATABASE_URL: "mysql://root:[email protected]/sylius?serverVersion=${{ matrix.mysql }}"
Expand Down
7 changes: 7 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# UPGRADE FROM 0.15.0 TO 0.16.0

1. Support for Sylius 1.14 has been added, it is now the recommended Sylius version to use.

2. Support for Sylius 1.12 has been dropped, upgrade your application to [Sylius 1.13](https://github.com/Sylius/Sylius/blob/1.14/UPGRADE-1.13.md).
or to [Sylius 1.14](https://github.com/Sylius/Sylius/blob/1.14/UPGRADE-1.14.md).

### UPGRADE FROM 0.14.0 TO 0.15.0

1. Support for Sylius 1.13 has been added, it is now the recommended Sylius version to use with the plugin.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
],
"require": {
"php": "^8.1",
"sylius/sylius": "~1.12.0 || ~1.13.0",
"sylius/sylius": "~1.13.0 || ~1.14.0",
"friendsofsymfony/jsrouting-bundle": "^3.2"
},
"require-dev": {
Expand Down
17 changes: 13 additions & 4 deletions src/Resources/views/Order/create.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,21 @@
<script src="{{ path('fos_js_routing_js', { callback: 'fos.Router.setData' }) }}"></script>
<script>
$(document).ready(function() {
$('body').on('DOMNodeInserted', '#sylius_admin_order_creation_new_order_payments [data-form-collection="item"]', function() {
$('#sylius_admin_order_creation_new_order_payments [data-form-collection="add"]').hide();
const targetNode = document.querySelector('#sylius_admin_order_creation_new_order_payments');
const observer = new MutationObserver(mutations => {
mutations.forEach(mutation => {
if (mutation.addedNodes.length > 0) {
document.querySelector('#sylius_admin_order_creation_new_order_payments [data-form-collection="add"]').style.display = 'none';
}
if (mutation.removedNodes.length > 0) {
document.querySelector('#sylius_admin_order_creation_new_order_payments [data-form-collection="add"]').style.display = '';
}
});
});
$('body').on('DOMNodeRemoved', '#sylius_admin_order_creation_new_order_payments [data-form-collection="item"]', function() {
$('#sylius_admin_order_creation_new_order_payments [data-form-collection="add"]').show();
observer.observe(targetNode, {
childList: true,
subtree: true,
});
$('#sylius_admin_order_creation_new_order_shipments [data-form-collection="add"]').on('click', function(e) {
Expand Down

0 comments on commit 7cb34fe

Please sign in to comment.