From 3e08d3b6346425299738aac18542bd095b46bd30 Mon Sep 17 00:00:00 2001 From: Jan Michek <15363559+janmichek@users.noreply.github.com> Date: Wed, 24 Apr 2024 09:00:42 +0200 Subject: [PATCH] fix: The full file path is not visible when Contract Files are uploaded (#735) Co-authored-by: Michele Franchi --- src/components/ContractFileList.vue | 2 +- src/components/ContractsFileUpload.vue | 6 +++++- src/stores/contractVerification.js | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/ContractFileList.vue b/src/components/ContractFileList.vue index e78906822..a24f35c07 100644 --- a/src/components/ContractFileList.vue +++ b/src/components/ContractFileList.vue @@ -5,7 +5,7 @@ :key="index" class="contract-file-list__item"> - {{ file.webkitRelativePath || file.name }} + {{ file.webkitRelativePath }} { fileEntry.file(file => { + // chrome workaround to manually set webkitRelativePath + Object.defineProperty(file, 'webkitRelativePath', { + value: fileEntry.fullPath.substring(1), + }) files.push(file) selectedFiles.value.push(file) resolve(file) diff --git a/src/stores/contractVerification.js b/src/stores/contractVerification.js index 1c5fe58ba..ed350cf7e 100644 --- a/src/stores/contractVerification.js +++ b/src/stores/contractVerification.js @@ -24,7 +24,7 @@ export const useContractVerificationStore = defineStore('useContractVerification form.append('entryFile', entryFile) Array.from(sourceFiles).forEach(file => { - form.append('sourceFiles', file) + form.append('sourceFiles', file, file.webkitRelativePath) }) const data = await axios.post(`${CONTRACT_VERIFICATION_SERVICE_URL}/contracts/${contractId}`, form).catch(error => {