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 authored and skjnldsv committed Aug 1, 2024
1 parent 172c433 commit 1b9d619
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 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 @@ -26,21 +26,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 @@ -136,11 +140,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 @@ -150,7 +153,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 @@ -190,7 +193,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
2 changes: 1 addition & 1 deletion apps/files/src/services/Files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { FileStat, ResponseDataDetailed } from 'webdav'
import { CancelablePromise } from 'cancelable-promise'
import { File, Folder, davGetDefaultPropfind, davResultToNode, davRootPath } from '@nextcloud/files'
import { client } from './WebdavClient.ts'
import logger from '../logger.js'
import logger from '../logger.ts'

/**
* Slim wrapper over `@nextcloud/files` `davResultToNode` to allow using the function with `Array.map`
Expand Down
4 changes: 2 additions & 2 deletions apps/files_trashbin/src/actions/restoreAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { emit } from '@nextcloud/event-bus'
import { encodePath } from '@nextcloud/paths'
import { generateRemoteUrl } from '@nextcloud/router'
import { getCurrentUser } from '@nextcloud/auth'
import { Permission, Node, View, registerFileAction, FileAction } from '@nextcloud/files'
import { translate as t } from '@nextcloud/l10n'
import axios from '@nextcloud/axios'
import History from '@mdi/svg/svg/history.svg?raw'

import logger from '../../../files/src/logger.js'
import { encodePath } from '@nextcloud/paths'
import logger from '../../../files/src/logger.ts'

registerFileAction(new FileAction({
id: 'restore',
Expand Down

0 comments on commit 1b9d619

Please sign in to comment.