Web IDE UI shows options that will result in 404 error
Summary
When working in a project where Merge Requests are not permitted (for the current user or globally), the WebIDE UI still offers the option to "Create a new branch and merge request". The user can select it, hit "commit", and will land on a 404 page.
Steps to reproduce
- Under "Settings > General > Permissions", deactivate the "Merge requests" feature
- Open the WebIDE, create a file with some text
- Write a commit message, select the option "Create a new branch and merge request" and hit "Commit"
Example Project
https://gitlab.com/-/ide/project/ykweyer/test-ide/edit/master/README.md
What is the current bug behavior?
The user lands on a 404 page when trying to commit changes from the WebIDE with the option "Create a new branch and merge request"
What is the expected correct behavior?
Several possibilities
- On the option level:
- Do not display the option when MR are deactivated, or when the user don't have enough rights
- Mark this option as
disabled
and provide a help-block explaining why it is not possible ("You don't have enough rights to create a merge request, or this feature has been disabled by an administrator")
- Or display an error when hitting "Commit" (Reuses the same logic as when trying to commit directly on protected branches):
Output of checks
This bug happens on GitLab.com (as well as self-hosted instances)
~bug ~"web ide"