From c3403d662bb6553b655b5473182e9012bbbd727e Mon Sep 17 00:00:00 2001 From: guerler Date: Tue, 16 Apr 2024 09:39:18 +0300 Subject: [PATCH] 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( +