-
+
import Mixins from '../../mixins'
import MixinResources from '../../mixins/resources'
-import { isLocationSpacesActive } from '../../router'
+import { isLocationSpacesActive, isLocationTrashActive } from '../../router'
import { mapGetters, mapState } from 'vuex'
import PrivateLinkItem from './PrivateLinkItem.vue'
import { useActiveLocation } from '../../composables'
@@ -47,6 +52,43 @@ export default {
computed: {
...mapGetters(['capabilities']),
...mapState('Files', ['areFileExtensionsShown']),
+ ...mapState('Files/sidebar', { sidebarActivePanel: 'activePanel' }),
+ timeData() {
+ const interpolate = (obj) => {
+ obj.time = this.formDateFromRFC(obj.sourceTime)
+ obj.timeRelative = this.formRelativeDateFromRFC(obj.sourceTime)
+
+ obj.infoString = this.$gettextInterpolate(obj.infoString, obj)
+ obj.ariaLabel = this.$gettextInterpolate(obj.ariaLabel, obj)
+ return obj
+ }
+
+ if (
+ isLocationTrashActive(this.$router, 'files-trash-personal') ||
+ isLocationTrashActive(this.$router, 'files-trash-spaces-project')
+ ) {
+ return interpolate({
+ sourceTime: this.file.ddate,
+ infoString: this.$pgettext('inline info about deletion date', 'deleted %{timeRelative}'),
+ ariaLabel: this.$pgettext(
+ 'aria label for inline info about deletion date',
+ 'deleted %{timeRelative} (%{time})'
+ )
+ })
+ }
+
+ return interpolate({
+ sourceTime: this.file.mdate,
+ infoString: this.$pgettext(
+ 'inline info about last modification date',
+ 'modified %{timeRelative}'
+ ),
+ ariaLabel: this.$pgettext(
+ 'aria label for inline info about last modification date',
+ 'modified %{timeRelative} (%{time})'
+ )
+ })
+ },
privateLinkEnabled() {
return this.isPersonalLocation && this.capabilities.files.privateLinks
diff --git a/packages/web-app-files/tests/unit/components/SideBar/Details/__snapshots__/FileDetails.spec.js.snap b/packages/web-app-files/tests/unit/components/SideBar/Details/__snapshots__/FileDetails.spec.js.snap
index 065d9cec18b..7fa2bea2674 100644
--- a/packages/web-app-files/tests/unit/components/SideBar/Details/__snapshots__/FileDetails.spec.js.snap
+++ b/packages/web-app-files/tests/unit/components/SideBar/Details/__snapshots__/FileDetails.spec.js.snap
@@ -94,7 +94,9 @@ exports[`Details SideBar Panel displays a resource of type file on a private pag
exports[`Details SideBar Panel displays a resource of type file on a private page with timestamp, size info and (me) as owner 1`] = `