Pre-populate branch name for delete and replace blob

What does this MR do and why?

This MR does two things:

  1. Add back the pre-populated branch names that was removed for delete blob in !168992 (merged)
  2. Fix an existing bug that when user navigate from repository page to blob page and then replace file, we do not populate the correct patch branch name for protected branches.

In other words, after this MR, delete and replace blob flows should always have pre-popluated branch names.

  • For protected branches, user should see a patch branch name in the format of "${user-name}-${branch-name}-patch-${epoch}"
  • For unprotected branches, user should see the current branch name

References

Please include cross links to any resources that are relevant to this MR This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

  • there are other delete blob flows listed in !168992 (merged). they should all work as expected and the only change is that branch name is being pre-populated
  • discussion on adding back pre-populated branch names !170512 (comment 2195721782)

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

Replace blob on a protected branch

How to set up:

Screen Recording 2024-11-12 at 5.40.33 PM.mov

Screen Recording 2024-11-12 at 5.16.25 PM.mov

Replace blob on a non-protected branch

Screen Recording 2024-11-12 at 5.23.44 PM.mov

Screen Recording 2024-11-12 at 5.19.23 PM.mov

Delete blob on a protected branch

How to set up:

Screen Recording 2024-11-12 at 5.42.30 PM.mov

Screen Recording 2024-11-12 at 5.17.02 PM.mov

Delete blob on a non-protected branch

Screen Recording 2024-11-12 at 5.23.57 PM.mov

Screen Recording 2024-11-12 at 5.19.36 PM.mov

How to set up and validate locally

  1. Open a repo
  2. Select a file
  3. Select "Delete" or "Replace"

Related to #503405 (closed)

Edited by Chaoyue Zhao

Merge request reports

Loading