Skip to content

Support pagination when loading award emojis in work items

What does this MR do and why?

Currently, maximum 100 award emojis are loaded in work items due to default page size in the backend. Support pagination for award emojis in work items so that all the emojis get loaded.

Screenshots or screen recordings

In below recording, there are 27 emojis awarded on the work item. To showcase multiple calls to fetch award emojis, the page size is set to 5 instead of 100. Thus, the query is called 6 times in total.

Screen Recording 2023-07-06 at 7.35.09 PM.mov

How to set up and validate locally

Prerequisites:

  1. Make sure GDK is running on Enterprise mode

  2. Enable the following feature flag to create objects supporting this feature using gdk rails console:

    `Feature.enable(:okrs_mvc, Project.find_by_full_path('gitlab-org/gitlab-test'))`

Steps:

  1. Login with any user
  2. Go to any Project > Issues > List
  3. Create an new Objective under New issue split button
  4. Go to Objective detail page
  5. Check if the award emojis are loading properly
  6. There should be no error

To check the pagination on the local setup,

  1. Login with a particular user
  2. Go to any Project > Issues > List
  3. Create an new Objective under New issue split button
  4. Go to Objective detail page and award 20 emojis
  5. Set DEFAULT_PAGE_SIZE_WORK_ITEM_AWARD_EMOJIS to 5 in the /work_items/constants.js file
  6. Check if the award emojis are loading properly and the query is called 4 times
  7. There should be no error

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #414857 (closed)

Edited by Rajan Mistry

Merge request reports

Loading