From 6810c77726adf47b5e4203ce44cdd4ecee27ac8d Mon Sep 17 00:00:00 2001 From: guerler Date: Tue, 16 Apr 2024 09:39:18 +0300 Subject: [PATCH 1/4] Add additional columns to data dialog, properly format update time --- .../src/components/DataDialog/DataDialog.vue | 17 +++++++++++++++++ .../SelectionDialog/SelectionDialog.vue | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/client/src/components/DataDialog/DataDialog.vue b/client/src/components/DataDialog/DataDialog.vue index ca12a0a66168..8302589752e3 100644 --- a/client/src/components/DataDialog/DataDialog.vue +++ b/client/src/components/DataDialog/DataDialog.vue @@ -61,6 +61,22 @@ const services = new Services(); const model = new Model({ multiple: props.multiple, format: props.format }); let urlTracker = new UrlTracker(getHistoryUrl()); +/** Specifies data columns to be shown in the dialog's table */ +const fields = [ + { + key: "label", + }, + { + key: "extension", + }, + { + key: "tags", + }, + { + key: "update_time", + }, +]; + /** Add highlighting for record variations, i.e. datasets vs. libraries/collections **/ function formatRows() { for (const item of items.value) { @@ -168,6 +184,7 @@ watch( ) { currentPage.value = 1; } +/** Format time stamp */ +function formatTime(value: string) { + if (value) { + const date = new Date(value); + return date.toLocaleString("default", { + day: "numeric", + month: "short", + year: "numeric", + minute: "numeric", + hour: "numeric", + }); + } else { + return "-"; + } +} + watch( () => props.items, () => { @@ -170,6 +186,9 @@ watch( +
From d2b718ed72881977595039272316fa1c08b63fa3 Mon Sep 17 00:00:00 2001 From: guerler Date: Tue, 16 Apr 2024 09:44:06 +0300 Subject: [PATCH 2/4] Add tags to data dialog component --- client/src/components/SelectionDialog/SelectionDialog.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/src/components/SelectionDialog/SelectionDialog.vue b/client/src/components/SelectionDialog/SelectionDialog.vue index b8193213a99a..69d4072f4e6b 100644 --- a/client/src/components/SelectionDialog/SelectionDialog.vue +++ b/client/src/components/SelectionDialog/SelectionDialog.vue @@ -11,6 +11,7 @@ import { SELECTION_STATES } from "@/components/SelectionDialog/selectionTypes"; import { type FieldEntry, type SelectionItem } from "./selectionTypes"; import DataDialogSearch from "@/components/SelectionDialog/DataDialogSearch.vue"; +import StatelessTags from "@/components/TagsMultiselect/StatelessTags.vue"; library.add(faCaretLeft, faCheck, faCheckSquare, faFolder, faMinusSquare, faSpinner, faSquare, faTimes); @@ -183,6 +184,10 @@ watch( + From ea57bbabb6870023feac6ff75c7ac12f8c88cd0a Mon Sep 17 00:00:00 2001 From: guerler Date: Tue, 16 Apr 2024 10:23:30 +0300 Subject: [PATCH 3/4] Handle time stamp formatting in selection dialog --- .../SelectionDialog/BasicSelectionDialog.vue | 10 ---------- .../src/components/SelectionDialog/SelectionDialog.vue | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/client/src/components/SelectionDialog/BasicSelectionDialog.vue b/client/src/components/SelectionDialog/BasicSelectionDialog.vue index 2366bb9b1230..013de4be0e9e 100644 --- a/client/src/components/SelectionDialog/BasicSelectionDialog.vue +++ b/client/src/components/SelectionDialog/BasicSelectionDialog.vue @@ -56,16 +56,6 @@ async function load() { items.value = incoming.map((item: any) => { let timeStamp = item[props.timeKey]; showTime.value = !!timeStamp; - if (timeStamp) { - const date = new Date(timeStamp); - timeStamp = date.toLocaleString("default", { - day: "numeric", - month: "short", - year: "numeric", - minute: "numeric", - hour: "numeric", - }); - } return { id: item.id, label: item[props.labelKey] || null, diff --git a/client/src/components/SelectionDialog/SelectionDialog.vue b/client/src/components/SelectionDialog/SelectionDialog.vue index 69d4072f4e6b..6800e3f07b2d 100644 --- a/client/src/components/SelectionDialog/SelectionDialog.vue +++ b/client/src/components/SelectionDialog/SelectionDialog.vue @@ -189,7 +189,7 @@ watch( -