Skip to content

Improve list custom roles component

Daniel Tian requested to merge 431713-improve-list-custom-roles-component into master

What does this MR do and why?

On the Roles and Permissions page, there is a list of custom permissions:

ksnip_20240120-000519

This MR makes the following improvements:

  1. Some unused fields in the member roles query were removed.

  2. The available permissions query was moved from ListMemberRoles to CreateMemberRole. ListMemberRoles didn't use the query, it just ran it and passed the data to CreateMemberRole. A skeleton loader was also added to CreateMemberRole to show that the permissions are loading.

  3. Simplified the member roles Apollo query and fixed an issue where the base role would not be localized properly.

How to set up and validate locally

  1. Set the environment variable export GITLAB_SIMULATE_SAAS=1.
  2. Go to any top-level group, then click on Settings -> Roles and Permissions.
  3. Verify that the custom roles list renders properly.
  4. Click on Add new role to open the create member role form. Verify that the permissions shows the skeleton loader while it's loading. You may need to use DevTools to slow down your network speed.
  5. Verify that the available permissions query only runs after the create member role form is opened.

Related to #431713 (closed)

Edited by Daniel Tian

Merge request reports

Loading