diff --git a/demo/symfony8/config/packages/doctrine.yaml b/demo/symfony8/config/packages/doctrine.yaml index 8bd4bae3..5a6b0e52 100644 --- a/demo/symfony8/config/packages/doctrine.yaml +++ b/demo/symfony8/config/packages/doctrine.yaml @@ -9,4 +9,3 @@ doctrine: is_bundle: false dir: '%kernel.project_dir%/src/Entity' prefix: 'App\Entity' - alias: App diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e6cc9b28..6c717d23 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -128,6 +128,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- My open questions: the empty list is one sentence through UiKit's `empty` partial. The page passed the sentence as the empty state's *title*, so UiKit printed its default "No items found." as a second line under it; it is now the message, alone. The dashboard component (`manage/_my_questions.html.twig`) renders its empty list through the same partial instead of a muted paragraph. Texts are unchanged. + ## [2.29.1] - 2026-11-21 ### Fixed diff --git a/docs/USAGE.md b/docs/USAGE.md index 3d530214..7179172d 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -1994,7 +1994,7 @@ tenants the resolver opens to the viewer by key count; every row needs `canViewT A dashboard includes the same list: ```twig -{{ include('@NowoTaskBoardBundle/manage/_my_questions.html.twig', {limit: 5}) }} {# tab: 'asked' for the other list #} +{{ include('@NowoTaskBoardBundle/manage/_my_questions.html.twig', {limit: 5}) }} {# tab: 'asked' for the other list; an empty list is UiKit's `empty` (one sentence), on the page and in the component #} ``` Twig functions: `nowo_task_board_questions_enabled()`, `nowo_task_board_questions(task)`, diff --git a/src/Controller/TaskQuestionController.php b/src/Controller/TaskQuestionController.php index 04bf1eea..507cd653 100644 --- a/src/Controller/TaskQuestionController.php +++ b/src/Controller/TaskQuestionController.php @@ -215,7 +215,7 @@ public function mine(Request $request): Response ], array_slice($rows, ($page - 1) * $perPage, $perPage), pagination: $total > 0 ? Pagination::fromTotal($total, $page, $perPage, Pagination::ALLOWED_PER_PAGE, $this->perPage, $route, ($tab === TaskQuestionView::TAB_ASKED ? ['tab' => $tab] : []) + ['per_page' => (string) $perPage], $params) : null, - empty: new EmptyState(TaskBoardPages::label('task_board.question.mine.empty.' . $tab)), + empty: new EmptyState(message: TaskBoardPages::label('task_board.question.mine.empty.' . $tab)), caption: TaskBoardPages::label('task_board.question.mine.title'), bundle: TaskBoardPages::BUNDLE, layout: $twig instanceof Environment ? $this->pages->layout($twig) : null, diff --git a/src/Resources/views/manage/_my_questions.html.twig b/src/Resources/views/manage/_my_questions.html.twig index 4b9de73a..168b97c9 100644 --- a/src/Resources/views/manage/_my_questions.html.twig +++ b/src/Resources/views/manage/_my_questions.html.twig @@ -1,7 +1,8 @@ {# Since 2.23.0 (Beacon spec 242): the viewer's open questions as a dashboard component — {{ include('@NowoTaskBoardBundle/manage/_my_questions.html.twig', {limit: 5}) }}. Variables: limit (default 5), tab - (to_answer | asked, default to_answer). Renders nothing with task_questions.enabled: false. + (to_answer | asked, default to_answer). Renders nothing with task_questions.enabled: false. 2.30: an empty list is + UiKit's `empty` (one sentence). #} {% set _b = 'NowoTaskBoardBundle' %} {% if nowo_task_board_questions_enabled() %} @@ -15,7 +16,8 @@
  • {{ question.text }} {{ question.task.title }}{% if question.dueOn %} · {% endif %}
  • {% if loop.last %}{% endif %} {% else %} -

    {{ ('task_board.question.mine.empty.' ~ _tab)|trans({}, _b) }}

    + {# 2.30: UiKit `empty`, one sentence (no bordered paragraph, no default second line). #} + {{ include(nowo_ui_partial('empty', _b), {empty: {title: null, message: ('task_board.question.mine.empty.' ~ _tab)|trans({}, _b), action: null}, bundle: _b, region: 'empty'}, false) }} {% endfor %} {{ 'task_board.question.mine.see_all'|trans({}, _b) }} diff --git a/tests/Functional/Question/TaskQuestionPagesTest.php b/tests/Functional/Question/TaskQuestionPagesTest.php index e752af20..08bf423e 100644 --- a/tests/Functional/Question/TaskQuestionPagesTest.php +++ b/tests/Functional/Question/TaskQuestionPagesTest.php @@ -205,6 +205,11 @@ public function testMyOpenQuestions(): void $crawler = $this->client->request('GET', '/tools/task-board/questions?tab=asked&per_page=7&page=0'); self::assertResponseIsSuccessful(); self::assertCount(0, $crawler->filter('[data-testid="nowo-task-my-question-row"]')); + // 2.30: the empty list is UiKit's `empty`: one sentence, no default second line. + self::assertCount(1, $crawler->filter('.nowo-ui-empty__message')); + self::assertSame('None of your questions is waiting for an answer.', $crawler->filter('.nowo-ui-empty__message')->text()); + self::assertCount(0, $crawler->filter('.nowo-ui-empty__title')); + self::assertStringNotContainsString('No items found', (string) $this->client->getResponse()->getContent()); $this->login($this->owner); $crawler = $this->client->request('GET', '/tools/task-board/questions?tab=asked'); diff --git a/tests/Functional/Question/TaskQuestionPortsTest.php b/tests/Functional/Question/TaskQuestionPortsTest.php index 6180eacd..f25e800c 100644 --- a/tests/Functional/Question/TaskQuestionPortsTest.php +++ b/tests/Functional/Question/TaskQuestionPortsTest.php @@ -151,6 +151,8 @@ public function testTheViewWithoutASignedInUser(): void self::assertStringContainsString('nowo-task-question-' . $question->getId(), $html); $html = $twig->render('@NowoTaskBoardBundle/manage/_my_questions.html.twig', ['tab' => 'asked']); self::assertStringContainsString('None of your questions is waiting for an answer.', $html); + self::assertStringContainsString('nowo-ui-empty__message', $html, 'The dashboard component empty list is UiKit\'s `empty`.'); + self::assertStringNotContainsString('No items found', $html); self::assertInstanceOf(TaskQuestion::class, $this->manager()->find($question->getId())); } diff --git a/tests/Unit/DependencyInjection/TaskBoardExtensionTest.php b/tests/Unit/DependencyInjection/TaskBoardExtensionTest.php index be42f7a5..66c797b8 100644 --- a/tests/Unit/DependencyInjection/TaskBoardExtensionTest.php +++ b/tests/Unit/DependencyInjection/TaskBoardExtensionTest.php @@ -246,6 +246,12 @@ public function testPrependRegistersFrameworkAssetsAndDoctrineMapping(): void self::assertNotEmpty($container->getExtensionConfig('framework')); self::assertNotEmpty($container->getExtensionConfig('doctrine')); + // DoctrineBundle 3.4 deprecates the mapping `alias`: no prepended mapping carries one. + foreach ($container->getExtensionConfig('doctrine') as $config) { + foreach ($config['orm']['mappings'] ?? [] as $mapping) { + self::assertArrayNotHasKey('alias', $mapping); + } + } } public function testPrependNoOpWithoutOptionalExtensions(): void