Skip to content

Use compact pagination on explore page when total pages is unavailable

What does this MR do and why?

Related to #437350 (closed)

If there are more than 10,000 records then we do not return the X-TOTAL header. This causes the pagination to not be shown on the groups explore page. This MR updates the pagination component to show the compact pagination when X-TOTAL header is not available.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

X-TOTAL header not available

Before After
Screenshot_2024-05-23_at_4.04.56_PM Screenshot_2024-05-23_at_4.04.42_PM

X-TOTAL header is available

No changes expected

Before After
Screenshot_2024-05-30_at_3.19.56_PM Screenshot_2024-05-30_at_3.19.35_PM

How to set up and validate locally

  1. Change lib/gitlab/pagination/offset_header_builder.rb#L16-17 to:
@total = nil
@total_pages = nil
  1. Go to http://gdk.test:3000/explore/groups
Edited by Peter Hegman

Merge request reports