From 6c3651439c926d2fd1fad009ddc18c9890c490bf Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Sun, 20 Feb 2022 22:33:45 +0100 Subject: [PATCH] Fix lint issues --- .../helpers/resource/sameResource.spec.ts | 20 ++++++++++++++----- .../appDefaults/useAppFileHandling.ts | 7 +++++-- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/packages/web-app-files/tests/unit/helpers/resource/sameResource.spec.ts b/packages/web-app-files/tests/unit/helpers/resource/sameResource.spec.ts index 1fd50fc9e71..3cf1e10352b 100644 --- a/packages/web-app-files/tests/unit/helpers/resource/sameResource.spec.ts +++ b/packages/web-app-files/tests/unit/helpers/resource/sameResource.spec.ts @@ -10,14 +10,24 @@ describe('isSameResource', () => { expect(isSameResource({ id: 1, path: '', webDavPath: '' }, undefined)).toBe(false) }) test('evaluates to false if ids are of different types', () => { - expect(isSameResource({ id: 1, path: '', webDavPath: '' }, { id: '1', path: '', webDavPath: '' })).toBe(false) + expect( + isSameResource({ id: 1, path: '', webDavPath: '' }, { id: '1', path: '', webDavPath: '' }) + ).toBe(false) }) test('evaluates to false if ids are different values', () => { - expect(isSameResource({ id: 1, path: '', webDavPath: '' }, { id: 2, path: '', webDavPath: '' })).toBe(false) - expect(isSameResource({ id: '1', path: '', webDavPath: '' }, { id: '2', path: '', webDavPath: '' })).toBe(false) + expect( + isSameResource({ id: 1, path: '', webDavPath: '' }, { id: 2, path: '', webDavPath: '' }) + ).toBe(false) + expect( + isSameResource({ id: '1', path: '', webDavPath: '' }, { id: '2', path: '', webDavPath: '' }) + ).toBe(false) }) test('evaluates to true if ids are the same', () => { - expect(isSameResource({ id: 1, path: '', webDavPath: '' }, { id: 1, path: '', webDavPath: '' })).toBe(true) - expect(isSameResource({ id: '1', path: '', webDavPath: '' }, { id: '1', path: '', webDavPath: '' })).toBe(true) + expect( + isSameResource({ id: 1, path: '', webDavPath: '' }, { id: 1, path: '', webDavPath: '' }) + ).toBe(true) + expect( + isSameResource({ id: '1', path: '', webDavPath: '' }, { id: '1', path: '', webDavPath: '' }) + ).toBe(true) }) }) diff --git a/packages/web-pkg/src/composables/appDefaults/useAppFileHandling.ts b/packages/web-pkg/src/composables/appDefaults/useAppFileHandling.ts index 8b215267609..515c6163b43 100644 --- a/packages/web-pkg/src/composables/appDefaults/useAppFileHandling.ts +++ b/packages/web-pkg/src/composables/appDefaults/useAppFileHandling.ts @@ -29,14 +29,17 @@ export function useAppFileHandling(options: AppFileHandlingOptions): AppFileHand const isPublicLinkContext = options.isPublicLinkContext const publicLinkPassword = options.publicLinkPassword - const getUrlForResource = ({ webDavPath, downloadURL }: Resource, query: QueryParameters = null) => { + const getUrlForResource = ( + { webDavPath, downloadURL }: Resource, + query: QueryParameters = null + ) => { const queryStr = qs.stringify(query) if (unref(isPublicLinkContext)) { // If the resource does not contain the downloadURL we fallback to the normal // public files path. if (!downloadURL) { // TODO: check whether we can fix the resource to always contain public-files in the webDavPath - let urlPath = ['public-files', webDavPath].join('/') + const urlPath = ['public-files', webDavPath].join('/') return [client.files.getFileUrl(urlPath), queryStr].filter(Boolean).join('?') }