Deleting last file leaves empty package in UI
🔥 Problem
In #345755 (closed), we created a background job that process package files that are marked as pending_destruction
.
The problem is if all package files are marked = the background job will remove all of them and leave the package object behind. That package object has no package files and can lead to a confusing UX :
I will categorize this as a UX typebug
🚒 Solution
The most logical thing to do here is to check the package object at the end of the cleanup job.
If the package is empty, we can safely remove it.
Ideally, we should implement this when we introduce the first change that will mark package files as pending_destruction
. This way, we will not have empty packages behind.
🌈 UX solution
Before | After |
---|---|
Deleting last file leaves empty package in UI | Deleting last file removes package and returns user to package registry page |
Implementation plan
- Before showing the delete file confirmation modal, if it is the last file being deleted then call the
deleteModal
function instead, can be handled here: https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/packages_and_registries/package_registry/pages/details.vue#L209-213
Edited by Rahul Chanila