From 2ca2e5f88c2e4dea5de432526830ba8b5e2ff005 Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Fri, 18 Oct 2024 00:42:35 +0100 Subject: [PATCH] Rework of the app file store to be scoped per item - fix a few issue Co-authored-by: Benjamin Charmes --- webapp/src/components/FileList.vue | 30 +++++++------------ webapp/src/components/FileSelectDropdown.vue | 11 ++++--- webapp/src/file_upload.js | 31 ++++---------------- webapp/src/server_fetch_utils.js | 21 ++++--------- webapp/src/store/index.js | 16 +++++----- webapp/src/views/EditPage.vue | 11 +++---- 6 files changed, 40 insertions(+), 80 deletions(-) diff --git a/webapp/src/components/FileList.vue b/webapp/src/components/FileList.vue index 7c5d90258..c9b58eb69 100644 --- a/webapp/src/components/FileList.vue +++ b/webapp/src/components/FileList.vue @@ -3,43 +3,39 @@
-
+
- - {{ stored_files[file_id].name }} + + {{ file.name }} - + - {{ stored_files[file_id].source_server_name }} + {{ file.source_server_name }} (updated {{ - formatDistance(new Date(stored_files[file_id].last_modified_remote), new Date(), { + formatDistance(new Date(file.last_modified_remote), new Date(), { addSuffix: true, }) }}, last synced {{ - formatDistance(new Date(stored_files[file_id].last_modified), new Date(), { + formatDistance(new Date(file.last_modified), new Date(), { addSuffix: true, }) }}) @@ -48,7 +44,7 @@ (uploaded {{ - formatDistance(new Date(stored_files[file_id].last_modified), new Date(), { + formatDistance(new Date(file.last_modified), new Date(), { addSuffix: true, }) }}) @@ -81,10 +77,6 @@ export default { type: String, required: true, }, - file_ids: { - type: Array, - default: () => [], - }, stored_files: { type: Object, default: () => ({}), @@ -98,8 +90,6 @@ export default { methods: { formatDistance, deleteFile(event, file_id) { - console.log(`delete file button clicked!`); - console.log(event); deleteFileFromSample(this.item_id, file_id); return false; }, diff --git a/webapp/src/components/FileSelectDropdown.vue b/webapp/src/components/FileSelectDropdown.vue index 85aafc608..77268113a 100644 --- a/webapp/src/components/FileSelectDropdown.vue +++ b/webapp/src/components/FileSelectDropdown.vue @@ -3,7 +3,7 @@