Improve custom role delete modal behavior
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 |
---|---|
This MR makes the following improvements:
-
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 theCancel
andDelete role
buttons will be disabled until the deletion succeeds, after which the dialog will close. -
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
- Go to
Admin Area
->Settings
->Roles and Permissions
. - Click on the
Add new role
button and fill out the form to create a new role. - Click the trash icon to bring up the delete role dialog.
- In
DevTools
, go to the network tab and changeNo throttling
toSlow 3G
. - Click on
Delete role
. Observe that the following behavior occurs:- The
Delete role
button is in the loading state. TheCancel
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.
- The
Related to #434431 (closed)