Merge request UI implies protected branches and forked branches can be deleted
Problem
Protected branches cannot be deleted: https://docs.gitlab.com/ce/user/project/protected_branches.html. Currently, when you create a merge request, you have the option to select removing a branch. This option should not appear anywhere in the merge request create/edit web form, and should not appear in the merge request widget. As shown in the screenshot, there is a disabled checkbox with the label in the widget. Currently, when you merge the merge request, it does not delete the branch. This is correct. But the UI is misleading. This should be corrected.
Similarly, for a merge request where the source branch is a fork, the author can toggle removing the source branch in the edit web form of the merge request. However, in the widget itself, the maintainer of the master branch cannot change the checkbox because it is disabled. In this case, it is confusing to see an empty checkbox.
Design
Edit/create merge request screen
User does not have permissions
-
Don't show option at all. Don't show the checkbox. Don't show the text label. Show nothing.
-
We don't have to show anything all because the user will see anything (if they need to), later on the widget itself.
User does have permissions
[CHECKBOX] Remove source branch
Merge request widget
User does not have permissions
- Merging will not remove the source branch. Therefore, show nothing at all.
- Merging will remove the source branch.
User does have permissions
[CHECKBOX] Remove source branch