Skip to content

Commit

Permalink
refactor(files): Resort imports and fix doc comment
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Jun 25, 2024
1 parent 7a3071e commit 475598d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
8 changes: 6 additions & 2 deletions apps/files/src/components/FileEntry/FileEntryCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@
</template>

<script lang="ts">
import { Node, FileType } from '@nextcloud/files'
import type { Node } from '@nextcloud/files'
import type { PropType } from 'vue'
import type { FileSource } from '../../types.ts'

import { FileType } from '@nextcloud/files'
import { translate as t } from '@nextcloud/l10n'
import { type PropType, defineComponent } from 'vue'
import { defineComponent } from 'vue'

import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
Expand Down
21 changes: 12 additions & 9 deletions apps/files/src/components/FilesListTableHeaderActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,25 @@
</template>

<script lang="ts">
import { Node, NodeStatus, View, getFileActions } from '@nextcloud/files'
import type { Node, View } from '@nextcloud/files'
import type { PropType } from 'vue'
import type { FileSource } from '../types'

import { NodeStatus, getFileActions } from '@nextcloud/files'
import { showError, showSuccess } from '@nextcloud/dialogs'
import { translate } from '@nextcloud/l10n'
import { defineComponent } from 'vue'

import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js'
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
import Vue, { defineComponent, type PropType } from 'vue'

import { useActionsMenuStore } from '../store/actionsmenu.ts'
import { useFilesStore } from '../store/files.ts'
import { useSelectionStore } from '../store/selection.ts'
import filesListWidthMixin from '../mixins/filesListWidth.ts'
import logger from '../logger.ts'
import type { FileSource } from '../types'

// The registered actions list
const actions = getFileActions()
Expand Down Expand Up @@ -135,11 +139,10 @@ export default defineComponent({
/**
* Get a cached note from the store
*
* @param {number} fileId the file id to get
* @return {Folder|File}
* @param source The source of the node to get
*/
getNode(fileId) {
return this.filesStore.getNode(fileId)
getNode(source: string): Node|undefined {
return this.filesStore.getNode(source)
},

async onActionClick(action) {
Expand All @@ -149,7 +152,7 @@ export default defineComponent({
// Set loading markers
this.loading = action.id
this.nodes.forEach(node => {
Vue.set(node, 'status', NodeStatus.LOADING)
this.$set(node, 'status', NodeStatus.LOADING)
})

// Dispatch action execution
Expand Down Expand Up @@ -189,7 +192,7 @@ export default defineComponent({
// Remove loading markers
this.loading = null
this.nodes.forEach(node => {
Vue.set(node, 'status', undefined)
this.$set(node, 'status', undefined)
})
}
},
Expand Down

0 comments on commit 475598d

Please sign in to comment.