From 0e764f753a3d47bba946dc3f64cef9536ac98d43 Mon Sep 17 00:00:00 2001 From: =?utf8?q?John=20Molakvo=C3=A6?= Date: Fri, 24 Mar 2023 16:27:47 +0100 Subject: [PATCH] fix(files): fix custom render components reactivity MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- .../src/components/CustomElementRender.vue | 26 ++++++++++++-- .../src/components/CustomSvgIconRender.vue | 5 +++ apps/files/src/components/FileEntry.vue | 6 ++-- apps/files/src/components/FilesListHeader.vue | 2 +- .../src/components/FilesListHeaderButton.vue | 11 +----- apps/files/src/mixins/fileslist-row.scss | 4 ++- apps/files/src/services/Navigation.ts | 2 +- apps/files/src/views/FilesList.vue | 36 ++++++++++--------- apps/files_trashbin/src/main.ts | 4 ++- 9 files changed, 59 insertions(+), 37 deletions(-) diff --git a/apps/files/src/components/CustomElementRender.vue b/apps/files/src/components/CustomElementRender.vue index b5dc510b645..bb6df3fd854 100644 --- a/apps/files/src/components/CustomElementRender.vue +++ b/apps/files/src/components/CustomElementRender.vue @@ -20,20 +20,40 @@ - --> diff --git a/apps/files/src/components/CustomSvgIconRender.vue b/apps/files/src/components/CustomSvgIconRender.vue index f025319946f..8c14cf39872 100644 --- a/apps/files/src/components/CustomSvgIconRender.vue +++ b/apps/files/src/components/CustomSvgIconRender.vue @@ -35,6 +35,11 @@ export default { required: true, }, }, + watch: { + svg() { + this.$el.innerHTML = sanitize(this.svg) + }, + }, mounted() { this.$el.innerHTML = sanitize(this.svg) }, diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue index 29e9895757e..fcada72e4ce 100644 --- a/apps/files/src/components/FileEntry.vue +++ b/apps/files/src/components/FileEntry.vue @@ -57,8 +57,8 @@ - diff --git a/apps/files/src/components/FilesListHeader.vue b/apps/files/src/components/FilesListHeader.vue index 0ee7298ee95..b69a394a812 100644 --- a/apps/files/src/components/FilesListHeader.vue +++ b/apps/files/src/components/FilesListHeader.vue @@ -27,7 +27,7 @@ + @click.stop.prevent="toggleSortBy('basename')"> diff --git a/apps/files/src/components/FilesListHeaderButton.vue b/apps/files/src/components/FilesListHeaderButton.vue index 8a07dd71395..2e0c398ab25 100644 --- a/apps/files/src/components/FilesListHeaderButton.vue +++ b/apps/files/src/components/FilesListHeaderButton.vue @@ -24,7 +24,7 @@ :class="{'files-list__column-sort-button--active': sortingMode === mode}" class="files-list__column-sort-button" type="tertiary" - @click="toggleSortBy(mode)"> + @click.stop.prevent="toggleSortBy(mode)"> @@ -42,8 +42,6 @@ import Vue from 'vue' import { useSortingStore } from '../store/sorting' -Vue.config.performance = true - export default Vue.extend({ name: 'FilesListHeaderButton', @@ -109,13 +107,6 @@ export default Vue.extend({ this.sortingStore.setSortingBy(key, this.currentView.id) }, - toggleSortByCustomColumn(column) { - if (!column.sort) { - return - } - this.toggleSortBy(column.id) - }, - t: translate, }, }) diff --git a/apps/files/src/mixins/fileslist-row.scss b/apps/files/src/mixins/fileslist-row.scss index 06b6637b6f2..8a03b364fd2 100644 --- a/apps/files/src/mixins/fileslist-row.scss +++ b/apps/files/src/mixins/fileslist-row.scss @@ -21,8 +21,10 @@ */ /** + * ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ * This file is for every column styling that must be - * shared between the files list and the list header. + * shared between BOTH the files list AND the list header. + * ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ */ td, th { display: flex; diff --git a/apps/files/src/services/Navigation.ts b/apps/files/src/services/Navigation.ts index 4ca4588dff5..247243a8a74 100644 --- a/apps/files/src/services/Navigation.ts +++ b/apps/files/src/services/Navigation.ts @@ -36,7 +36,7 @@ export interface Column { /** Translated column title */ title: string /** The content of the cell. The element will be appended within */ - render: (node: Node) => HTMLElement + render: (node: Node, view: Navigation) => HTMLElement /** Function used to sort Nodes between them */ sort?: (nodeA: Node, nodeB: Node) => number /** Custom summary of the column to display at the end of the list. diff --git a/apps/files/src/views/FilesList.vue b/apps/files/src/views/FilesList.vue index 03b0076a435..98e917b5191 100644 --- a/apps/files/src/views/FilesList.vue +++ b/apps/files/src/views/FilesList.vue @@ -61,9 +61,9 @@