diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 7e74d8b..d744d2c 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -64,6 +64,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- **Form actions order follows UiKit again (UiKit 2.66.1, owner decision 2026-11-22):** the path and redirect forms + (new / edit) get their order from the UiKit form scaffold, which follows `theme.form_actions_order`: from UiKit 2.66.1 + the primary first, then Cancel (the 1.19 order), unless the host sets `form_actions_order: cancel_first`. The import + dialog keeps Cancel first. Still `nowo-tech/ui-kit-bundle` **^2.66**. +- Tests: `testPathAndRedirectFormsFollowTheConfiguredOrder` (was `testPathAndRedirectFormsPutCancelFirst`) checks the + forms against the stub theme's configured order instead of a hard-coded Cancel first (green on UiKit 2.66.0 and + 2.66.1). + ## [1.20.0] - 2026-11-22 ### Changed diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index f23725e..17c1316 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -107,6 +107,10 @@ ## Unreleased +- **Form actions order.** With UiKit **2.66.1** the path and redirect forms put the primary first again, then Cancel + (UiKit's default `theme.form_actions_order: primary_first`). Hosts that want Cancel first set + `nowo_ui_kit.theme.form_actions_order: cancel_first`. The import dialog keeps Cancel first either way. + ## To 1.20.0 From **1.19.0**: diff --git a/tests/Integration/Contract/PageContractTest.php b/tests/Integration/Contract/PageContractTest.php index c553183..b747ff0 100644 --- a/tests/Integration/Contract/PageContractTest.php +++ b/tests/Integration/Contract/PageContractTest.php @@ -8,6 +8,8 @@ use Nowo\RoutingKitBundle\Tests\Support\PanelPageFixtures; use Nowo\UiKitBundle\Test\PageContractTestCase; use Nowo\UiKitBundle\Test\PageFixture; +use Nowo\UiKitBundle\Test\StubHost; +use Nowo\UiKitBundle\Theme\Theme; use Nowo\UiKitBundle\View\ConfirmPage; use Nowo\UiKitBundle\View\PageHeader; use PHPUnit\Framework\Attributes\DataProvider; @@ -290,19 +292,28 @@ protected static function translationDirs(): array return [dirname(__DIR__, 3) . '/src/Resources/translations']; } - /** UiKit 2.66 (Beacon UX-017): every form actions row puts Cancel first, then the primary. */ + /** + * UiKit 2.66 (Beacon UX-017): every form actions row is checked. On UiKit 2.66.1 the rule follows the configured order + * (page forms in theme.form_actions_order, dialogs Cancel first); on 2.66.0 it checks Cancel first everywhere. + */ protected static function formActionsOrderChecked(): bool { return true; } - public function testPathAndRedirectFormsPutCancelFirst(): void + /** + * UiKit 2.66.1 (owner decision 2026-11-22): the path and redirect forms get their actions row from the UiKit form + * scaffold, in the stub theme's theme.form_actions_order (primary_first by default since 2.66.1, cancel_first on + * 2.66.0). + */ + public function testPathAndRedirectFormsFollowTheConfiguredOrder(): void { + $expected = Theme::fromConfig('none', StubHost::theme())->formActionsOrder() === 'primary_first' ? [['primary', 'cancel']] : [['cancel', 'primary']]; foreach ([ ['@NowoRoutingKitBundle/panel/form.html.twig', PanelPageFixtures::form(null)], ['@NowoRoutingKitBundle/panel/redirects/form.html.twig', PanelPageFixtures::redirectsForm(null)], ] as [$template, $context]) { - self::assertSame([['cancel', 'primary']], $this->renderPage(new PageFixture($template, $context))->formActionsRows(), $template); + self::assertSame($expected, $this->renderPage(new PageFixture($template, $context))->formActionsRows(), $template); } }