feature/PIN-8817: add chance to choose how many element user can see within list#1609
feature/PIN-8817: add chance to choose how many element user can see within list#1609borgesis95 merged 11 commits intodevfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates list pagination across multiple pages to allow users to change how many rows/items are shown per page, enabled by upgrading @pagopa/interop-fe-commons.
Changes:
- Upgrade
@pagopa/interop-fe-commonsto^1.5.0. - Replace
usePagination({ limit: ... })withusePagination()and wirePaginationwithrowPerPageOptions. - Add custom per-page options where needed (e.g., catalogs:
[12, 24, 36], docs drawers:[3, 6, 9]).
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/TenantCertifierPage/components/ManageAttributesTab/ManageAttributesTab.tsx | Enables rows-per-page selection on attributes management pagination. |
| src/pages/TenantCertifierPage/components/AssignAttributesTab/AssignAttributesTab.tsx | Enables rows-per-page selection on assign attributes pagination. |
| src/pages/ProviderPurposesListPage/ProviderPurposesList.page.tsx | Adds rows-per-page selection to provider purposes list pagination. |
| src/pages/ProviderKeychainDetailsPage/components/KeychainPublicKeysTab/KeychainPublicKeysTab.tsx | Adds rows-per-page selection to keychain public keys pagination. |
| src/pages/ProviderEServiceTemplatesListPage/ProviderEServiceTemplatesList.page.tsx | Adds rows-per-page selection to e-service templates list pagination. |
| src/pages/ProviderEServiceTemplatesCatalogPage/ProviderEServiceTemplatesCatalog.page.tsx | Adds rows-per-page selection with [12, 24, 36] options for catalog grid pagination. |
| src/pages/ProviderEServiceTemplateDetailsPage/components/ProviderEServiceTemplateTenantsTab/ProviderEServiceTemplateUsingTenantsTable.tsx | Adds rows-per-page selection to “using tenants” table pagination. |
| src/pages/ProviderEServiceListPage/ProviderEServiceList.page.tsx | Adds rows-per-page selection to provider e-service list pagination. |
| src/pages/ProviderEServiceDetailsPage/components/ProviderEServiceKeychainsTab/ProviderEServiceKeychainsTable.tsx | Adds rows-per-page selection to associated keychains pagination. |
| src/pages/ProviderEServiceDetailsPage/components/ProviderEServiceDetailsTab/ProviderEServiceTechnicalInfoSection/ProviderEServiceUpdateDocumentationDrawer.tsx | Adds rows-per-page selection with [3, 6, 9] options for docs pagination in drawer. |
| src/pages/ProviderAgreementsListPage/ProviderAgreementsList.page.tsx | Adds rows-per-page selection to provider agreements list pagination. |
| src/pages/NotificationsPage/Notifications.page.tsx | Adds rows-per-page selection to notifications pagination. |
| src/pages/DelegationsPage/components/DelegationsReceivedTab/DelegationsReceivedTab.tsx | Adds rows-per-page selection to received delegations pagination. |
| src/pages/DelegationsPage/DelegationsGrantedTab/DelegationsGrantedTab.tsx | Adds rows-per-page selection to granted delegations pagination. |
| src/pages/ConsumerPurposesListPage/ConsumerPurposesList.page.tsx | Adds rows-per-page selection to consumer purposes list pagination. |
| src/pages/ConsumerPurposeTemplateListPage/ConsumerPurposeTemplateList.page.tsx | Adds rows-per-page selection to purpose templates list pagination. |
| src/pages/ConsumerPurposeTemplateCatalogPage/ConsumerPurposeTemplateCatalog.page.tsx | Adds rows-per-page selection with [12, 24, 36] options for catalog grid pagination. |
| src/pages/ConsumerEServiceDetailsPage/components/ConsumerLinkedPurposeTemplatesTab.tsx/ConsumerLinkedPurposeTemplatesTab.tsx | Adds rows-per-page selection to linked purpose templates pagination. |
| src/pages/ConsumerEServiceCatalogPage/ConsumerEServiceCatalog.page.tsx | Adds rows-per-page selection with [12, 24, 36] options for catalog grid pagination. |
| src/pages/ConsumerClientManagePage/components/ClientPublicKeys/ClientPublicKeys.tsx | Adds rows-per-page selection to client public keys pagination. |
| src/pages/ConsumerAgreementsListPage/ConsumerAgreementsList.page.tsx | Adds rows-per-page selection to consumer agreements list pagination. |
| src/components/shared/PurposeTemplate/PurposeTemplateLinkedEServiceTab/ConsumerPurposeTemplateLinkedEServiceTable.tsx | Adds rows-per-page selection to linked e-services table pagination. |
| src/components/shared/KeychainsTable/KeychainsTable.tsx | Adds rows-per-page selection to keychains table pagination. |
| src/components/shared/EserviceTemplate/EServiceTemplateUpdateDocumentationDrawer.tsx | Adds rows-per-page selection with [3, 6, 9] options for template docs pagination. |
| src/components/shared/ClientTable/ClientTable.tsx | Adds rows-per-page selection to clients table pagination. |
| package.json | Bumps @pagopa/interop-fe-commons to ^1.5.0. |
| package-lock.json | Updates lockfile for @pagopa/interop-fe-commons@1.5.0 and its peer metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...etailsTab/ProviderEServiceTechnicalInfoSection/ProviderEServiceUpdateDocumentationDrawer.tsx
Outdated
Show resolved
Hide resolved
src/components/shared/EserviceTemplate/EServiceTemplateUpdateDocumentationDrawer.tsx
Outdated
Show resolved
Hide resolved
src/pages/ProviderEServiceListPage/ProviderEServiceList.page.tsx
Outdated
Show resolved
Hide resolved
src/pages/ProviderEServiceTemplatesCatalogPage/ProviderEServiceTemplatesCatalog.page.tsx
Outdated
Show resolved
Hide resolved
src/pages/ConsumerEServiceCatalogPage/ConsumerEServiceCatalog.page.tsx
Outdated
Show resolved
Hide resolved
src/pages/ConsumerPurposeTemplateCatalogPage/ConsumerPurposeTemplateCatalog.page.tsx
Outdated
Show resolved
Hide resolved
Alepazz
left a comment
There was a problem hiding this comment.
I have three different suggestions, just to have a conversation about them. I'll try to summarize here:
- The
rowPerPageOptionsprop follows the same pattern across all 25 components:
rowPerPageOptions={{
onLimitChange: paginationProps.onLimitChange,
limit: paginationParams.limit,
}}
Since onLimitChange already comes from paginationProps and limit from paginationParams, the usePagination hook could return a ready-made rowPerPageOptions object directly This would reduce boilerplate across all consuming components. I know that the changes should be made in interop-common-fe library but I think that can be a good solution to be performed. Let me know about that.
-
Note that there is a single pagination that destructured the pagination manually, instead of using spread pattern {
...paginationProps}like all the other componentes. I think that even Copilot noticed this behavior. -
Pages that previously had a custom initial limit ({ limit: 3 } for documentation drawers, { limit: 12 } for catalog pages) now call
usePagination()without arguments, which will use the default limit. However, they still pass custom options arrays like [3, 6, 9] or [12, 24, 36]. If the default limit doesn't match any of the provided options (e.g., default is 10 but options are [3, 6, 9]), the user would initially see a number of items that isn't selectable in the dropdown. Could you verify the default limit is consistent with the custom options?
Alepazz
left a comment
There was a problem hiding this comment.
Point 3 - Partially resolved
The custom limits passed to usePagination() are now restored ({ limit: 3 } for documentation drawers, { limit: 12 } for catalog pages), which fixes the initial limit mismatch. However, the commit also removes the rowPerPageOptions with custom options [12, 24, 36] from three catalog pages (ConsumerEServiceCatalog, ConsumerPurposeTemplateCatalog, ProviderEServiceTemplatesCatalog). This means the Pagination component will now use its default options.
Two possible issues I can notice:
- If the defaults don't include 12, the initial limit won't be selectable in the dropdown (same mismatch problem, reversed)
- If
rowPerPageOptionsnot being passed means the dropdown isn't rendered at all, the user loses the ability to change items per page (regression)
Could you verify which case applies?
|
Hi, Now we can pass a limit in input to the hook or it will be 10 by default, if we need to have the possibility to change the limit we need to pass the |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 24 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
package.json
Outdated
| { | ||
| "name": "interop-dashboard-frontend", | ||
| "version": "1.6.3", | ||
| "version": "1.6.2", |
There was a problem hiding this comment.
The project version is being decremented from 1.6.3 to 1.6.2. Releasing with a lower semver than the previous version can break tooling/pipelines and makes it unclear which build is newer. Update the version to the correct next version (or avoid changing it in this PR if versioning is handled elsewhere).
| "version": "1.6.2", | |
| "version": "1.6.4", |
src/components/shared/EserviceTemplate/EServiceTemplateUpdateDocumentationDrawer.tsx
Show resolved
Hide resolved
...etailsTab/ProviderEServiceTechnicalInfoSection/ProviderEServiceUpdateDocumentationDrawer.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 23 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...etailsTab/ProviderEServiceTechnicalInfoSection/ProviderEServiceUpdateDocumentationDrawer.tsx
Outdated
Show resolved
Hide resolved
|


No description provided.