From c98f8707e53f6fcc4876581600c9f92ada64f8d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=BA=E5=9B=BD?= Date: Mon, 17 Apr 2023 13:59:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=AE=A1=E7=90=86=E5=A2=9E=E5=8A=A0=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E5=88=97=E6=98=BE=E7=A4=BA=EF=BC=8C=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=96=87=E4=BB=B6=E6=9F=A5=E7=9C=8B=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1025466 --user=宋天阳 【项目设置】github#23686,文件管理拉取git文件存在三问题 https://www.tapd.cn/55049933/s/1363277 --- .../frontend/src/business/commons/QuoteFileList.vue | 2 +- .../metadata/service/FileMetadataService.java | 11 +++++++++-- .../src/business/menu/file/list/FileMetadataList.vue | 9 ++++++--- .../src/business/menu/file/module/FileModule.vue | 1 + 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/api-test/frontend/src/business/commons/QuoteFileList.vue b/api-test/frontend/src/business/commons/QuoteFileList.vue index 0a1b5319c6..5af0cb72eb 100644 --- a/api-test/frontend/src/business/commons/QuoteFileList.vue +++ b/api-test/frontend/src/business/commons/QuoteFileList.vue @@ -53,7 +53,7 @@ :filters="typeFilters" :label="$t('load_test.file_type')"> - + diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/metadata/service/FileMetadataService.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/metadata/service/FileMetadataService.java index b4aefbed3c..cd3db5dff1 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/metadata/service/FileMetadataService.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/metadata/service/FileMetadataService.java @@ -353,8 +353,8 @@ public class FileMetadataService { } fileMetadata.setUpdateTime(System.currentTimeMillis()); fileMetadata.setUpdateUser(SessionUtils.getUserId()); - // 历史数据的路径不做更新 - if (StringUtils.isNotEmpty(fileMetadata.getStorage()) && StringUtils.isEmpty(fileMetadata.getResourceType())) { + // 历史数据和Git数据的路径不做更新 + if (!StringUtils.equalsIgnoreCase(StorageConstants.GIT.name(), fileMetadata.getStorage()) && (StringUtils.isNotEmpty(fileMetadata.getStorage()) && StringUtils.isEmpty(fileMetadata.getResourceType()))) { fileMetadata.setPath(FileUtils.getFilePath(fileMetadata)); } //latest字段只能在git/pull时更新 @@ -365,6 +365,13 @@ public class FileMetadataService { public boolean isFileChanged(FileMetadataWithBLOBs newFile) { FileMetadataWithBLOBs oldFile = this.getFileMetadataById(newFile.getId()); if (oldFile != null) { + if (StringUtils.equals("[]", oldFile.getTags())) { + oldFile.setTags(null); + } + if (StringUtils.equals("[]", newFile.getTags())) { + newFile.setTags(null); + } + return !StringUtils.equals(newFile.getDescription(), oldFile.getDescription()) || !StringUtils.equals(newFile.getAttachInfo(), oldFile.getAttachInfo()) || !StringUtils.equals(newFile.getName(), oldFile.getName()) diff --git a/project-management/frontend/src/business/menu/file/list/FileMetadataList.vue b/project-management/frontend/src/business/menu/file/list/FileMetadataList.vue index c23c68274c..72992a0ff0 100644 --- a/project-management/frontend/src/business/menu/file/list/FileMetadataList.vue +++ b/project-management/frontend/src/business/menu/file/list/FileMetadataList.vue @@ -77,9 +77,12 @@ :label="$t('load_test.file_type')" > - - - + + {