Skip to content

feature/PIN-8817: add chance to choose how many element user can see within list#1609

Merged
borgesis95 merged 11 commits intodevfrom
feature/pin-8817-elements-per-page
Feb 4, 2026
Merged

feature/PIN-8817: add chance to choose how many element user can see within list#1609
borgesis95 merged 11 commits intodevfrom
feature/pin-8817-elements-per-page

Conversation

@borgesis95
Copy link
Contributor

No description provided.

@borgesis95 borgesis95 marked this pull request as ready for review January 23, 2026 13:54
Copilot AI review requested due to automatic review settings January 23, 2026 13:54
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

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-commons to ^1.5.0.
  • Replace usePagination({ limit: ... }) with usePagination() and wire Pagination with rowPerPageOptions.
  • 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.

Copy link
Collaborator

@Alepazz Alepazz left a comment

Choose a reason for hiding this comment

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

I have three different suggestions, just to have a conversation about them. I'll try to summarize here:

  1. The rowPerPageOptions prop 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.

  1. 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.

  2. 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?

Copy link
Collaborator

@Alepazz Alepazz left a comment

Choose a reason for hiding this comment

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

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 rowPerPageOptions not 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?

Copilot AI review requested due to automatic review settings January 28, 2026 16:52
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@antofo
Copy link
Collaborator

antofo commented Jan 29, 2026

Hi,
I was told to remove the possibility to select a limit from some sections (the ones that have as limit 12), so I don't have to pass the rowPerPageOptions.
I modified the usePagination hook to return the correct limit when it is modified even if we pass in input a starting value.

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 rowPerPageOptions prop to the Pagination component (default options [10, 24, 36]). If we have a starting limit different from 10 (or one of the default options), the limit selector to work properly will require the options field in the rowPerPageOptions containing the different limit as one of the values.

Copilot AI review requested due to automatic review settings February 2, 2026 15:43
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

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",
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

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).

Suggested change
"version": "1.6.2",
"version": "1.6.4",

Copilot uses AI. Check for mistakes.
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

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.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 3, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
4.5% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@borgesis95 borgesis95 merged commit d5a4211 into dev Feb 4, 2026
9 of 10 checks passed
@borgesis95 borgesis95 deleted the feature/pin-8817-elements-per-page branch February 4, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants