Skip to content

Use commit changes modal for edit blob

What does this MR do and why?

Update to use commit modal in edit blob flow.

Part 2 of #444302 (closed)

Implementation breakdown:

Description MR
update exiting delete blob modal !168992 (merged)
use new modal for edit flow 👈 This MR
update doc #502863 (closed)

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

Edit file to current branch and user can push to the branch

Expected: Users should see two radio options (one to commit to current branch, one to commit to a new branch) and a checkbox to create MR.

Screen Recording 2024-10-28 at 4.49.41 PM.mov

Screen Recording 2024-11-11 at 3.37.36 PM.mov

Edit file to current branch and user can NOT push to the branch

How to set up:

Expected: Users should see the text input for entering a new branch name and a checkbox to create MR.

Screen Recording 2024-10-28 at 4.48.29 PM.mov

Screen Recording 2024-11-11 at 3.39.38 PM.mov

Edit file to new branch and open a MR

Screen Recording 2024-10-28 at 4.49.01 PM.mov

Screen Recording 2024-11-11 at 3.38.29 PM.mov

Edit file to new branch and NOT open a MR

Screen Recording 2024-10-28 at 4.52.00 PM.mov

Screen Recording 2024-11-11 at 3.38.56 PM.mov

Edit LFS file

How to set up:

Screen Recording 2024-10-28 at 4.46.43 PM.mov

Screen Recording 2024-10-28 at 4.32.03 PM.mov

Edit while collaboration on merge requests across forks

How to set up:

Expected: Users should see the following message: "Your changes can be committed to %{branchName} because a merge request is open"

Screen Recording 2024-10-30 at 1.35.06 PM.mov

Screen Recording 2024-11-01 at 12.06.37 PM.mov

Editing a file that has been edited by another user as a user with permission

How to set up:

  • As user 1, who has permission to edit the file, select edit in single file editor but DO NOT COMMIT CHANGES

  • As user 2, select edit in single file editor

    and commit some changes to the same file

  • As user 2, select commit changes through the new modal

Expected: Users should see the error toast with the following message: "Someone edited the file the same time you did. Please check out the file and make sure your change will not unintentionally remove theirs".

"

Screen Recording 2024-11-05 at 11.30.07 AM.mov

Editing a file that has been edited by another user as a user without permission

How to set up:

  • As user 1, who does NOT has permission to edit the file (e.g. guest user), select edit in single file editor and commit changes
  • Finish the flow by creating a MR with the changes in the user's forked repo
  • As user 2 commit some changes to the same file in the upstream repo
  • As user 1, edit the file again and go through the commit change flow

Expected: Users should see the error toast with the following message: "Error: Can't edit this file. The fork and upstream project have diverged. Edit the file on the fork".

Screen Recording 2024-11-05 at 11.27.44 AM.mov

Edit file from merge request

Steps:

  • Go to a merge request
  • Select changes
  • In any file, click on the three dots menu and select edit in single file editor
  • Go through the flow to commit changes

Expected: Users should be bought back to the merge request

Screen Recording 2024-11-05 at 12.53.05 PM.mov

Screen Recording 2024-11-05 at 12.31.07 PM.mov

Cancel button pops a confirmation modal

Screen Recording 2024-10-30 at 10.35.57 AM.mov

Screen Recording 2024-11-01 at 12.52.03 PM.mov

On smaller screen

Screenshot 2024-11-05 at 12.51.51 PM.png

Screenshot 2024-11-05 at 10.08.20 AM.png

How to set up and validate locally

  1. Open a file in repo

  2. Select "Edit" > "Edit Single File"

  3. Select "Commit changes"

  4. A modal should pop up

    See more details on each flow in table above 🔼

Related to #444302 (closed)

Edited by Chaoyue Zhao

Merge request reports

Loading