Skip to content

[FE] Improve custom role delete modal

On the Roles and Permissions page, when trying to delete a role, a modal is shown:

ksnip_20240129-233010

We should make the following improvements:

  1. When the Delete role button is clicked, the modal is immediately closed while the delete request is running in the background. If the request is taking a long time, there's no UI indication of this happening and the custom roles list is not refreshed in the meantime. We should keep the modal open until the delete request is complete, and show the modal as loading.

  2. The delete mutation uses an update() function. We should not use this unless we're doing an optimistic update, which we aren't in this case. We should switch it to reading the promise returned by the mutation call.

  3. We should remove memberRole { id } from delete_member_role.mutation.graphql. It's not used.

Edited by Daniel Tian