Change the warning message when trying to delete LFS files in UI
Summary
Removing LFS files is not possible in GitLab UI at the moment.
The problem is that there is still a "Delete" button present for such files when previewing them. When a user clicks the button, they get a message You can’t edit files directly in this project. Fork this project and submit a merge request with your changes.
and a choice to Fork
a project. This message is confusing since the reason they can't remove the file is not permission-related. Forking the project isn't going to help them.
Steps to reproduce
- Create a project with LFS files.
- Go to GitLab UI and preview the file.
- Press Detele button and you'll see the confusing message.
Example Project
https://gitlab.com/gitlab-gold/kategrechishkinatestgroup/lfs-project/-/blob/master/tux_wall_dark.png
What is the current bug behavior?
The directions we give the customer to delete LFS files is incorrect.
What is the expected correct behavior?
Instead, we should either remove the "Delete" button at all or give users correct instructions to delete lfs files: https://docs.gitlab.com/ee/topics/git/lfs/#removing-objects-from-lfs
Output of checks
This bug happens on GitLab.com
Possible fixes
Add a modal to inform the user regarding the difference between deleting and removing tracking of the LFS file.
- Title: File to be deleted is LFS tracked
- Body line one: Deleting will remove the file from the branch
branchname
. - Body line two: This file will still take up space in your LFS storage. [How do I remove tracked objects from Git LFS?]
LFS tracked prompt | Delete modal (no changes) |
---|---|
![]() |
![]() |