From e8c1e2c611e6cc783e45abc036ee9d55d3a426d8 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 16 Oct 2024 14:06:49 +0200 Subject: fix(code-style): Adjust JS code to our code style This resolves 68 ESLint warnings about invalid code style. Signed-off-by: Ferdinand Thiessen --- apps/files_sharing/src/files_views/shares.spec.ts | 1 + apps/files_sharing/src/mixins/ShareRequests.js | 4 ++-- apps/files_sharing/src/models/Share.ts | 2 +- apps/files_sharing/src/utils/GeneratePassword.ts | 6 +++--- apps/files_sharing/src/views/SharingDetailsTab.vue | 1 + apps/files_sharing/src/views/SharingTab.vue | 12 ++++++++---- 6 files changed, 16 insertions(+), 10 deletions(-) (limited to 'apps/files_sharing/src') 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 { // 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 @@