diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2024-02-02 08:16:01 +0100 |
---|---|---|
committer | nextcloud-command <nextcloud-command@users.noreply.github.com> | 2024-02-07 07:57:23 +0000 |
commit | d50127f0937fda1f1db730b74cc243ffcd678bca (patch) | |
tree | c2f24c6acd2129230794fb0a1052780080bc6006 /apps/files | |
parent | 6e0499461dbcd2a9c43ef0d407e037e6c5f27a81 (diff) | |
download | nextcloud-server-d50127f0937fda1f1db730b74cc243ffcd678bca.tar.gz nextcloud-server-d50127f0937fda1f1db730b74cc243ffcd678bca.zip |
fix(files): setup cannot be in mixins
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/src/components/FileEntry.vue | 21 | ||||
-rw-r--r-- | apps/files/src/components/FileEntryGrid.vue | 20 | ||||
-rw-r--r-- | apps/files/src/components/FileEntryMixin.ts | 21 |
3 files changed, 41 insertions, 21 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue index 274656f5d70..0ccd5622a5e 100644 --- a/apps/files/src/components/FileEntry.vue +++ b/apps/files/src/components/FileEntry.vue @@ -100,6 +100,12 @@ import { defineComponent } from 'vue' import { formatFileSize } from '@nextcloud/files' import moment from '@nextcloud/moment' +import { useActionsMenuStore } from '../store/actionsmenu.ts' +import { useDragAndDropStore } from '../store/dragging.ts' +import { useFilesStore } from '../store/files.ts' +import { useRenamingStore } from '../store/renaming.ts' +import { useSelectionStore } from '../store/selection.ts' + import FileEntryMixin from './FileEntryMixin.ts' import NcDateTime from '@nextcloud/vue/dist/Components/NcDateTime.js' import CustomElementRender from './CustomElementRender.vue' @@ -139,6 +145,21 @@ export default defineComponent({ }, }, + setup() { + const actionsMenuStore = useActionsMenuStore() + const draggingStore = useDragAndDropStore() + const filesStore = useFilesStore() + const renamingStore = useRenamingStore() + const selectionStore = useSelectionStore() + return { + actionsMenuStore, + draggingStore, + filesStore, + renamingStore, + selectionStore, + } + }, + computed: { /** * Conditionally add drag and drop listeners diff --git a/apps/files/src/components/FileEntryGrid.vue b/apps/files/src/components/FileEntryGrid.vue index 1d10f3d2948..9d332491bea 100644 --- a/apps/files/src/components/FileEntryGrid.vue +++ b/apps/files/src/components/FileEntryGrid.vue @@ -75,6 +75,11 @@ <script lang="ts"> import { defineComponent } from 'vue' +import { useActionsMenuStore } from '../store/actionsmenu.ts' +import { useDragAndDropStore } from '../store/dragging.ts' +import { useFilesStore } from '../store/files.ts' +import { useRenamingStore } from '../store/renaming.ts' +import { useSelectionStore } from '../store/selection.ts' import FileEntryMixin from './FileEntryMixin.ts' import FileEntryActions from './FileEntry/FileEntryActions.vue' import FileEntryCheckbox from './FileEntry/FileEntryCheckbox.vue' @@ -97,6 +102,21 @@ export default defineComponent({ inheritAttrs: false, + setup() { + const actionsMenuStore = useActionsMenuStore() + const draggingStore = useDragAndDropStore() + const filesStore = useFilesStore() + const renamingStore = useRenamingStore() + const selectionStore = useSelectionStore() + return { + actionsMenuStore, + draggingStore, + filesStore, + renamingStore, + selectionStore, + } + }, + data() { return { gridMode: true, diff --git a/apps/files/src/components/FileEntryMixin.ts b/apps/files/src/components/FileEntryMixin.ts index 68320c80733..69638d33212 100644 --- a/apps/files/src/components/FileEntryMixin.ts +++ b/apps/files/src/components/FileEntryMixin.ts @@ -31,12 +31,6 @@ import { Upload, getUploader } from '@nextcloud/upload' import { vOnClickOutside } from '@vueuse/components' import Vue, { defineComponent } from 'vue' -import { useActionsMenuStore } from '../store/actionsmenu.ts' -import { useDragAndDropStore } from '../store/dragging.ts' -import { useFilesStore } from '../store/files.ts' -import { useRenamingStore } from '../store/renaming.ts' -import { useSelectionStore } from '../store/selection.ts' - import { action as sidebarAction } from '../actions/sidebarAction.ts' import { getDragAndDropPreview } from '../utils/dragUtils.ts' import { handleCopyMoveNodeTo } from '../actions/moveOrCopyAction.ts' @@ -62,21 +56,6 @@ export default defineComponent({ }, }, - setup() { - const actionsMenuStore = useActionsMenuStore() - const draggingStore = useDragAndDropStore() - const filesStore = useFilesStore() - const renamingStore = useRenamingStore() - const selectionStore = useSelectionStore() - return { - actionsMenuStore, - draggingStore, - filesStore, - renamingStore, - selectionStore, - } - }, - data() { return { loading: '', |