Conversation
WalkthroughThe pull request introduces two template modifications in the Sylius Admin Bundle. The first change updates the filter rendering logic in the grid template to conditionally display filters only when they are available. The second change enhances the pagination helper template by adding a disabled button state when no alternative pagination limits exist, improving the user interface's responsiveness and clarity. Changes
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/Sylius/Bundle/AdminBundle/templates/shared/helper/pagination.html.twig (1)
28-31: LGTM! Consider adding aria-label for better accessibility.The implementation correctly handles the case when no other pagination limits are available, maintaining UI consistency with the disabled state. The use of
btn-ghost-secondaryclass aligns well with Bootstrap conventions.Consider adding an aria-label to improve accessibility:
- <button type="button" class="btn btn-ghost-secondary dropdown-toggle" disabled> + <button type="button" class="btn btn-ghost-secondary dropdown-toggle" disabled aria-label="{{ 'sylius.ui.show'|trans }} {{ paginator.maxPerPage }} {{ 'sylius.ui.items_per_page'|trans }}">src/Sylius/Bundle/AdminBundle/templates/shared/crud/index/content/grid/filters.html.twig (1)
15-19: Consider caching the filtered and sorted filters collection.The current implementation filters and sorts the collection on each template render. Consider moving this logic to the controller or caching the result.
- {% for filter in resources.definition.enabledFilters|filter(filter => filter.enabled)|sylius_sort_by('position') %} + {% set sorted_filters = resources.definition.enabledFilters|filter(filter => filter.enabled)|sylius_sort_by('position') %} + {% for filter in sorted_filters %}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/Sylius/Bundle/AdminBundle/templates/shared/crud/index/content/grid/filters.html.twig(1 hunks)src/Sylius/Bundle/AdminBundle/templates/shared/helper/pagination.html.twig(1 hunks)
🔇 Additional comments (1)
src/Sylius/Bundle/AdminBundle/templates/shared/crud/index/content/grid/filters.html.twig (1)
9-9: LGTM! Efficient implementation of conditional filter display.
The condition correctly checks for enabled filters before rendering the entire filters section, which aligns perfectly with the PR objective to hide the filters box when no filters are present.
Bunnyshell Preview Environment deletedAvailable commands:
|
Hide filters box if none are present

Display disabled limit button if there are no other limits - related to Sylius/Stack#163

Summary by CodeRabbit
New Features
Bug Fixes