Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions docs/UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**:
Expand Down
17 changes: 14 additions & 3 deletions tests/Integration/Contract/PageContractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}

Expand Down