Improve list custom roles component
What does this MR do and why?
On the Roles and Permissions page, there is a list of custom permissions:
This MR makes the following improvements:
-
Some unused fields in the member roles query were removed.
-
The available permissions query was moved from
ListMemberRoles
toCreateMemberRole
.ListMemberRoles
didn't use the query, it just ran it and passed the data toCreateMemberRole
. A skeleton loader was also added toCreateMemberRole
to show that the permissions are loading. -
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
- Set the environment variable
export GITLAB_SIMULATE_SAAS=1
. - Go to any top-level group, then click on
Settings
->Roles and Permissions
. - Verify that the custom roles list renders properly.
- 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. - Verify that the available permissions query only runs after the create member role form is opened.
Related to #431713 (closed)
Edited by Daniel Tian