From a7f7a83031507ab723326530cf4f9aee2692df8b Mon Sep 17 00:00:00 2001 From: BugKing Date: Thu, 1 Apr 2021 09:29:58 +0800 Subject: [PATCH 001/129] =?UTF-8?q?build:=20=E5=A2=9E=E5=8A=A0=E8=87=AA?= =?UTF-8?q?=E5=8A=A8PR=E7=9A=84action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/auto-pr.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/auto-pr.yml diff --git a/.github/workflows/auto-pr.yml b/.github/workflows/auto-pr.yml new file mode 100644 index 0000000000..289f74d0bc --- /dev/null +++ b/.github/workflows/auto-pr.yml @@ -0,0 +1,13 @@ +on: [push, pull_request, release] + +name: MeterSphere pull request handler + +jobs: + generic_handler: + name: Generic handler for MeterSphere Repos + runs-on: ubuntu-latest + steps: + - name: Add labels + uses: jumpserver/action-generic-handler@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }} \ No newline at end of file From 010b8185c8a8a9d02bcbc1e3251ab9d68713a4dd Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Thu, 1 Apr 2021 11:08:52 +0800 Subject: [PATCH 002/129] =?UTF-8?q?refactor(=E6=80=A7=E8=83=BD=E6=B5=8B?= =?UTF-8?q?=E8=AF=95):=20=E6=B5=8B=E8=AF=95=E6=8A=A5=E5=91=8A=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=B1=95=E7=A4=BAmedian=EF=BC=8C=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../performance/report/components/RequestStatistics.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/business/components/performance/report/components/RequestStatistics.vue b/frontend/src/business/components/performance/report/components/RequestStatistics.vue index 06e59e8851..294c1fac27 100644 --- a/frontend/src/business/components/performance/report/components/RequestStatistics.vue +++ b/frontend/src/business/components/performance/report/components/RequestStatistics.vue @@ -61,6 +61,10 @@ prop="max" label="Max" /> + Date: Thu, 1 Apr 2021 11:04:05 +0800 Subject: [PATCH 003/129] =?UTF-8?q?refactor(=E6=80=A7=E8=83=BD=E6=B5=8B?= =?UTF-8?q?=E8=AF=95):=20=E6=B5=8B=E8=AF=95=E6=8A=A5=E5=91=8A=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=B1=95=E7=A4=BAmedian=EF=BC=8C=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/metersphere/performance/base/Statistics.java | 4 +++- .../performance/report/components/RequestStatistics.vue | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/performance/base/Statistics.java b/backend/src/main/java/io/metersphere/performance/base/Statistics.java index 119e5100c7..c53648fa44 100644 --- a/backend/src/main/java/io/metersphere/performance/base/Statistics.java +++ b/backend/src/main/java/io/metersphere/performance/base/Statistics.java @@ -9,7 +9,7 @@ public class Statistics { private String samples; - private String ko; + private String fail; private String error; @@ -19,6 +19,8 @@ public class Statistics { private String max; + private String median; + private String tp90; private String tp95; diff --git a/frontend/src/business/components/performance/report/components/RequestStatistics.vue b/frontend/src/business/components/performance/report/components/RequestStatistics.vue index 294c1fac27..4013aab85c 100644 --- a/frontend/src/business/components/performance/report/components/RequestStatistics.vue +++ b/frontend/src/business/components/performance/report/components/RequestStatistics.vue @@ -36,7 +36,7 @@ /> From ca7130a42011c489f6cf54f4e5077922df589dfb Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 1 Apr 2021 10:53:56 +0800 Subject: [PATCH 004/129] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96):=20=E6=89=A7=E8=A1=8C=E6=97=B6=E7=BB=99?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E7=9A=84=E5=9C=BA=E6=99=AF=E6=AD=A5=E9=AA=A4?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AEID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/api/dto/definition/request/MsScenario.java | 5 +++-- .../api/dto/definition/request/MsTestElement.java | 1 + .../commons/constants/MsTestElementConstants.java | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java index 02fc8979bd..384a5cd190 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java @@ -14,6 +14,7 @@ import io.metersphere.api.service.ApiAutomationService; import io.metersphere.api.service.ApiTestEnvironmentService; import io.metersphere.base.domain.ApiScenarioWithBLOBs; import io.metersphere.base.domain.ApiTestEnvironmentWithBLOBs; +import io.metersphere.commons.constants.MsTestElementConstants; import io.metersphere.commons.utils.CommonBeanFactory; import io.metersphere.commons.utils.FileUtils; import io.metersphere.commons.utils.SessionUtils; @@ -77,9 +78,9 @@ public class MsScenario extends MsTestElement { if (!config.isOperating() && !this.isEnable()) { return; } - if (this.getReferenced() != null && this.getReferenced().equals("Deleted")) { + if (this.getReferenced() != null && this.getReferenced().equals(MsTestElementConstants.Deleted.name())) { return; - } else if (this.getReferenced() != null && this.getReferenced().equals("REF")) { + } else if (this.getReferenced() != null && MsTestElementConstants.REF.name().equals(this.getReferenced())) { try { ApiAutomationService apiAutomationService = CommonBeanFactory.getBean(ApiAutomationService.class); ObjectMapper mapper = new ObjectMapper(); diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java index 03f2ca46a6..6ca67bba17 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java @@ -160,6 +160,7 @@ public abstract class MsTestElement { mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); ApiDefinitionWithBLOBs apiDefinition = apiDefinitionService.getBLOBs(element.getId()); if (apiDefinition != null) { + element.setProjectId(apiDefinition.getProjectId()); element = mapper.readValue(apiDefinition.getRequest(), new TypeReference() { }); hashTree.add(element); diff --git a/backend/src/main/java/io/metersphere/commons/constants/MsTestElementConstants.java b/backend/src/main/java/io/metersphere/commons/constants/MsTestElementConstants.java index e3e2dbf232..81f0415d05 100644 --- a/backend/src/main/java/io/metersphere/commons/constants/MsTestElementConstants.java +++ b/backend/src/main/java/io/metersphere/commons/constants/MsTestElementConstants.java @@ -1,5 +1,5 @@ package io.metersphere.commons.constants; public enum MsTestElementConstants { - LoopController,SCENARIO,REF + LoopController,SCENARIO,REF,Deleted } From 113cb8e93f30a4e93570427f797e0aee8e04eaf7 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 1 Apr 2021 10:59:34 +0800 Subject: [PATCH 005/129] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96):=20=E9=99=90=E5=88=B6=E5=8F=AA=E6=9C=89?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=AF=B7=E6=B1=82=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E5=8F=A6=E5=AD=98=E6=96=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/automation/scenario/component/StepExtendBtns.vue | 9 ++++----- frontend/src/i18n/en-US.js | 5 +++++ frontend/src/i18n/zh-CN.js | 5 +++++ frontend/src/i18n/zh-TW.js | 5 +++++ 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/component/StepExtendBtns.vue b/frontend/src/business/components/api/automation/scenario/component/StepExtendBtns.vue index 273121e660..b7d9970906 100644 --- a/frontend/src/business/components/api/automation/scenario/component/StepExtendBtns.vue +++ b/frontend/src/business/components/api/automation/scenario/component/StepExtendBtns.vue @@ -5,11 +5,10 @@ - - 删除步骤 - 查看场景变量 - 打开场景 - 另存为接口定义 + {{this.$t('api_test.automation.delete_step')}} + {{this.$t("api_test.automation.view_scene_variables")}} + {{this.$t("api_test.automation.open_scene")}} + {{this.$t("api_test.automation.save_as_api")}} diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 3ffb614514..d98cec7e9a 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -705,6 +705,11 @@ export default { } }, automation: { + view_scene_variables: "View scene variables", + open_scene: "Open scene", + save_as_api: "Save as api", + delete_step: "Delete step", + reference_deleted_info: "Reference scene has been deleted", follow_people: "Follow people", create_tag: "Create tag", scenario_step: "Ccenario step", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 5039195966..060b0161fe 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -706,6 +706,11 @@ export default { } }, automation: { + view_scene_variables: "查看场景变量", + open_scene: "打开场景", + save_as_api: "另存为接口定义", + delete_step: "删除步骤", + reference_deleted_info: "引用场景已经被删除", follow_people: "关注人", create_tag: "创建Tag", scenario_step: "场景步骤", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 2a6ca86ab7..21df6e7b38 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -705,6 +705,11 @@ export default { } }, automation: { + view_scene_variables: "查看場景變量", + open_scene: "打開場景", + save_as_api: "另存為接口定義", + delete_step: "删除步骤", + reference_deleted_info: "引用場景已經被刪除", follow_people: "關註人", create_tag: "創建Tag", scenario_step: "場景步驟", From b659206b0e8b6f3f42ae867b3392872cd4709a1f Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Thu, 1 Apr 2021 13:33:11 +0800 Subject: [PATCH 006/129] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=9B=B4=E6=96=B0):=20=E4=BF=AE=E5=A4=8D=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=96=87=E4=BB=B6=E6=9B=B4=E6=96=B0=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E4=B8=8A=E4=BC=A0=E5=90=8C=E5=90=8D=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ProjectController.java | 6 +++--- .../io/metersphere/service/FileService.java | 7 +++++++ .../metersphere/service/ProjectService.java | 20 ++++++++++++------- .../test/components/ResourceFiles.vue | 2 +- 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/backend/src/main/java/io/metersphere/controller/ProjectController.java b/backend/src/main/java/io/metersphere/controller/ProjectController.java index f9feec4b15..9f4321d986 100644 --- a/backend/src/main/java/io/metersphere/controller/ProjectController.java +++ b/backend/src/main/java/io/metersphere/controller/ProjectController.java @@ -91,9 +91,9 @@ public class ProjectController { return projectService.uploadFiles(projectId, files); } - @PostMapping(value = "/update/file/{projectId}/{fileId}", consumes = {"multipart/form-data"}) - public FileMetadata updateFile(@PathVariable String projectId, @PathVariable String fileId, @RequestPart(value = "file") MultipartFile file) { - return projectService.updateFile(projectId, fileId, file); + @PostMapping(value = "/update/file/{fileId}", consumes = {"multipart/form-data"}) + public FileMetadata updateFile(@PathVariable String fileId, @RequestPart(value = "file") MultipartFile file) { + return projectService.updateFile(fileId, file); } @GetMapping(value = "delete/file/{fileId}") diff --git a/backend/src/main/java/io/metersphere/service/FileService.java b/backend/src/main/java/io/metersphere/service/FileService.java index 817ca5826d..74c095bc0f 100644 --- a/backend/src/main/java/io/metersphere/service/FileService.java +++ b/backend/src/main/java/io/metersphere/service/FileService.java @@ -43,6 +43,13 @@ public class FileService { return fileContentMapper.selectByPrimaryKey(fileId); } + public void setFileContent(String fileId, byte[] content) { + FileContent record = new FileContent(); + record .setFile(content); + record.setFileId(fileId); + fileContentMapper.updateByPrimaryKeySelective(record); + } + public void deleteFileByIds(List ids) { if (CollectionUtils.isEmpty(ids)) { return; diff --git a/backend/src/main/java/io/metersphere/service/ProjectService.java b/backend/src/main/java/io/metersphere/service/ProjectService.java index 7fea391b86..d44beaa170 100644 --- a/backend/src/main/java/io/metersphere/service/ProjectService.java +++ b/backend/src/main/java/io/metersphere/service/ProjectService.java @@ -28,6 +28,7 @@ import org.springframework.util.CollectionUtils; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.UUID; @@ -186,16 +187,21 @@ public class ProjectService { return result; } - public FileMetadata updateFile(String projectId, String fileId, MultipartFile file) { + public FileMetadata updateFile( String fileId, MultipartFile file) { QueryProjectFileRequest request = new QueryProjectFileRequest(); request.setName(file.getOriginalFilename()); - if (CollectionUtils.isEmpty(fileService.getProjectFiles(projectId, request))) { - fileService.deleteFileById(fileId); - return fileService.saveFile(file, projectId); - } else { - MSException.throwException(Translator.get("project_file_already_exists")); + FileMetadata fileMetadata = fileService.getFileMetadataById(fileId); + if (fileMetadata != null) { + fileMetadata.setSize(file.getSize()); + fileMetadata.setUpdateTime(System.currentTimeMillis()); + fileService.updateFileMetadata(fileMetadata); + try { + fileService.setFileContent(fileId, file.getBytes()); + } catch (IOException e) { + MSException.throwException(e); + } } - return null; + return fileMetadata; } public void deleteFile(String fileId) { diff --git a/frontend/src/business/components/performance/test/components/ResourceFiles.vue b/frontend/src/business/components/performance/test/components/ResourceFiles.vue index b05920888b..880323d75c 100644 --- a/frontend/src/business/components/performance/test/components/ResourceFiles.vue +++ b/frontend/src/business/components/performance/test/components/ResourceFiles.vue @@ -167,7 +167,7 @@ export default { } let formData = new FormData(); - let url = '/project/update/file/' + this.projectId + '/' + this.currentRow.id + let url = '/project/update/file/' + '/' + this.currentRow.id formData.append("file", file); let options = { method: 'POST', From 012d7fbaec7dcd18e6110c52249b381d19553e07 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 1 Apr 2021 10:53:56 +0800 Subject: [PATCH 007/129] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96):=20=E6=89=A7=E8=A1=8C=E6=97=B6=E7=BB=99?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E7=9A=84=E5=9C=BA=E6=99=AF=E6=AD=A5=E9=AA=A4?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AEID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/api/dto/definition/request/MsScenario.java | 5 +++-- .../api/dto/definition/request/MsTestElement.java | 1 + .../commons/constants/MsTestElementConstants.java | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java index 02fc8979bd..384a5cd190 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java @@ -14,6 +14,7 @@ import io.metersphere.api.service.ApiAutomationService; import io.metersphere.api.service.ApiTestEnvironmentService; import io.metersphere.base.domain.ApiScenarioWithBLOBs; import io.metersphere.base.domain.ApiTestEnvironmentWithBLOBs; +import io.metersphere.commons.constants.MsTestElementConstants; import io.metersphere.commons.utils.CommonBeanFactory; import io.metersphere.commons.utils.FileUtils; import io.metersphere.commons.utils.SessionUtils; @@ -77,9 +78,9 @@ public class MsScenario extends MsTestElement { if (!config.isOperating() && !this.isEnable()) { return; } - if (this.getReferenced() != null && this.getReferenced().equals("Deleted")) { + if (this.getReferenced() != null && this.getReferenced().equals(MsTestElementConstants.Deleted.name())) { return; - } else if (this.getReferenced() != null && this.getReferenced().equals("REF")) { + } else if (this.getReferenced() != null && MsTestElementConstants.REF.name().equals(this.getReferenced())) { try { ApiAutomationService apiAutomationService = CommonBeanFactory.getBean(ApiAutomationService.class); ObjectMapper mapper = new ObjectMapper(); diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java index 03f2ca46a6..6ca67bba17 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java @@ -160,6 +160,7 @@ public abstract class MsTestElement { mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); ApiDefinitionWithBLOBs apiDefinition = apiDefinitionService.getBLOBs(element.getId()); if (apiDefinition != null) { + element.setProjectId(apiDefinition.getProjectId()); element = mapper.readValue(apiDefinition.getRequest(), new TypeReference() { }); hashTree.add(element); diff --git a/backend/src/main/java/io/metersphere/commons/constants/MsTestElementConstants.java b/backend/src/main/java/io/metersphere/commons/constants/MsTestElementConstants.java index e3e2dbf232..81f0415d05 100644 --- a/backend/src/main/java/io/metersphere/commons/constants/MsTestElementConstants.java +++ b/backend/src/main/java/io/metersphere/commons/constants/MsTestElementConstants.java @@ -1,5 +1,5 @@ package io.metersphere.commons.constants; public enum MsTestElementConstants { - LoopController,SCENARIO,REF + LoopController,SCENARIO,REF,Deleted } From fc13f0dc3663977f224b878d23a794bc5c5f1986 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 1 Apr 2021 10:59:34 +0800 Subject: [PATCH 008/129] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96):=20=E9=99=90=E5=88=B6=E5=8F=AA=E6=9C=89?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=AF=B7=E6=B1=82=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E5=8F=A6=E5=AD=98=E6=96=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/automation/scenario/component/StepExtendBtns.vue | 9 ++++----- frontend/src/i18n/en-US.js | 5 +++++ frontend/src/i18n/zh-CN.js | 5 +++++ frontend/src/i18n/zh-TW.js | 5 +++++ 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/component/StepExtendBtns.vue b/frontend/src/business/components/api/automation/scenario/component/StepExtendBtns.vue index 273121e660..b7d9970906 100644 --- a/frontend/src/business/components/api/automation/scenario/component/StepExtendBtns.vue +++ b/frontend/src/business/components/api/automation/scenario/component/StepExtendBtns.vue @@ -5,11 +5,10 @@ - - 删除步骤 - 查看场景变量 - 打开场景 - 另存为接口定义 + {{this.$t('api_test.automation.delete_step')}} + {{this.$t("api_test.automation.view_scene_variables")}} + {{this.$t("api_test.automation.open_scene")}} + {{this.$t("api_test.automation.save_as_api")}} diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 3ffb614514..d98cec7e9a 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -705,6 +705,11 @@ export default { } }, automation: { + view_scene_variables: "View scene variables", + open_scene: "Open scene", + save_as_api: "Save as api", + delete_step: "Delete step", + reference_deleted_info: "Reference scene has been deleted", follow_people: "Follow people", create_tag: "Create tag", scenario_step: "Ccenario step", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 5039195966..060b0161fe 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -706,6 +706,11 @@ export default { } }, automation: { + view_scene_variables: "查看场景变量", + open_scene: "打开场景", + save_as_api: "另存为接口定义", + delete_step: "删除步骤", + reference_deleted_info: "引用场景已经被删除", follow_people: "关注人", create_tag: "创建Tag", scenario_step: "场景步骤", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 2a6ca86ab7..21df6e7b38 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -705,6 +705,11 @@ export default { } }, automation: { + view_scene_variables: "查看場景變量", + open_scene: "打開場景", + save_as_api: "另存為接口定義", + delete_step: "删除步骤", + reference_deleted_info: "引用場景已經被刪除", follow_people: "關註人", create_tag: "創建Tag", scenario_step: "場景步驟", From 639d163e0e6a4458da8108dcabe1f9798d81559a Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Thu, 1 Apr 2021 11:08:52 +0800 Subject: [PATCH 009/129] =?UTF-8?q?refactor(=E6=80=A7=E8=83=BD=E6=B5=8B?= =?UTF-8?q?=E8=AF=95):=20=E6=B5=8B=E8=AF=95=E6=8A=A5=E5=91=8A=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=B1=95=E7=A4=BAmedian=EF=BC=8C=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../performance/report/components/RequestStatistics.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/business/components/performance/report/components/RequestStatistics.vue b/frontend/src/business/components/performance/report/components/RequestStatistics.vue index 06e59e8851..294c1fac27 100644 --- a/frontend/src/business/components/performance/report/components/RequestStatistics.vue +++ b/frontend/src/business/components/performance/report/components/RequestStatistics.vue @@ -61,6 +61,10 @@ prop="max" label="Max" /> + Date: Thu, 1 Apr 2021 11:04:05 +0800 Subject: [PATCH 010/129] =?UTF-8?q?refactor(=E6=80=A7=E8=83=BD=E6=B5=8B?= =?UTF-8?q?=E8=AF=95):=20=E6=B5=8B=E8=AF=95=E6=8A=A5=E5=91=8A=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=B1=95=E7=A4=BAmedian=EF=BC=8C=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/metersphere/performance/base/Statistics.java | 4 +++- .../performance/report/components/RequestStatistics.vue | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/performance/base/Statistics.java b/backend/src/main/java/io/metersphere/performance/base/Statistics.java index 119e5100c7..c53648fa44 100644 --- a/backend/src/main/java/io/metersphere/performance/base/Statistics.java +++ b/backend/src/main/java/io/metersphere/performance/base/Statistics.java @@ -9,7 +9,7 @@ public class Statistics { private String samples; - private String ko; + private String fail; private String error; @@ -19,6 +19,8 @@ public class Statistics { private String max; + private String median; + private String tp90; private String tp95; diff --git a/frontend/src/business/components/performance/report/components/RequestStatistics.vue b/frontend/src/business/components/performance/report/components/RequestStatistics.vue index 294c1fac27..4013aab85c 100644 --- a/frontend/src/business/components/performance/report/components/RequestStatistics.vue +++ b/frontend/src/business/components/performance/report/components/RequestStatistics.vue @@ -36,7 +36,7 @@ /> From 51b6ea2850ad5d6f801c94613ed6e949aa5e06d4 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Thu, 1 Apr 2021 13:33:11 +0800 Subject: [PATCH 011/129] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=9B=B4=E6=96=B0):=20=E4=BF=AE=E5=A4=8D=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=96=87=E4=BB=B6=E6=9B=B4=E6=96=B0=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E4=B8=8A=E4=BC=A0=E5=90=8C=E5=90=8D=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ProjectController.java | 6 +++--- .../io/metersphere/service/FileService.java | 7 +++++++ .../metersphere/service/ProjectService.java | 20 ++++++++++++------- .../test/components/ResourceFiles.vue | 2 +- 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/backend/src/main/java/io/metersphere/controller/ProjectController.java b/backend/src/main/java/io/metersphere/controller/ProjectController.java index f9feec4b15..9f4321d986 100644 --- a/backend/src/main/java/io/metersphere/controller/ProjectController.java +++ b/backend/src/main/java/io/metersphere/controller/ProjectController.java @@ -91,9 +91,9 @@ public class ProjectController { return projectService.uploadFiles(projectId, files); } - @PostMapping(value = "/update/file/{projectId}/{fileId}", consumes = {"multipart/form-data"}) - public FileMetadata updateFile(@PathVariable String projectId, @PathVariable String fileId, @RequestPart(value = "file") MultipartFile file) { - return projectService.updateFile(projectId, fileId, file); + @PostMapping(value = "/update/file/{fileId}", consumes = {"multipart/form-data"}) + public FileMetadata updateFile(@PathVariable String fileId, @RequestPart(value = "file") MultipartFile file) { + return projectService.updateFile(fileId, file); } @GetMapping(value = "delete/file/{fileId}") diff --git a/backend/src/main/java/io/metersphere/service/FileService.java b/backend/src/main/java/io/metersphere/service/FileService.java index 817ca5826d..74c095bc0f 100644 --- a/backend/src/main/java/io/metersphere/service/FileService.java +++ b/backend/src/main/java/io/metersphere/service/FileService.java @@ -43,6 +43,13 @@ public class FileService { return fileContentMapper.selectByPrimaryKey(fileId); } + public void setFileContent(String fileId, byte[] content) { + FileContent record = new FileContent(); + record .setFile(content); + record.setFileId(fileId); + fileContentMapper.updateByPrimaryKeySelective(record); + } + public void deleteFileByIds(List ids) { if (CollectionUtils.isEmpty(ids)) { return; diff --git a/backend/src/main/java/io/metersphere/service/ProjectService.java b/backend/src/main/java/io/metersphere/service/ProjectService.java index 7fea391b86..d44beaa170 100644 --- a/backend/src/main/java/io/metersphere/service/ProjectService.java +++ b/backend/src/main/java/io/metersphere/service/ProjectService.java @@ -28,6 +28,7 @@ import org.springframework.util.CollectionUtils; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.UUID; @@ -186,16 +187,21 @@ public class ProjectService { return result; } - public FileMetadata updateFile(String projectId, String fileId, MultipartFile file) { + public FileMetadata updateFile( String fileId, MultipartFile file) { QueryProjectFileRequest request = new QueryProjectFileRequest(); request.setName(file.getOriginalFilename()); - if (CollectionUtils.isEmpty(fileService.getProjectFiles(projectId, request))) { - fileService.deleteFileById(fileId); - return fileService.saveFile(file, projectId); - } else { - MSException.throwException(Translator.get("project_file_already_exists")); + FileMetadata fileMetadata = fileService.getFileMetadataById(fileId); + if (fileMetadata != null) { + fileMetadata.setSize(file.getSize()); + fileMetadata.setUpdateTime(System.currentTimeMillis()); + fileService.updateFileMetadata(fileMetadata); + try { + fileService.setFileContent(fileId, file.getBytes()); + } catch (IOException e) { + MSException.throwException(e); + } } - return null; + return fileMetadata; } public void deleteFile(String fileId) { diff --git a/frontend/src/business/components/performance/test/components/ResourceFiles.vue b/frontend/src/business/components/performance/test/components/ResourceFiles.vue index b05920888b..880323d75c 100644 --- a/frontend/src/business/components/performance/test/components/ResourceFiles.vue +++ b/frontend/src/business/components/performance/test/components/ResourceFiles.vue @@ -167,7 +167,7 @@ export default { } let formData = new FormData(); - let url = '/project/update/file/' + this.projectId + '/' + this.currentRow.id + let url = '/project/update/file/' + '/' + this.currentRow.id formData.append("file", file); let options = { method: 'POST', From 40d53607d00ff5306065101126d72bb40c175283 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Thu, 1 Apr 2021 14:41:37 +0800 Subject: [PATCH 012/129] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E7=8E=87=E7=9A=84=E7=BB=9F=E8=AE=A1=E5=85=AC?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/APITestController.java | 12 ------------ .../base/mapper/ext/ExtApiDefinitionMapper.xml | 2 +- .../components/api/homepage/ApiTestHomePage.vue | 2 +- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/controller/APITestController.java b/backend/src/main/java/io/metersphere/api/controller/APITestController.java index 185abbd176..9a0b8f1f41 100644 --- a/backend/src/main/java/io/metersphere/api/controller/APITestController.java +++ b/backend/src/main/java/io/metersphere/api/controller/APITestController.java @@ -288,23 +288,11 @@ public class APITestController { * 接口覆盖率 * 复制的接口定义/复制或引用的单接口用例/ 添加的自定义请求 url 路径与现有的接口定义一致的请求 */ - long startTime1 = System.currentTimeMillis(); List allScenarioInfoList = apiAutomationService.selectIdAndScenarioByProjectId(projectId); - long startTime2 = System.currentTimeMillis(); - System.out.println("Search data time : " + (startTime2 - startTime1)); - startTime1 = System.currentTimeMillis(); List allEffectiveApiIdList = apiDefinitionService.selectEffectiveIdByProjectId(projectId); - startTime2 = System.currentTimeMillis(); - System.out.println("Search data time (api info) : " + (startTime2 - startTime1)); List allEffectiveApiCaseList = apiTestCaseService.selectEffectiveTestCaseByProjectId(projectId); - long startTime3 = System.currentTimeMillis(); - System.out.println("Search data time (case info): " + (startTime3 - startTime2)); - try { - startTime1 = System.currentTimeMillis(); float intetfaceCoverageRageNumber = apiAutomationService.countInterfaceCoverage(allScenarioInfoList, allEffectiveApiIdList, allEffectiveApiCaseList); - startTime2 = System.currentTimeMillis(); - System.out.println("Count data time : " + (startTime2 - startTime1)); DecimalFormat df = new DecimalFormat("0.0"); returnStr = df.format(intetfaceCoverageRageNumber) + "%"; }catch (Exception e){ diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml index 7067ce9a49..a136fbd0af 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml @@ -468,7 +468,7 @@ diff --git a/frontend/src/business/components/api/homepage/ApiTestHomePage.vue b/frontend/src/business/components/api/homepage/ApiTestHomePage.vue index 1bd4373d58..e3610ad9b6 100644 --- a/frontend/src/business/components/api/homepage/ApiTestHomePage.vue +++ b/frontend/src/business/components/api/homepage/ApiTestHomePage.vue @@ -109,7 +109,7 @@ export default { this.$get("/api/testSceneInfoCount/" + selectProjectId, response => { this.sceneCountData = response.data; }); - + this.interfaceCoverage = "waitting..."; this.$get("/api/countInterfaceCoverage/" + selectProjectId, response => { this.interfaceCoverage = response.data; }); From 01bde26454f30c62626a0c04d4c522fe0f4fed55 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Thu, 1 Apr 2021 14:41:37 +0800 Subject: [PATCH 013/129] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E7=8E=87=E7=9A=84=E7=BB=9F=E8=AE=A1=E5=85=AC?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/APITestController.java | 12 ------------ .../base/mapper/ext/ExtApiDefinitionMapper.xml | 2 +- .../components/api/homepage/ApiTestHomePage.vue | 2 +- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/controller/APITestController.java b/backend/src/main/java/io/metersphere/api/controller/APITestController.java index 185abbd176..9a0b8f1f41 100644 --- a/backend/src/main/java/io/metersphere/api/controller/APITestController.java +++ b/backend/src/main/java/io/metersphere/api/controller/APITestController.java @@ -288,23 +288,11 @@ public class APITestController { * 接口覆盖率 * 复制的接口定义/复制或引用的单接口用例/ 添加的自定义请求 url 路径与现有的接口定义一致的请求 */ - long startTime1 = System.currentTimeMillis(); List allScenarioInfoList = apiAutomationService.selectIdAndScenarioByProjectId(projectId); - long startTime2 = System.currentTimeMillis(); - System.out.println("Search data time : " + (startTime2 - startTime1)); - startTime1 = System.currentTimeMillis(); List allEffectiveApiIdList = apiDefinitionService.selectEffectiveIdByProjectId(projectId); - startTime2 = System.currentTimeMillis(); - System.out.println("Search data time (api info) : " + (startTime2 - startTime1)); List allEffectiveApiCaseList = apiTestCaseService.selectEffectiveTestCaseByProjectId(projectId); - long startTime3 = System.currentTimeMillis(); - System.out.println("Search data time (case info): " + (startTime3 - startTime2)); - try { - startTime1 = System.currentTimeMillis(); float intetfaceCoverageRageNumber = apiAutomationService.countInterfaceCoverage(allScenarioInfoList, allEffectiveApiIdList, allEffectiveApiCaseList); - startTime2 = System.currentTimeMillis(); - System.out.println("Count data time : " + (startTime2 - startTime1)); DecimalFormat df = new DecimalFormat("0.0"); returnStr = df.format(intetfaceCoverageRageNumber) + "%"; }catch (Exception e){ diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml index 7067ce9a49..a136fbd0af 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml @@ -468,7 +468,7 @@ diff --git a/frontend/src/business/components/api/homepage/ApiTestHomePage.vue b/frontend/src/business/components/api/homepage/ApiTestHomePage.vue index 1bd4373d58..e3610ad9b6 100644 --- a/frontend/src/business/components/api/homepage/ApiTestHomePage.vue +++ b/frontend/src/business/components/api/homepage/ApiTestHomePage.vue @@ -109,7 +109,7 @@ export default { this.$get("/api/testSceneInfoCount/" + selectProjectId, response => { this.sceneCountData = response.data; }); - + this.interfaceCoverage = "waitting..."; this.$get("/api/countInterfaceCoverage/" + selectProjectId, response => { this.interfaceCoverage = response.data; }); From c61563d3447cdea21c36c7c18eaf7bc97b0fd61a Mon Sep 17 00:00:00 2001 From: wenyann <64353056+wenyann@users.noreply.github.com> Date: Wed, 31 Mar 2021 18:10:53 +0800 Subject: [PATCH 014/129] =?UTF-8?q?fix:=E5=8A=A0=E5=A4=A7case=20review?= =?UTF-8?q?=E4=B8=ADcomment=E7=9A=84=E9=95=BF=E5=BA=A6=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/components/track/review/commom/ReviewComment.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/business/components/track/review/commom/ReviewComment.vue b/frontend/src/business/components/track/review/commom/ReviewComment.vue index c849f11adc..728a19d88d 100644 --- a/frontend/src/business/components/track/review/commom/ReviewComment.vue +++ b/frontend/src/business/components/track/review/commom/ReviewComment.vue @@ -18,8 +18,8 @@ type="textarea" :placeholder="$t('test_track.comment.send_comment')" v-model="textarea" - maxlength="60" - show-word-limit + maxlength="180" + show-word-limt resize="none" :autosize="{ minRows: 4, maxRows: 4}" @keyup.ctrl.enter.native="sendComment" From a04e13cb8b9b14d361dff98f258c7d950df3eb8a Mon Sep 17 00:00:00 2001 From: wenyann <64353056+wenyann@users.noreply.github.com> Date: Thu, 1 Apr 2021 15:43:27 +0800 Subject: [PATCH 015/129] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AF=84?= =?UTF-8?q?=E5=AE=A1tags=E3=80=81=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92tags)?= =?UTF-8?q?:=20=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=A0=87=E7=AD=BE=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../track/plan/components/TestPlanEdit.vue | 12 ++++++++++-- .../track/review/components/TestCaseReviewEdit.vue | 11 ++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/frontend/src/business/components/track/plan/components/TestPlanEdit.vue b/frontend/src/business/components/track/plan/components/TestPlanEdit.vue index 1773b19e59..995d24e258 100644 --- a/frontend/src/business/components/track/plan/components/TestPlanEdit.vue +++ b/frontend/src/business/components/track/plan/components/TestPlanEdit.vue @@ -8,7 +8,7 @@ @close="close" width="65%"> - + @@ -31,7 +31,7 @@ @@ -134,6 +134,7 @@ export default { components: {TestPlanStatusButton, MsInputTag}, data() { return { + isStepTableAlive: true, dialogFormVisible: false, form: { name: '', @@ -159,6 +160,10 @@ export default { }; }, methods: { + reload() { + this.isStepTableAlive = false; + this.$nextTick(() => (this.isStepTableAlive = true)); + }, openTestPlanEditDialog(testPlan) { this.resetForm(); this.setPrincipalOptions(); @@ -169,9 +174,12 @@ export default { let tmp = {}; Object.assign(tmp, testPlan); Object.assign(this.form, tmp); + } else { + this.form.tags = [] } listenGoBack(this.close); this.dialogFormVisible = true; + this.reload() }, testPlanInfo() { this.$refs['planFrom'].validate((valid) => { diff --git a/frontend/src/business/components/track/review/components/TestCaseReviewEdit.vue b/frontend/src/business/components/track/review/components/TestCaseReviewEdit.vue index bd18176244..9649021f33 100644 --- a/frontend/src/business/components/track/review/components/TestCaseReviewEdit.vue +++ b/frontend/src/business/components/track/review/components/TestCaseReviewEdit.vue @@ -7,7 +7,8 @@ :visible.sync="dialogFormVisible" @close="close" v-loading="result.loading" - width="65%"> + width="65%" + v-if="isStepTableAlive"> @@ -109,6 +110,7 @@ export default { components: {MsInputTag, TestPlanStatusButton}, data() { return { + isStepTableAlive: true, dialogFormVisible: false, result: {}, form: { @@ -137,6 +139,10 @@ export default { }; }, methods: { + reload() { + this.isStepTableAlive = false; + this.$nextTick(() => (this.isStepTableAlive = true)); + }, openCaseReviewEditDialog(caseReview) { this.resetForm(); this.setReviewerOptions(); @@ -148,9 +154,12 @@ export default { Object.assign(tmp, caseReview); Object.assign(this.form, tmp); this.dbProjectIds = JSON.parse(JSON.stringify(this.form.projectIds)); + } else { + this.form.tags = [] } listenGoBack(this.close); this.dialogFormVisible = true; + this.reload() }, reviewInfo() { From b503122a8a7ad2352aa631c10b2d6ed28bc58400 Mon Sep 17 00:00:00 2001 From: wenyann <64353056+wenyann@users.noreply.github.com> Date: Thu, 1 Apr 2021 15:54:10 +0800 Subject: [PATCH 016/129] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AF=84?= =?UTF-8?q?=E5=AE=A1tags=E3=80=81=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92tags)?= =?UTF-8?q?:=20=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=A0=87=E7=AD=BE=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/track/plan/components/TestPlanEdit.vue | 4 ++-- .../components/track/review/components/TestCaseReviewEdit.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/business/components/track/plan/components/TestPlanEdit.vue b/frontend/src/business/components/track/plan/components/TestPlanEdit.vue index 995d24e258..1c4d6557e9 100644 --- a/frontend/src/business/components/track/plan/components/TestPlanEdit.vue +++ b/frontend/src/business/components/track/plan/components/TestPlanEdit.vue @@ -175,11 +175,11 @@ export default { Object.assign(tmp, testPlan); Object.assign(this.form, tmp); } else { - this.form.tags = [] + this.form.tags = []; } listenGoBack(this.close); this.dialogFormVisible = true; - this.reload() + this.reload(); }, testPlanInfo() { this.$refs['planFrom'].validate((valid) => { diff --git a/frontend/src/business/components/track/review/components/TestCaseReviewEdit.vue b/frontend/src/business/components/track/review/components/TestCaseReviewEdit.vue index 9649021f33..283d4b2263 100644 --- a/frontend/src/business/components/track/review/components/TestCaseReviewEdit.vue +++ b/frontend/src/business/components/track/review/components/TestCaseReviewEdit.vue @@ -155,11 +155,11 @@ export default { Object.assign(this.form, tmp); this.dbProjectIds = JSON.parse(JSON.stringify(this.form.projectIds)); } else { - this.form.tags = [] + this.form.tags = []; } listenGoBack(this.close); this.dialogFormVisible = true; - this.reload() + this.reload(); }, reviewInfo() { From 5750f3061f90e39be66e035a51d3725154446b7c Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 1 Apr 2021 14:35:45 +0800 Subject: [PATCH 017/129] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96):=20=E5=9C=BA=E6=99=AF=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=EF=BC=8C=E6=89=A7=E8=A1=8C=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=8F=98=E6=9B=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/api/dto/definition/request/MsScenario.java | 1 + .../metersphere/base/mapper/ext/ExtApiScenarioReportMapper.xml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java index 384a5cd190..6267b7ee35 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java @@ -88,6 +88,7 @@ public class MsScenario extends MsTestElement { ApiScenarioWithBLOBs scenario = apiAutomationService.getApiScenario(this.getId()); if (scenario != null && StringUtils.isNotEmpty(scenario.getScenarioDefinition())) { JSONObject element = JSON.parseObject(scenario.getScenarioDefinition()); + this.setName(scenario.getName()); hashTree = mapper.readValue(element.getString("hashTree"), new TypeReference>() { }); // 场景变量 diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportMapper.xml index 93463a6929..c07f7d4c0f 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportMapper.xml @@ -100,9 +100,10 @@