Unnecessary suggestion to fork when editing file on commit tree
What does this MR do and why?
Disable the Edit button and show the message about a needed fork in tooltip when:
- trying to edit from a Blob view AND:
- viewing a file for a certain commit
- viewing a file for a certain tag
Those two cases do not allow you to commit directly to the project. The prompt to fork was shown in a message already after selecting Edit and a kind of edit. By disabling the dropdown button, user knows the edit is not possible two clicks earlier.
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.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
before_when_ref_is_a_commit | |
before_when_ref_is_a_tag |
And a screen recording of the fork prompt in modal, when trying to edit from the project overview (just to be sure the other flow still works):
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Visit a project
- Got to Commits page and click a folder icon on any commit from the list.
- Choose a file to edit
- Notice the Edit button is disabled and tooltip shows information about a fork.
- From a ref selector choose a tag.
- Notice the Edit button is disabled and tooltip shows information about a fork.
- From a ref selector choose a branch
- You should be able to edit the file with a preferred editor.
Related to #410476 (closed)