Skip to content

Improve custom role delete modal behavior

Daniel Tian requested to merge 434431-use-graphql-to-delete-custom-role into master

What does this MR do and why?

On the Roles and Permissions page, clicking on the trash icon for a custom role will show the delete role dialog:

Roles and Permissions page Delete role dialog
ksnip_20240220-134655 ksnip_20240220-134708

This MR makes the following improvements:

  1. Previously, when the Delete role button is clicked, the dialog will immediately close and the deletion will run in the background. Now, the dialog will remain open and the Cancel and Delete role buttons will be disabled until the deletion succeeds, after which the dialog will close.

  2. Previously, when the custom roles table is busy, there was no indication. Now, a loading spinner was added to the custom roles table when it is busy.

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.

How to set up and validate locally

  1. Go to Admin Area -> Settings -> Roles and Permissions.
  2. Click on the Add new role button and fill out the form to create a new role.
  3. Click the trash icon to bring up the delete role dialog.
  4. In DevTools, go to the network tab and change No throttling to Slow 3G.
  5. Click on Delete role. Observe that the following behavior occurs:
    • The Delete role button is in the loading state. The Cancel button is in the disabled state.
    • After a short while, the dialog will close. The roles table should show the loading spinner.
    • After a short while, the roles table should show the table without the deleted role.

Related to #434431 (closed)

Edited by Daniel Tian

Merge request reports