mirror of
https://github.com/nextcloud/server.git
synced 2026-06-06 07:13:23 -04:00
refactor(files): Resort imports and fix doc comment
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
172c43351e
commit
1b9d6194f3
4 changed files with 21 additions and 14 deletions
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
@ -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) {
|
||||
|
|
@ -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
|
||||
|
|
@ -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)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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`
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* 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'
|
||||
|
|
@ -10,8 +11,7 @@ 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',
|
||||
|
|
|
|||
Loading…
Reference in a new issue