Skip to content

feat: Persistent Page Size UI #21627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Mar 27, 2025
Merged

feat: Persistent Page Size UI #21627

merged 18 commits into from
Mar 27, 2025

Conversation

bupd
Copy link
Contributor

@bupd bupd commented Feb 13, 2025

Thank you for contributing to Harbor!

Comprehensive Summary of your change

  • This PR introduces global page size for all pages.
  • Simplifies LocalStorage.
  • Includes changes only on frontend
  • New page sizes 15, 25, 50, 100

Issue being fixed

Fixes #21117

LocalStorage of Browser Before Changes

{
    "ListProjectComponent": { "pageSize": 50 },
    "PendingListComponent": { "pageSize": 15 },
    "ScheduleListComponent": { "pageSize": 25 },
    "WorkerListComponentPool": { "pageSize": 25 },
    "GcHistoryComponent": { "pageSize": 25 },
    "SecurityHubComponent": { "pageSize": 25 },
    "ConfigurationScannerComponent": { "pageSize": 25 },
    "ProjectQuotasComponent": { "pageSize": 25 },
    "LabelComponent": { "pageSize": 15 },
    "DistributionInstancesComponent": { "pageSize": 15 },
    "ListReplicationRuleComponent": {
        "pageSize": 30,
        "columnHiddenArray": [ false, false, false, false, false, false, true, true, false ]
    },
    "SystemEndpointComponent": { "pageSize": 25 },
    "SystemRobotAccountsComponent": { "pageSize": 50 },
    "SystemUserComponent": { "pageSize": 50 },
    "SystemRecentLogComponent": { "pageSize": 50 },
    "RepositoryGridviewComponent": { "pageSize": 50 },
    "ArtifactListTabComponent": {
        "pageSize": 50,
        "columnHiddenArray": [ false, false, false, false, false, false, false, true, false, false, false ]
    },
    "ArtifactTagComponent": { "pageSize": 50 },
    "MemberComponent": { "pageSize": 25 },
    "P2pPolicyComponent": { "pageSize": 10 },
    "ProjectRobotAccountComponent": { "pageSize": 50 },
    "WebhookComponent": { "pageSize": 50 },
    "ProjectAuditLogComponent": { "pageSize": 50 },
    "ArtifactVulnerabilitiesComponent": { "pageSize": 50 },
    "ArtifactSbomComponent": { "pageSize": 50 }
}

LocalStorage of Browser After Changes

{
    "pageSize": 50, // single global page size for all pages
    "columnHiddenMap": {
        "ArtifactListTabComponent": [ false, false, false, false, false, false, true, true, false ],
        "ListReplicationRuleComponent": [ false, false, false, false, false, false, true, true, false ]
    }
}

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/enhancement, area/ui"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.37%. Comparing base (c8c11b4) to head (62331e1).
Report is 438 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #21627      +/-   ##
==========================================
+ Coverage   45.36%   46.37%   +1.00%     
==========================================
  Files         244      253       +9     
  Lines       13333    14242     +909     
  Branches     2719     2928     +209     
==========================================
+ Hits         6049     6605     +556     
- Misses       6983     7286     +303     
- Partials      301      351      +50     
Flag Coverage Δ
unittests 46.37% <ø> (+1.00%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 497 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

* update all other pages to have same size factors

Signed-off-by: bupd <[email protected]>
@bupd bupd changed the title (WIP) feat: Persistent Page Size feat: Persistent Page Size Feb 13, 2025
@bupd bupd marked this pull request as ready for review February 13, 2025 02:38
@bupd bupd requested a review from a team as a code owner February 13, 2025 02:38
@bupd bupd changed the title feat: Persistent Page Size feat: Persistent Page Size UI Feb 13, 2025
@Vad1mo Vad1mo added release-note/enhancement Label to mark PR to be added under release notes as enhancement area/ui labels Feb 13, 2025
@wy65701436 wy65701436 added the target/2.13.0 issues that are targeting v2.13.0 label Mar 12, 2025
'PAGINATION.PAGE_SIZE' | translate
}}</clr-dg-page-size>
<clr-dg-page-size
[clrPageSizeOptions]="[15, 25, 50, 100]"
Copy link
Contributor

@xuelichao xuelichao Mar 18, 2025

Choose a reason for hiding this comment

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

I see a lots of same array in the following pages [15, 25, 50, 100]
I am just wondering if we can define a const variable to keep this static array [15, 25, 50, 100]
Then other pages can import it into its own component page or may be create a BasePage which can be extends by other components.
By do it, we can easily to control and update the page number list in one place in the future if needed.
What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure that's a good idea.

@bupd
Copy link
Contributor Author

bupd commented Mar 22, 2025

ready to merge

Copy link
Contributor

@xuelichao xuelichao left a comment

Choose a reason for hiding this comment

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

LGTM

@wy65701436 wy65701436 enabled auto-merge (squash) March 25, 2025 10:11
@wy65701436 wy65701436 merged commit 9cde2c3 into goharbor:main Mar 27, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui release-note/enhancement Label to mark PR to be added under release notes as enhancement target/2.13.0 issues that are targeting v2.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify Pagination with Persistent User-Selected Page Size
6 participants