aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src/components
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-06-25 00:00:31 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-07-09 17:13:30 +0200
commit691f570237e26398aa22f40c0efca23141d5583e (patch)
tree4409270ac8ee482ad03f745f77003c726ffbf09f /apps/files/src/components
parent3a97dbf248b3e581b5782a638743958eb6f2a640 (diff)
downloadnextcloud-server-691f570237e26398aa22f40c0efca23141d5583e.tar.gz
nextcloud-server-691f570237e26398aa22f40c0efca23141d5583e.zip
chore: Enable ESLint for apps and fix all errors
Nevertheless this causes a huge amount of new warnings. Previously the shell script for directories to lint was wrong it was generating all app names to lint, but was missing the `apps/` prefix. Causing only `core` to be linted. Co-authored-by: Grigorii K. Shartsev <me@shgk.me> Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files/src/components')
-rw-r--r--apps/files/src/components/FileEntryMixin.ts4
-rw-r--r--apps/files/src/components/NavigationQuota.vue10
-rw-r--r--apps/files/src/components/TransferOwnershipDialogue.vue6
-rw-r--r--apps/files/src/components/VirtualList.vue10
4 files changed, 18 insertions, 12 deletions
diff --git a/apps/files/src/components/FileEntryMixin.ts b/apps/files/src/components/FileEntryMixin.ts
index 243b963c7b2..6c0b278c61b 100644
--- a/apps/files/src/components/FileEntryMixin.ts
+++ b/apps/files/src/components/FileEntryMixin.ts
@@ -7,7 +7,7 @@ import type { ComponentPublicInstance, PropType } from 'vue'
import type { FileSource } from '../types.ts'
import { showError } from '@nextcloud/dialogs'
-import { FileType, Permission, Folder, File as NcFile, NodeStatus, Node, View } from '@nextcloud/files'
+import { FileType, Permission, Folder, File as NcFile, NodeStatus, Node } from '@nextcloud/files'
import { translate as t } from '@nextcloud/l10n'
import { generateUrl } from '@nextcloud/router'
import { vOnClickOutside } from '@vueuse/components'
@@ -179,6 +179,8 @@ export default defineComponent({
/**
* When the source changes, reset the preview
* and fetch the new one.
+ * @param a
+ * @param b
*/
source(a: Node, b: Node) {
if (a.source !== b.source) {
diff --git a/apps/files/src/components/NavigationQuota.vue b/apps/files/src/components/NavigationQuota.vue
index 9cbee4c6672..557fb240797 100644
--- a/apps/files/src/components/NavigationQuota.vue
+++ b/apps/files/src/components/NavigationQuota.vue
@@ -94,12 +94,12 @@ export default {
mounted() {
// If the user has a quota set, warn if the available account storage is <=0
//
- // NOTE: This doesn't catch situations where actual *server*
+ // NOTE: This doesn't catch situations where actual *server*
// disk (non-quota) space is low, but those should probably
// be handled differently anyway since a regular user can't
- // can't do much about them (If we did want to indicate server disk
+ // can't do much about them (If we did want to indicate server disk
// space matters to users, we'd probably want to use a warning
- // specific to that situation anyhow. So this covers warning covers
+ // specific to that situation anyhow. So this covers warning covers
// our primary day-to-day concern (individual account quota usage).
//
if (this.storageStats?.quota > 0 && this.storageStats?.free <= 0) {
@@ -121,7 +121,7 @@ export default {
* Update the storage stats
* Throttled at max 1 refresh per minute
*
- * @param {Event} [event = null] if user interaction
+ * @param {Event} [event] if user interaction
*/
async updateStorageStats(event = null) {
if (this.loadingStorageStats) {
@@ -135,7 +135,7 @@ export default {
throw new Error('Invalid storage stats')
}
- // Warn the user if the available account storage changed from > 0 to 0
+ // Warn the user if the available account storage changed from > 0 to 0
// (unless only because quota was intentionally set to 0 by admin in the interim)
if (this.storageStats?.free > 0 && response.data.data?.free <= 0 && response.data.data?.quota > 0) {
this.showStorageFullWarning()
diff --git a/apps/files/src/components/TransferOwnershipDialogue.vue b/apps/files/src/components/TransferOwnershipDialogue.vue
index 7c2dbd7d8e1..346bc3bbeb8 100644
--- a/apps/files/src/components/TransferOwnershipDialogue.vue
+++ b/apps/files/src/components/TransferOwnershipDialogue.vue
@@ -9,7 +9,7 @@
<form @submit.prevent="submit">
<p class="transfer-select-row">
<span>{{ readableDirectory }}</span>
- <NcButton v-if="directory === undefined"
+ <NcButton v-if="directory === undefined"
class="transfer-select-row__choose_button"
@click.prevent="start">
{{ t('files', 'Choose file or folder to transfer') }}
@@ -22,8 +22,8 @@
<label for="targetUser">
<span>{{ t('files', 'New owner') }}</span>
</label>
- <NcSelect input-id="targetUser"
- v-model="selectedUser"
+ <NcSelect v-model="selectedUser"
+ input-id="targetUser"
:options="formatedUserSuggestions"
:multiple="false"
:loading="loadingUsers"
diff --git a/apps/files/src/components/VirtualList.vue b/apps/files/src/components/VirtualList.vue
index 0ca2d869d17..3a08ab590e0 100644
--- a/apps/files/src/components/VirtualList.vue
+++ b/apps/files/src/components/VirtualList.vue
@@ -62,6 +62,10 @@ interface RecycledPoolItem {
item: Node,
}
+type DataSource = File | Folder
+
+type DataSourceKey = keyof DataSource
+
export default Vue.extend({
name: 'VirtualList',
@@ -73,11 +77,11 @@ export default Vue.extend({
required: true,
},
dataKey: {
- type: String,
+ type: String as PropType<DataSourceKey>,
required: true,
},
dataSources: {
- type: Array as PropType<(File | Folder)[]>,
+ type: Array as PropType<DataSource[]>,
required: true,
},
extraProps: {
@@ -260,7 +264,7 @@ export default Vue.extend({
// Adding scroll listener AFTER the initial scroll to index
this.$el.addEventListener('scroll', this.onScroll, { passive: true })
- this.$_recycledPool = {} as Record<string, any>
+ this.$_recycledPool = {} as Record<string, DataSource[DataSourceKey]>
},
beforeDestroy() {