From d3f4448deb047b141aef2db56984549fdeff86b0 Mon Sep 17 00:00:00 2001 From: Paul Neubauer Date: Tue, 4 Oct 2022 10:48:57 +0200 Subject: [PATCH] Address PR issues --- .eslintrc.js | 3 +-- .../src/helpers/resource/actions/upload.ts | 14 +++++++++----- .../resource/conflictHandling/conflictDialog.ts | 1 + 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 224a0c36344..035d949fb1c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -28,8 +28,7 @@ module.exports = { 'no-new': 'off', 'jest/no-standalone-expect': 'off', 'node/no-callback-literal': 'off', - 'unused-imports/no-unused-imports': 'error', - 'no-useless-constructor': 0 + 'unused-imports/no-unused-imports': 'error' }, globals: { require: false, diff --git a/packages/web-app-files/src/helpers/resource/actions/upload.ts b/packages/web-app-files/src/helpers/resource/actions/upload.ts index bafed011fd3..dfa0331bd82 100644 --- a/packages/web-app-files/src/helpers/resource/actions/upload.ts +++ b/packages/web-app-files/src/helpers/resource/actions/upload.ts @@ -162,13 +162,17 @@ export class ResourcesUpload extends ConflictDialog { for (const file of filesInFolder) { const newFolderName = resolveFileNameDuplicate(folder, '', this.currentFiles) file.meta.relativeFolder = file.meta.relativeFolder.replace( - `/${folder}`, + new RegExp(`/${folder}` + '$'), + `/${newFolderName}` + ) + file.meta.relativePath = file.meta.relativePath.replace( + new RegExp(`/${folder}/` + '$'), + `/${newFolderName}/` + ) + file.meta.tusEndpoint = file.meta.tusEndpoint.replace( + new RegExp(`/${folder}` + '$'), `/${newFolderName}` ) - file.meta.relativePath = file.meta.relativePath.replace(`/${folder}/`, `/${newFolderName}/`) - file.meta.tusEndpoint = file.meta.tusEndpoint.replace(`/${folder}`, `/${newFolderName}`) - const data = file.data as any - data.relativePath = data.relativePath.replace(`/${folder}/`, `/${newFolderName}/`) } } if (files.length === 0) return diff --git a/packages/web-app-files/src/helpers/resource/conflictHandling/conflictDialog.ts b/packages/web-app-files/src/helpers/resource/conflictHandling/conflictDialog.ts index 273c75c84a1..3d7eb314402 100644 --- a/packages/web-app-files/src/helpers/resource/conflictHandling/conflictDialog.ts +++ b/packages/web-app-files/src/helpers/resource/conflictHandling/conflictDialog.ts @@ -9,6 +9,7 @@ interface FileConflict { } export class ConflictDialog { + /* eslint-disable */ constructor( protected createModal: (modal: object) => void, protected hideModal: () => void,