Fix MR analytics dashboard table pagination
What does this MR do and why?
Fixes some pagination issues that were visible in the MR analytics dashboard throughput table.
Changes
- Removes default page config inherited from the legacy MR analytics app
- When clicking next/prev page from the DataTable, make sure to include the page size (
first
orlast
) - DataTable pagination now uses the same nomenclature as our GraphQL API (
startCursor
/endCursor
instead ofprevPageCursor
/nextPageCursor
) - Restrict table to 20 rows and match the visualization height as well
References
Screenshots or screen recordings
Note: Example limited to 4 rows as opposed to the expected 20
Screen_Recording_2025-09-04_at_2.11.25_PM
How to set up and validate locally
- Enable
consolidate_mr_analytics_in_shared_dashboards
feature flag - Create test MRs for a project of your choice
project = Project.find(PROJECT_ID)
# Set the dates
created_date = 1.week.ago
merged_date = 1.day.ago
# Create 100 closed MRs with specific dates
100.times do |i|
source_branch = "feature-branch-#{i}"
# Create a branch
project.repository.create_branch(source_branch, 'master') # Use your default branch name here
# Create MR with created_at set to 1 week ago
mr = MergeRequest.new(
title: "Test MR #{i}",
source_project: project,
target_project: project,
source_branch: source_branch,
target_branch: 'master',
author: User.first
)
# Set created_at to 1 week ago
mr.created_at = created_date
mr.save!
# Merge the MR with merged_at set to yesterday
mr.mark_as_merged
mr.metrics.update!(merged_at: merged_date)
puts "Created MR #{i}"
end
- Navigate to the MR analytics dashboard for your project and verify that the table pagination works as expected (http://gdk.test:3000/flightjs/Flight/-/analytics/dashboards/merge_request_analytics)
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #542327 (closed)
Edited by Alex Pennells