Add configurable pagination options and default page size - #4042
Open
SimonCremer wants to merge 2 commits into
Open
Add configurable pagination options and default page size#4042SimonCremer wants to merge 2 commits into
SimonCremer wants to merge 2 commits into
Conversation
Introduces a new `pimcore_studio_ui.pagination` configuration node with two options: - `page_size_options`: a comma separated list of page sizes offered in the page-size changer (default `10,20,50,100`), replacing the hardcoded `[10, 20, 50, 100]` used across all listing pagination components. - `default_page_size`: the page size a listing starts with before the user picks another option (default `20`), now used by the user references tab and the main element listing paging provider instead of a hardcoded `20`. Both values are wired from Configuration.php through PimcoreStudioUiExtension/services.yaml into DefaultController's appConfig, and consumed on the frontend via the appConfig singleton (app-config.ts). Also documents both settings under doc/03_Configuration_and_Administration/01_Configuration/07_Pagination.md, including a note that the largest `page_size_options` value must not exceed Elasticsearch/OpenSearch's `index.max_result_window` result limit. Closes pimcore/platform-version#306
Contributor
There was a problem hiding this comment.
Pull request overview
Adds backend-to-frontend configuration for pagination options and default page size.
Changes:
- Defines and exposes pagination configuration through
appConfig. - Replaces several hardcoded page-size option lists.
- Adds pagination configuration documentation.
Review assessment:
- The configuration flow addresses the shared source, but input validation is missing (
Configuration.php:134-136). - Not all consumers honor the configured default (
07_Pagination.md:26). - Global configuration is incorrectly owned by a user-management module (
constants.ts:11-13). - No public API compatibility break was identified, but no regression tests were added.
- The custom page-size input bypasses configured limits (
pagination.tsx:112-123).
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/DependencyInjection/PimcoreStudioUiExtension.php |
Converts and registers pagination parameters. |
src/DependencyInjection/Configuration.php |
Defines pagination configuration nodes. |
src/Controller/DefaultController.php |
Exposes pagination values in appConfig. |
config/services.yaml |
Injects pagination parameters into the controller. |
assets/js/src/core/app/config/app-config.ts |
Adds frontend pagination configuration. |
assets/js/src/core/components/pagination/pagination.tsx |
Applies configured defaults and adds custom sizes. |
assets/js/src/core/modules/user/management/detail/tabs/references/constants.ts |
Sources the references default from configuration. |
assets/js/src/core/modules/user/management/detail/tabs/references/components/pagination/pagination.tsx |
Uses configured size options. |
assets/js/src/core/modules/search/modal/tabs/general/search-result/search-result.tsx |
Uses configured size options. |
assets/js/src/core/modules/reports/components/pagination/pagination.tsx |
Uses configured size options. |
assets/js/src/core/modules/element/listing/decorators/paging/pagination/pagination.tsx |
Uses configured size options. |
assets/js/src/core/modules/element/listing/decorators/paging/context-layer/paging/provider/paging-provider.tsx |
Uses the configured default size. |
assets/js/src/core/modules/element/editor/shared-tab-manager/tabs/dependencies/components/pagination/pagination.tsx |
Uses configured size options. |
assets/js/src/core/modules/element/dynamic-types/definitions/objects/data-related/components/classification-store/components/classification-store-modal/components/pagination/pagination.tsx |
Uses configured size options. |
assets/js/src/core/modules/data-object/listing/data-layer/hooks/use-data-query-helper.ts |
Uses the configured initial request size. |
assets/js/src/core/modules/asset/editor/types/folder/tab-manager/tabs/preview/pagination/pagination.tsx |
Uses configured size options. |
doc/03_Configuration_and_Administration/01_Configuration/README.md |
Links the pagination documentation. |
doc/03_Configuration_and_Administration/01_Configuration/07_Pagination.md |
Documents the new settings. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…arified that reports, previews, and classification store listings are exceptions to the global pagination config. Harden pagination config validation Drop non-integer entries from pimcore_studio_ui.pagination.page_size_options instead of silently casting them, and reject non-integer input (e.g. 20.5,20,5) in the page-size CreatableSelect. Replace the remaining hardcoded default page sizes with appConfig.defaultPageSize for consistency.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Introduces a new
pimcore_studio_ui.paginationconfiguration node with two options:page_size_options: a comma separated list of page sizes offered in the page-size changer (default10,20,50,100), replacing the hardcoded[10, 20, 50, 100]used across all listing pagination components.default_page_size: the page size a listing starts with before the user picks another option (default20), now used by the user references tab and the main element listing paging provider instead of a hardcoded20.Both values are wired from Configuration.php through PimcoreStudioUiExtension/services.yaml into DefaultController's appConfig, and consumed on the frontend via the appConfig singleton (app-config.ts).
Also documents both settings under
doc/03_Configuration_and_Administration/01_Configuration/07_Pagination.md, including a note that the largest
page_size_optionsvalue must not exceed Elasticsearch/OpenSearch'sindex.max_result_windowresult limit.Changes in this pull request
Resolves pimcore/platform-version#306