fix(web): [OCISDEV-1513] clean up trash view in the Safe (#13136) (#13146)

This commit is contained in:
Matteo authored and GitHub committed 2026-10-14 12:20:12 +00:00
1 parent 91495c6b98
commit ccf5de5f64
5 files changed
+33 -5

No files matched your search

@@ -0,0 +1,10 @@
Bugfix: Clean up the trash view in the Safe
The trash offered a "Copy permanent link" action for deleted items, which
cannot be linked to. The action is no longer shown for deleted items.
The personal space in the trash was labelled "Personal" in the Safe, while the
rest of the interface calls it "Safe-Personal". The trash now uses the same
name.
https://github.com/owncloud/ocis/pull/13136
@@ -60,7 +60,8 @@ import {
ContextActions,
FileSideBar,
useResourcesStore,
useUserStore
useUserStore,
useVault
} from '@ownclouders/web-pkg'
import FilesViewWrapper from '../../components/FilesViewWrapper.vue'
import ListInfo from '../../components/FilesList/ListInfo.vue'
@@ -84,6 +85,7 @@ interface Props {
const { space = null } = defineProps<Props>()
const { $gettext } = useGettext()
const userStore = useUserStore()
const { isInVault } = useVault()
const { user } = storeToRefs(userStore)
const resourcesStore = useResourcesStore()
const { currentFolder } = storeToRefs(resourcesStore)
@@ -140,7 +142,7 @@ const isEmpty = computed(() => {
const breadcrumbs = computed(() => {
let currentNodeName = space?.name
if (space.driveType === 'personal') {
currentNodeName = $gettext('Personal')
currentNodeName = isInVault ? $gettext('Safe-Personal') : $gettext('Personal')
}
return [
{
@@ -82,7 +82,8 @@ import {
useRouter,
useSideBar,
useSpacesStore,
useUserStore
useUserStore,
useVault
} from '@ownclouders/web-pkg'
import { createLocationTrash } from '@ownclouders/web-pkg'
import { createFileRouteOptions } from '@ownclouders/web-pkg'
@@ -109,6 +110,7 @@ const resourcesStore = useResourcesStore()
const { isSideBarOpen, sideBarActivePanel } = useSideBar()
const { isSticky } = useIsTopBarSticky()
const route = useRoute()
const { isInVault } = useVault()
const sortBy = ref<keyof SpaceResource>('name')
const sortDir = ref<SortDir>(SortDir.Asc)
@@ -199,7 +201,7 @@ const fields = computed((): FieldType[] => [
const getSpaceName = (space: SpaceResource) => {
if (isPersonalSpaceResource(space)) {
return $gettext('Personal')
return isInVault ? $gettext('Safe-Personal') : $gettext('Personal')
}
if (space.disabled === true) {
return $gettext('%{spaceName} (disabled)', { spaceName: space.name })
@@ -3,7 +3,7 @@ import { useGettext } from 'vue3-gettext'
import { FileAction } from '../types'
import { useClipboard } from '../../clipboard'
import { useMessages } from '../../piniaStores'
import { isPublicSpaceResource } from '@ownclouders/web-client'
import { isPublicSpaceResource, isTrashResource } from '@ownclouders/web-client'
export const useFileActionsCopyPermanentLink = () => {
const { showMessage, showErrorMessage } = useMessages()
@@ -37,6 +37,10 @@ export const useFileActionsCopyPermanentLink = () => {
if (isPublicSpaceResource(space)) {
return false
}
// deleted items can't be linked to
if (resources.some((r) => isTrashResource(r))) {
return false
}
return resources.length === 1
},
class: 'oc-files-actions-copy-permanent-link-trigger'
@@ -28,6 +28,16 @@ describe('useFileActionsCopyPermanentLink', () => {
}
})
})
it('should return false for deleted resources', () => {
getWrapper({
setup: ({ actions }) => {
const trashedResource = { id: '1', ddate: '2026-10-01' } as unknown as Resource
expect(
unref(actions)[0].isVisible({ space: undefined, resources: [trashedResource] })
).toBeFalsy()
}
})
})
it('should return true if one resource selected', () => {
getWrapper({
setup: ({ actions }) => {