From a5f212d0fed65a094fe789548e3d69062f4b094c Mon Sep 17 00:00:00 2001 From: Grzegorz Sadowski Date: Mon, 29 Sep 2025 13:26:09 +0200 Subject: [PATCH 1/5] [Admin] Render button for order refund only if refund is possible --- .../header/title_block/actions/refunds.html.twig | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/templates/admin/order/content/header/title_block/actions/refunds.html.twig b/templates/admin/order/content/header/title_block/actions/refunds.html.twig index 10762014a..381782caa 100644 --- a/templates/admin/order/content/header/title_block/actions/refunds.html.twig +++ b/templates/admin/order/content/header/title_block/actions/refunds.html.twig @@ -1,7 +1,10 @@ {% set order = hookable_metadata.context.resource %} -{% set path = path('sylius_refund_order_refunds_list', {'orderNumber': order.number,}) %} - - {{ ux_icon('tabler:repeat', {'class': 'icon dropdown-item-icon'}) }} - {{ 'sylius_refund.ui.refunds'|trans }} - +{% if can_refund_order(order.number) %} + {% set path = path('sylius_refund_order_refunds_list', {'orderNumber': order.number,}) %} + + + {{ ux_icon('tabler:repeat', {'class': 'icon dropdown-item-icon'}) }} + {{ 'sylius_refund.ui.refunds'|trans }} + +{% endif %} From 87310c6fd7db3d3312ee6feadcd6546f4565d6bd Mon Sep 17 00:00:00 2001 From: Grzegorz Sadowski Date: Mon, 29 Sep 2025 14:06:33 +0200 Subject: [PATCH 2/5] [Behat][Admin] Adjust scenario for rendering refund button --- features/refunding_single_order_unit.feature | 2 +- tests/Behat/Context/Ui/ManagingOrdersContext.php | 4 +--- tests/Behat/Page/Admin/Order/ShowPage.php | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/features/refunding_single_order_unit.feature b/features/refunding_single_order_unit.feature index 299d0fe92..851cf208f 100644 --- a/features/refunding_single_order_unit.feature +++ b/features/refunding_single_order_unit.feature @@ -47,7 +47,7 @@ Feature: Refunding a single order unit @ui Scenario: Not being able to refund unit from an order that is unpaid When I am viewing the summary of the order "#00000022" - Then I should see disabled refunds button + Then I should not see refunds button @application Scenario: Not being able to refund unit from an order that is unpaid diff --git a/tests/Behat/Context/Ui/ManagingOrdersContext.php b/tests/Behat/Context/Ui/ManagingOrdersContext.php index a5033c882..e2e3ca389 100644 --- a/tests/Behat/Context/Ui/ManagingOrdersContext.php +++ b/tests/Behat/Context/Ui/ManagingOrdersContext.php @@ -33,9 +33,7 @@ public function shouldBeNotifiedThatTheOrderShouldBePaid(): void ); } - /** - * @Then I should not see refunds button - */ + #[Then('I should not see refunds button')] public function iShouldNotSeeRefundsButton(): void { Assert::false($this->showPage->hasRefundsButton()); diff --git a/tests/Behat/Page/Admin/Order/ShowPage.php b/tests/Behat/Page/Admin/Order/ShowPage.php index 69e06d5dd..71024b830 100644 --- a/tests/Behat/Page/Admin/Order/ShowPage.php +++ b/tests/Behat/Page/Admin/Order/ShowPage.php @@ -37,7 +37,7 @@ public function hasDownloadCreditMemoButton(int $index): bool public function hasRefundsButton(): bool { - return $this->getDocument()->hasButton('Refunds'); + return $this->getDocument()->has('css', '[data-test-refunds]'); } public function hasDisabledRefundsButton(): bool From 61ddc313cf36248cdcb078e3efe92d0f453a18da Mon Sep 17 00:00:00 2001 From: Grzegorz Sadowski Date: Mon, 29 Sep 2025 14:08:03 +0200 Subject: [PATCH 3/5] Add /var directory to .gitignore file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9117e715e..42eaa5c8b 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ tests/Application/node_modules/ /tests/TestApplication/.env.local /tests/TestApplication/.env.*.local +/var/ phpspec.yml From de93d385b87daa03eb77bf3489403cf931fa336f Mon Sep 17 00:00:00 2001 From: Mateusz Date: Mon, 20 Jul 2026 15:43:01 +0200 Subject: [PATCH 4/5] [Maintenance][CI] Ensure wkhtmltopdf is executable after cache restore --- .github/workflows/build.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c726237de..0350f1b2a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -132,6 +132,11 @@ jobs: wget https://github.com/wkhtmltopdf/packaging/releases/download/${{ matrix.wkhtmltopdf }}/wkhtmltox_${{ matrix.wkhtmltopdf }}.jammy_amd64.deb sudo dpkg -i wkhtmltox_${{ matrix.wkhtmltopdf }}.jammy_amd64.deb + - + name: Ensure wkhtmltopdf is executable + if: matrix.wkhtmltopdf != false + run: chmod +x /usr/local/bin/wkhtmltopdf + - name: Output PHP version for Symfony CLI run: php -v | head -n 1 | awk '{ print $2 }' > .php-version From d80efa2183c211a26e038c11a0f76ae469f243c7 Mon Sep 17 00:00:00 2001 From: Mateusz Date: Tue, 21 Jul 2026 08:49:30 +0200 Subject: [PATCH 5/5] [Maintenance][CI] Restore knp_snappy binary wiring in test app config --- tests/TestApplication/config/config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/TestApplication/config/config.yaml b/tests/TestApplication/config/config.yaml index 18c891fe6..cd2d45697 100644 --- a/tests/TestApplication/config/config.yaml +++ b/tests/TestApplication/config/config.yaml @@ -5,3 +5,9 @@ imports: twig: paths: '%kernel.project_dir%/../../../tests/TestApplication/templates': ~ + +knp_snappy: + pdf: + enabled: true + binary: '%env(resolve:WKHTMLTOPDF_PATH)%' + options: []