Skip to content

Commit

Permalink
feat: open file details side bar
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Bianchi <vbianchi@protonmail.com>
  • Loading branch information
v-bianchi committed Sep 26, 2024
1 parent c8b5768 commit efd7736
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
16 changes: 12 additions & 4 deletions src/views/FilesList/FileEntry/FileEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,25 @@
<template>
<tr class="files-list__row"
@contextmenu="onRightClick">
<td class="files-list__row-name">
<td class="files-list__row-name"
@click="openDetailsIfAvailable">
<FileEntryPreview :source="source" />
<FileEntryName ref="name"
:basename="source.name"
:extension="'.pdf'" />
</td>

<!-- Status -->
<td class="files-list__row-status">
<td class="files-list__row-status"
@click="openDetailsIfAvailable">
<FileEntryStatus :status="source.status"
:status-text="source.statusText" />
</td>

<!-- Mtime -->
<td :style="mtimeOpacity"
class="files-list__row-mtime">
class="files-list__row-mtime"
@click="openDetailsIfAvailable">
<NcDateTime v-if="source.request_date" :timestamp="mtime" :ignore-seconds="true" />
</td>

Expand All @@ -44,6 +47,7 @@ import FileEntryStatus from './FileEntryStatus.vue'
import FileEntryMixin from './FileEntryMixin.js'
import { useActionsMenuStore } from '../../../store/actionsmenu.js'
import { useFilesStore } from '../../../store/files.js'
export default {
name: 'FileEntry',
Expand All @@ -59,7 +63,11 @@ export default {
],
setup() {
const actionsMenuStore = useActionsMenuStore()
return { actionsMenuStore }
const filesStore = useFilesStore()
return {
actionsMenuStore,
filesStore,
}
},
}
</script>
16 changes: 12 additions & 4 deletions src/views/FilesList/FileEntry/FileEntryGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,25 @@
<template>
<tr class="files-list__row"
@contextmenu="onRightClick">
<td class="files-list__row-name">
<td class="files-list__row-name"
@click="openDetailsIfAvailable">
<FileEntryPreview :source="source" />
<FileEntryName ref="name"
:basename="source.name"
:extension="'.pdf'" />
</td>

<!-- Status -->
<td class="files-list__row-status">
<td class="files-list__row-status"
@click="openDetailsIfAvailable">
<FileEntryStatus :status="source.status"
:status-text="source.statusText" />
</td>

<!-- Mtime -->
<td :style="mtimeOpacity"
class="files-list__row-mtime">
class="files-list__row-mtime"
@click="openDetailsIfAvailable">
<NcDateTime v-if="source.request_date" :timestamp="mtime" :ignore-seconds="true" />
</td>

Expand All @@ -44,6 +47,7 @@ import FileEntryStatus from './FileEntryStatus.vue'
import FileEntryMixin from './FileEntryMixin.js'
import { useActionsMenuStore } from '../../../store/actionsmenu.js'
import { useFilesStore } from '../../../store/files.js'
export default {
name: 'FileEntryGrid',
Expand All @@ -59,7 +63,11 @@ export default {
],
setup() {
const actionsMenuStore = useActionsMenuStore()
return { actionsMenuStore }
const filesStore = useFilesStore()
return {
actionsMenuStore,
filesStore,
}
},
}
</script>
6 changes: 6 additions & 0 deletions src/views/FilesList/FileEntry/FileEntryMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,11 @@ export default {
event.preventDefault()
event.stopPropagation()
},

openDetailsIfAvailable(event) {
event.preventDefault()
event.stopPropagation()
this.filesStore.selectFile(this.source.nodeId)
},
},
}

0 comments on commit efd7736

Please sign in to comment.