Add message to modal explaining that the last owner can't be removed
What does this MR do and why?
Related to #24047 (closed)
The last owner of a group or project cannot be removed because then nobody would have privileges to manage the group or project. Currently Remove member
or Leave
actions are not shown (or in the case of personal projects they are but cause a 403 which is a bug) but there is nothing explaining why. This MR shows the Remove member
or Leave
actions for last owners and adds copy to the modal explaining why they can't continue with the action. In the future we may add a way to add a new owner at the same time you remove the old one. See #24047 (comment 1164315167) for the concept.
Screenshots or screen recordings
Trying to remove yourself from a group
Before | After |
---|---|
No modal |
An admin trying to remove the last owner from a group
Before | After |
---|---|
No modal |
Trying to remove yourself from a personal project
Before | After |
---|---|
403 after confirming in modal |
An admin trying to remove the last owner from a personal project
Before | After |
---|---|
403 after confirming in modal |
How to set up and validate locally
Trying to remove yourself from a group
- Navigate to a group you are an Owner of
- Change all the roles so you are the only Owner
An admin trying to remove the last owner from a group
- Sign in as an Admin
- Navigate to a group you are not a member of
- Change roles so there is only one Owner
- Try to remove that Owner
Trying to remove yourself from a personal project
- Create a personal project
- Try to Leave that personal project
An admin trying to remove the last owner from a personal project
- Sign in as an Admin
- Navigate to a personal project that is not yours
- Try to remove the creator of the personal project
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.