From 852c0ee550b15a360fbe30cb0830c1d4dd610dd8 Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Sun, 24 Nov 2024 18:18:07 +0000 Subject: [PATCH] feat: column reordering (#1539) Signed-off-by: Pedro Lamas --- components.d.ts | 1 + src/components/ui/AppColumnPicker.vue | 67 +++- src/components/ui/AppDataTableRow.vue | 52 +++ .../widgets/filesystem/FileRowItem.vue | 46 --- .../widgets/filesystem/FileSystem.vue | 203 +++++++--- .../widgets/filesystem/FileSystemBrowser.vue | 378 ++++++++---------- src/components/widgets/history/JobHistory.vue | 202 +++++----- src/components/widgets/job-queue/JobQueue.vue | 50 ++- .../widgets/job-queue/JobQueueBrowser.vue | 25 +- .../widgets/spoolman/SpoolSelectionDialog.vue | 99 +++-- src/store/config/actions.ts | 11 +- src/store/config/getters.ts | 32 +- src/store/config/mutations.ts | 29 +- src/store/config/state.ts | 41 +- src/types/tableheaders.ts | 3 - 15 files changed, 682 insertions(+), 557 deletions(-) create mode 100644 src/components/ui/AppDataTableRow.vue delete mode 100644 src/components/widgets/filesystem/FileRowItem.vue diff --git a/components.d.ts b/components.d.ts index ff05cf4dcd..018fe2aa97 100644 --- a/components.d.ts +++ b/components.d.ts @@ -19,6 +19,7 @@ declare module 'vue' { AppChart: typeof import('./src/components/ui/AppChart.vue')['default'] AppColorPicker: typeof import('./src/components/ui/AppColorPicker.vue')['default'] AppColumnPicker: typeof import('./src/components/ui/AppColumnPicker.vue')['default'] + AppDataTableRow: typeof import('./src/components/ui/AppDataTableRow.vue')['default'] AppDialog: typeof import('./src/components/ui/AppDialog.vue')['default'] AppDraggable: typeof import('./src/components/ui/AppDraggable.vue')['default'] AppDragOverlay: typeof import('./src/components/ui/AppDragOverlay.vue')['default'] diff --git a/src/components/ui/AppColumnPicker.vue b/src/components/ui/AppColumnPicker.vue index 635059a1ab..245fe249fb 100644 --- a/src/components/ui/AppColumnPicker.vue +++ b/src/components/ui/AppColumnPicker.vue @@ -11,7 +11,6 @@ + - + + + diff --git a/src/components/widgets/filesystem/FileRowItem.vue b/src/components/widgets/filesystem/FileRowItem.vue deleted file mode 100644 index 304070ed7e..0000000000 --- a/src/components/widgets/filesystem/FileRowItem.vue +++ /dev/null @@ -1,46 +0,0 @@ - - - diff --git a/src/components/widgets/filesystem/FileSystem.vue b/src/components/widgets/filesystem/FileSystem.vue index b7e70b9c37..b5686da95a 100644 --- a/src/components/widgets/filesystem/FileSystem.vue +++ b/src/components/widgets/filesystem/FileSystem.vue @@ -19,7 +19,7 @@ :path="visiblePath" :disabled="disabled" :loading="filesLoading" - :headers="headers" + :headers="configurableHeaders" @root-change="handleRootChange" @refresh="refreshPath(currentPath)" @add-file="handleAddFileDialog" @@ -41,7 +41,7 @@ header.visible || header.visible === undefined) + // The available headers, based on the current root and system configuration. + get headers (): DataTableHeader[] { + return [ + { + text: '', + value: 'data-table-icons', + sortable: false, + width: '24px' + }, + { + text: this.$tc('app.general.table.header.name'), + value: 'name' + }, + ...this.configurableHeaders + .filter(header => header.visible !== false) + ] } // The current path for the given root. diff --git a/src/components/widgets/filesystem/FileSystemBrowser.vue b/src/components/widgets/filesystem/FileSystemBrowser.vue index 75b1fa3b3d..5f86772dcc 100644 --- a/src/components/widgets/filesystem/FileSystemBrowser.vue +++ b/src/components/widgets/filesystem/FileSystemBrowser.vue @@ -28,13 +28,15 @@ fixed-header @input="handleSelected" > -