Skip to content

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_branch after_edit_options_when_ref_is_a_branch
before_when_ref_is_a_commit after_edit_disabled_when_ref_is_commit
before_when_ref_is_a_tag after_edit_disabled_when_ref_is_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):

after_fork_prompt_from_project_overview

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Visit a project
  2. Got to Commits page and click a folder icon on any commit from the list.
  3. Choose a file to edit
  4. Notice the Edit button is disabled and tooltip shows information about a fork.
  5. From a ref selector choose a tag.
  6. Notice the Edit button is disabled and tooltip shows information about a fork.
  7. From a ref selector choose a branch
  8. You should be able to edit the file with a preferred editor.

Related to #410476 (closed)

Edited by Paulina Sedlak-Jakubowska

Merge request reports

Loading