aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/src
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-10-16 14:06:49 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-10-16 22:11:59 +0200
commite8c1e2c611e6cc783e45abc036ee9d55d3a426d8 (patch)
tree6b4f1f6868a9734f9c589a058a9e716fecaef421 /apps/files_sharing/src
parent5be832344eacb8328600d256c3090671c3f582d2 (diff)
downloadnextcloud-server-e8c1e2c611e6cc783e45abc036ee9d55d3a426d8.tar.gz
nextcloud-server-e8c1e2c611e6cc783e45abc036ee9d55d3a426d8.zip
fix(code-style): Adjust JS code to our code style
This resolves 68 ESLint warnings about invalid code style. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files_sharing/src')
-rw-r--r--apps/files_sharing/src/files_views/shares.spec.ts1
-rw-r--r--apps/files_sharing/src/mixins/ShareRequests.js4
-rw-r--r--apps/files_sharing/src/models/Share.ts2
-rw-r--r--apps/files_sharing/src/utils/GeneratePassword.ts6
-rw-r--r--apps/files_sharing/src/views/SharingDetailsTab.vue1
-rw-r--r--apps/files_sharing/src/views/SharingTab.vue12
6 files changed, 16 insertions, 10 deletions
diff --git a/apps/files_sharing/src/files_views/shares.spec.ts b/apps/files_sharing/src/files_views/shares.spec.ts
index 153057bc0ad..79ef2a09843 100644
--- a/apps/files_sharing/src/files_views/shares.spec.ts
+++ b/apps/files_sharing/src/files_views/shares.spec.ts
@@ -3,6 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/* eslint-disable n/no-extraneous-import */
+/* eslint-disable @typescript-eslint/no-explicit-any */
import type { OCSResponse } from '@nextcloud/typings/ocs'
import { Folder, Navigation, View, getNavigation } from '@nextcloud/files'
import { beforeEach, describe, expect, test, vi } from 'vitest'
diff --git a/apps/files_sharing/src/mixins/ShareRequests.js b/apps/files_sharing/src/mixins/ShareRequests.js
index dcccd5e78ed..24b4b12061e 100644
--- a/apps/files_sharing/src/mixins/ShareRequests.js
+++ b/apps/files_sharing/src/mixins/ShareRequests.js
@@ -26,10 +26,10 @@ export default {
* @param {string} [data.password] password to protect public link Share with
* @param {number} [data.permissions] 1 = read; 2 = update; 4 = create; 8 = delete; 16 = share; 31 = all (default: 31, for public shares: 1)
* @param {boolean} [data.sendPasswordByTalk] send the password via a talk conversation
- * @param {string} [data.expireDate] expire the shareautomatically after
+ * @param {string} [data.expireDate] expire the share automatically after
* @param {string} [data.label] custom label
* @param {string} [data.attributes] Share attributes encoded as json
- * @param data.note
+ * @param {string} data.note custom note to recipient
* @return {Share} the new share
* @throws {Error}
*/
diff --git a/apps/files_sharing/src/models/Share.ts b/apps/files_sharing/src/models/Share.ts
index dab409853d0..bfc6357240d 100644
--- a/apps/files_sharing/src/models/Share.ts
+++ b/apps/files_sharing/src/models/Share.ts
@@ -314,7 +314,7 @@ export default class Share {
/**
* Get the shared item id
- */
+ */
get fileSource(): number {
return this._share.file_source
}
diff --git a/apps/files_sharing/src/utils/GeneratePassword.ts b/apps/files_sharing/src/utils/GeneratePassword.ts
index bbfa5e7b27d..2f3f65c51d8 100644
--- a/apps/files_sharing/src/utils/GeneratePassword.ts
+++ b/apps/files_sharing/src/utils/GeneratePassword.ts
@@ -13,9 +13,9 @@ const config = new Config()
const passwordSet = 'abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789'
/**
- * Generate a valid policy password or
- * request a valid password if password_policy
- * is enabled
+ * Generate a valid policy password or request a valid password if password_policy is enabled
+ *
+ * @param {boolean} verbose If enabled the the status is shown to the user via toast
*/
export default async function(verbose = false): Promise<string> {
// password policy is enabled, let's request a pass
diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue
index baa098352d1..3f9dca57d03 100644
--- a/apps/files_sharing/src/views/SharingDetailsTab.vue
+++ b/apps/files_sharing/src/views/SharingDetailsTab.vue
@@ -247,6 +247,7 @@
import { emit } from '@nextcloud/event-bus'
import { getLanguage } from '@nextcloud/l10n'
import { ShareType } from '@nextcloud/sharing'
+import moment from '@nextcloud/moment'
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
diff --git a/apps/files_sharing/src/views/SharingTab.vue b/apps/files_sharing/src/views/SharingTab.vue
index 318b8ca3b56..6870e43d816 100644
--- a/apps/files_sharing/src/views/SharingTab.vue
+++ b/apps/files_sharing/src/views/SharingTab.vue
@@ -82,15 +82,19 @@
</template>
<script>
-import axios from '@nextcloud/axios'
+import { getCurrentUser } from '@nextcloud/auth'
import { orderBy } from '@nextcloud/files'
import { loadState } from '@nextcloud/initial-state'
import { generateOcsUrl } from '@nextcloud/router'
import { CollectionList } from 'nextcloud-vue-collections'
+
+import axios from '@nextcloud/axios'
+import moment from '@nextcloud/moment'
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
-import Config from '../services/ConfigService.ts'
import { shareWithTitle } from '../utils/SharedWithMe.js'
+
+import Config from '../services/ConfigService.ts'
import Share from '../models/Share.ts'
import ShareTypes from '../mixins/ShareTypes.js'
import SharingEntryInternal from '../components/SharingEntryInternal.vue'
@@ -241,7 +245,7 @@ export default {
updateExpirationSubtitle(share) {
const expiration = moment(share.expireDate).unix()
this.$set(this.sharedWithMe, 'subtitle', t('files_sharing', 'Expires {relativetime}', {
- relativetime: OC.Util.relativeModifiedDate(expiration * 1000),
+ relativetime: moment(expiration * 1000).fromNow(),
}))
// share have expired
@@ -310,7 +314,7 @@ export default {
// interval update
this.expirationInterval = setInterval(this.updateExpirationSubtitle, 10000, share)
}
- } else if (this.fileInfo && this.fileInfo.shareOwnerId !== undefined ? this.fileInfo.shareOwnerId !== OC.currentUser : false) {
+ } else if (this.fileInfo && this.fileInfo.shareOwnerId !== undefined ? this.fileInfo.shareOwnerId !== getCurrentUser().uid : false) {
// Fallback to compare owner and current user.
this.sharedWithMe = {
displayName: this.fileInfo.shareOwner,