Skip to content

Conversation

@albozek
Copy link
Contributor

@albozek albozek commented Jul 10, 2025

🎫 Issue IBX-10238

Description:

For QA:

Documentation:

@albozek albozek requested review from a team and Copilot July 10, 2025 12:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a unified table headline across all dashboard tabs by importing and using the results_headline macro in table includes.

  • Adds results_headline import in each dashboard tab template
  • Passes a headline argument to the table include, leveraging either data|length or pager.getNbResults()
  • Ensures consistent display of result counts above tables

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/.../dashboard/tab/my_media.html.twig Import results_headline and add headline to table
src/.../dashboard/tab/my_draft_list.html.twig Import results_headline and add headline to table
src/.../dashboard/tab/my_content.html.twig Import results_headline and add headline to table
src/.../dashboard/tab/all_media.html.twig Import results_headline and add headline to table
src/.../dashboard/tab/all_content.html.twig Import results_headline and add headline to table
Comments suppressed due to low confidence (6)

src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_media.html.twig:41

  • If data is ever undefined or null, length(data) will error before default(0) can apply. Consider using results_headline((data|default([])|length)) so the default applies to data first.
    headline: results_headline(data|length|default(0)),

src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_content.html.twig:41

  • As above, wrap default([]) before length to avoid errors when data is null: results_headline((data|default([])|length)).
    headline: results_headline(data|length|default(0)),

src/bundle/Resources/views/themes/admin/ui/dashboard/tab/all_media.html.twig:50

  • Move the default([]) filter before length, e.g. results_headline((data|default([])|length)), to guard against data being undefined.
    headline: results_headline(data|length|default(0)),

src/bundle/Resources/views/themes/admin/ui/dashboard/tab/all_content.html.twig:50

  • Use results_headline((data|default([])|length)) so the default is applied to data before calculating length, preventing potential Twig errors.
    headline: results_headline(data|length|default(0)),

src/bundle/Resources/views/themes/admin/ui/dashboard/tab/my_draft_list.html.twig:58

  • If pager.getNbResults() could ever be null or undefined, add a default filter: results_headline((pager.getNbResults()|default(0))).
    headline: results_headline(pager.getNbResults()),

@albozek albozek force-pushed the IBX-10238-dashboard-tab-headlines branch from 6471cb3 to edd0596 Compare July 11, 2025 07:13
@sonarqubecloud
Copy link

@adamwojs adamwojs merged commit 6ee764f into 4.6 Jul 16, 2025
28 checks passed
@adamwojs adamwojs deleted the IBX-10238-dashboard-tab-headlines branch July 16, 2025 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants