Pre-populate branch name for delete and replace blob
What does this MR do and why?
This MR does two things:
- Add back the pre-populated branch names that was removed for delete blob in !168992 (merged)
- 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:
|
||
|
Replace blob on a non-protected branch |
||
|
Delete blob on a protected branch How to set up:
|
||
| Delete blob on a non-protected branch |
How to set up and validate locally
- Open a repo
- Select a file
- Select "Delete" or "Replace"
Related to #503405 (closed)
Edited by Chaoyue Zhao