Skip to content

Support backend pagination for the access tokens

What does this MR do and why?

Support backend pagination for the access token tables

Personal, group and project access tokens supports backend pagination. This is enabled using the access_token_pagination feature flag. Impersonation tokens don't support backend pagination.

In this commit, we modify the frontend to support the backend pagination. The paginator appears when the number of tokens is larger than 20 (not configurable at the moment).

Previously, the pagination was done all in the frontend, which mean that all the data was sent to the frontend at once. The paginator appeared when the number of tokens were larger than 100.

Relates to #367840 (closed)

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

The page is shorter because only 20 tokens are showed per-page.

Before After
image image

How to set up and validate locally

Turn on the access_token_pagination feature flag: /rails/features.

To generate 1000 personal access tokens for the root user type gdk psql and:

DO $$
  BEGIN
    FOR X IN 1..1000 LOOP
      INSERT INTO "personal_access_tokens" (name, created_at, updated_at, expires_at, organization_id, user_id) VALUES (X, '2024-09-29', '2024-09-29', '2024-12-30', 1, 1);
    END LOOP;
  END;
$$;

The four places where the access token tables are displayed:

  1. Personal access token page: /-/user_settings/personal_access_tokens
  2. Group access token page, for example: /groups/flightjs/-/settings/access_tokens
  3. Project access token page, for example: /flightjs/Flight/-/settings/access_tokens
  4. Impersonation token page, for example: /admin/users/root/impersonation_tokens
Edited by Eduardo Sanz García

Merge request reports

Loading