From 3f3af7c3ba38963d5f4bd33e238e29eff1e2b9d4 Mon Sep 17 00:00:00 2001 From: Jan Ackermann Date: Fri, 15 Mar 2024 14:32:28 +0100 Subject: [PATCH 01/15] Add details panel for unique trashed and multi select --- .../SideBar/Details/FileDetails.vue | 37 +++++++++++++++++-- .../SideBar/Details/FileDetailsMultiple.vue | 14 +++++-- .../composables/extensions/useFileSideBars.ts | 13 +++---- .../ResourceDetails.spec.ts.snap | 1 + 4 files changed, 50 insertions(+), 15 deletions(-) diff --git a/packages/web-app-files/src/components/SideBar/Details/FileDetails.vue b/packages/web-app-files/src/components/SideBar/Details/FileDetails.vue index 08c5781fd30..82d5127bcd6 100644 --- a/packages/web-app-files/src/components/SideBar/Details/FileDetails.vue +++ b/packages/web-app-files/src/components/SideBar/Details/FileDetails.vue @@ -33,6 +33,12 @@ > + + + + + + @@ -131,7 +137,8 @@ import { useCapabilityStore, useConfigStore, useClientService, - useResourcesStore + useResourcesStore, + formatDateFromJSDate } from '@ownclouders/web-pkg' import upperFirst from 'lodash-es/upperFirst' import { isShareResource, ShareTypes } from '@ownclouders/web-client/src/helpers/share' @@ -167,6 +174,11 @@ export default defineComponent({ type: Boolean, required: false, default: true + }, + versionsEnabled: { + type: Boolean, + required: false, + default: true } }, setup(props) { @@ -175,6 +187,7 @@ export default defineComponent({ const capabilityStore = useCapabilityStore() const clientService = useClientService() const { getMatchingSpace } = useGetMatchingSpace() + const language = useGettext() const resourcesStore = useResourcesStore() @@ -184,6 +197,7 @@ export default defineComponent({ const resource = inject>('resource') const space = inject>('space') + const previewService = usePreviewService() const preview = ref(undefined) @@ -252,8 +266,11 @@ export default defineComponent({ () => { if (unref(resource)) { loadPreviewTask.perform(unref(resource)) - - if (!unref(resource).isFolder && !unref(publicLinkContextReady)) { + if ( + !props.versionsEnabled && + !unref(resource).isFolder && + !unref(publicLinkContextReady) + ) { loadVersions(unref(resource).fileId) } } @@ -270,6 +287,15 @@ export default defineComponent({ return props.tagsEnabled && capabilityStore.filesTags }) + const hasDeletionDate = computed(() => { + return unref(resource).ddate + }) + + const capitalizedDeletionDate = computed(() => { + const displayDate = formatDateFromJSDate(new Date(unref(resource).ddate), language.current) + return upperFirst(displayDate) + }) + return { user, preview, @@ -277,6 +303,8 @@ export default defineComponent({ space, resource, hasTags, + hasDeletionDate, + capitalizedDeletionDate, isPreviewLoading, ancestorMetaData, sharedAncestor, @@ -294,7 +322,8 @@ export default defineComponent({ this.ownerDisplayName || this.showSize || this.showShares || - this.showVersions + this.showVersions || + this.hasDeletionDate ) }, sharedViaTooltip() { diff --git a/packages/web-app-files/src/components/SideBar/Details/FileDetailsMultiple.vue b/packages/web-app-files/src/components/SideBar/Details/FileDetailsMultiple.vue index 1636d62c20f..f27fac95fc7 100644 --- a/packages/web-app-files/src/components/SideBar/Details/FileDetailsMultiple.vue +++ b/packages/web-app-files/src/components/SideBar/Details/FileDetailsMultiple.vue @@ -20,7 +20,7 @@ - + @@ -29,7 +29,7 @@