Date: Thu, 31 Dec 2020 15:41:07 +0800
Subject: [PATCH 04/16] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?=
=?UTF-8?q?=E5=8C=96):=20=E4=BF=AE=E5=A4=8Dsql=E7=B1=BB=E5=9E=8B=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/api/automation/scenario/ApiComponent.vue | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/frontend/src/business/components/api/automation/scenario/ApiComponent.vue b/frontend/src/business/components/api/automation/scenario/ApiComponent.vue
index afd426524b..1763c431fa 100644
--- a/frontend/src/business/components/api/automation/scenario/ApiComponent.vue
+++ b/frontend/src/business/components/api/automation/scenario/ApiComponent.vue
@@ -56,10 +56,10 @@
{{$t('api_test.definition.request.req_param')}}
-
-
-
-
+
+
+
+
{{$t('api_test.definition.request.res_param')}}
From 6dd2f72c0548c72d3ba5a8568e4ec8397ed822be Mon Sep 17 00:00:00 2001
From: fit2-zhao
Date: Thu, 31 Dec 2020 16:12:22 +0800
Subject: [PATCH 05/16] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?=
=?UTF-8?q?=E5=8C=96):=20=E6=8E=A5=E5=8F=A3=E7=94=A8=E4=BE=8B=E6=89=A7?=
=?UTF-8?q?=E8=A1=8C=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../api/service/ApiTestCaseService.java | 27 ++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java
index 0f9b5cc1cd..03f5b37b56 100644
--- a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java
+++ b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java
@@ -8,6 +8,9 @@ import io.metersphere.api.dto.ApiCaseBatchRequest;
import io.metersphere.api.dto.datacount.ApiDataCountResult;
import io.metersphere.api.dto.definition.*;
import io.metersphere.api.dto.definition.request.MsTestElement;
+import io.metersphere.api.dto.definition.request.MsTestPlan;
+import io.metersphere.api.dto.definition.request.MsThreadGroup;
+import io.metersphere.api.dto.definition.request.ParameterConfig;
import io.metersphere.api.jmeter.JMeterService;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.ApiDefinitionMapper;
@@ -30,6 +33,7 @@ import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.jorphan.collections.HashTree;
+import org.apache.jorphan.collections.ListedHashTree;
import org.aspectj.util.FileUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -400,11 +404,28 @@ public class ApiTestCaseService {
try {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- MsTestElement elements = mapper.readValue(testCaseWithBLOBs.getRequest(), new TypeReference() { });
- HashTree hashTree = elements.generateHashTree();
+ MsTestElement element = mapper.readValue(testCaseWithBLOBs.getRequest(), new TypeReference() {
+ });
+ // 测试计划
+ MsTestPlan testPlan = new MsTestPlan();
+ testPlan.setHashTree(new LinkedList<>());
+ HashTree jmeterHashTree = new ListedHashTree();
+
+ // 线程组
+ MsThreadGroup group = new MsThreadGroup();
+ group.setLabel(testCaseWithBLOBs.getName());
+ group.setName(testCaseWithBLOBs.getId());
+
+ LinkedList hashTrees = new LinkedList<>();
+ hashTrees.add(element);
+ group.setHashTree(hashTrees);
+ testPlan.getHashTree().add(group);
+
+ testPlan.toHashTree(jmeterHashTree, testPlan.getHashTree(), new ParameterConfig());
+
String runMode = ApiRunMode.DELIMIT.name();
// 调用执行方法
- jMeterService.runDefinition(request.getReportId(), hashTree, request.getReportId(), runMode);
+ jMeterService.runDefinition(request.getReportId(), jmeterHashTree, request.getReportId(), runMode);
} catch (Exception ex) {
LogUtil.error(ex.getMessage());
From 0c6468946fb40cdf67125efd656c6d7f01411914 Mon Sep 17 00:00:00 2001
From: fit2-zhao
Date: Thu, 31 Dec 2020 16:15:16 +0800
Subject: [PATCH 06/16] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89)?=
=?UTF-8?q?:=20=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=8F=A3=E5=8F=82=E6=95=B0?=
=?UTF-8?q?=E7=B1=BB=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../io/metersphere/api/controller/ApiTestCaseController.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiTestCaseController.java b/backend/src/main/java/io/metersphere/api/controller/ApiTestCaseController.java
index c237e2349a..07f92a927d 100644
--- a/backend/src/main/java/io/metersphere/api/controller/ApiTestCaseController.java
+++ b/backend/src/main/java/io/metersphere/api/controller/ApiTestCaseController.java
@@ -100,7 +100,7 @@ public class ApiTestCaseController {
}
@PostMapping(value = "/jenkins/run")
- public String jenkinsRun(@RequestPart("request") RunCaseRequest request) {
+ public String jenkinsRun(@RequestBody RunCaseRequest request) {
return apiTestCaseService.run(request);
}
}
\ No newline at end of file
From ec8265b4be68fb49c5ca68065fa474ea8aa096e4 Mon Sep 17 00:00:00 2001
From: "Captain.B"
Date: Thu, 31 Dec 2020 16:35:07 +0800
Subject: [PATCH 07/16] chore: Sync
---
backend/src/main/java/io/metersphere/xpack | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack
index f27d1609d7..068127ce59 160000
--- a/backend/src/main/java/io/metersphere/xpack
+++ b/backend/src/main/java/io/metersphere/xpack
@@ -1 +1 @@
-Subproject commit f27d1609d77f7d6c988d37d709466e844d350e17
+Subproject commit 068127ce59ea8b016434ed52a9de4a7a4b13bdb4
From c3f0b8d96ff980f368fd01d9d2c7e34ec1f76e9f Mon Sep 17 00:00:00 2001
From: "Captain.B"
Date: Thu, 31 Dec 2020 16:35:37 +0800
Subject: [PATCH 08/16] chore: Sync
---
backend/src/main/java/io/metersphere/xpack | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack
index f27d1609d7..068127ce59 160000
--- a/backend/src/main/java/io/metersphere/xpack
+++ b/backend/src/main/java/io/metersphere/xpack
@@ -1 +1 @@
-Subproject commit f27d1609d77f7d6c988d37d709466e844d350e17
+Subproject commit 068127ce59ea8b016434ed52a9de4a7a4b13bdb4
From 12436d51b5889c47c871bb843be82faf5a0aab43 Mon Sep 17 00:00:00 2001
From: chenjianxing
Date: Thu, 31 Dec 2020 16:40:02 +0800
Subject: [PATCH 09/16] =?UTF-8?q?refator:=20=E6=A0=B7=E5=BC=8F=E4=BC=98?=
=?UTF-8?q?=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../definition/components/list/ApiList.vue | 41 ++++++++++++++++---
1 file changed, 35 insertions(+), 6 deletions(-)
diff --git a/frontend/src/business/components/api/definition/components/list/ApiList.vue b/frontend/src/business/components/api/definition/components/list/ApiList.vue
index b9d635ff80..433b6f231d 100644
--- a/frontend/src/business/components/api/definition/components/list/ApiList.vue
+++ b/frontend/src/business/components/api/definition/components/list/ApiList.vue
@@ -9,14 +9,15 @@
-
-
-
-
-
+
+
+
+
+
+
@@ -470,4 +471,32 @@
margin-right: 20px;
}
+ .api-list >>> th:first-child {
+ /*border: 1px solid #DCDFE6;*/
+ /*border-right: 0px;*/
+ /*border-top-left-radius:5px;*/
+ /*border-bottom-left-radius:5px;*/
+ /*width: 20px;*/
+
+ }
+
+ .api-list >>> th:nth-child(2) {
+ /*border: 1px solid #DCDFE6;*/
+ /*border-left: 0px;*/
+ /*border-top-right-radius:5px;*/
+ /*border-bottom-right-radius:5px;*/
+ }
+
+ .api-list >>> th:first-child>.cell {
+ padding: 5px;
+ width: 30px;
+ }
+ .api-list >>> th:nth-child(2)>.cell {
+ /*background-color: black;*/
+ }
+
+ .api-list >>> .el-dropdown {
+ float: left;
+ }
+
From 7270c24eb2b6af28ba5704e4761ebce0185683a1 Mon Sep 17 00:00:00 2001
From: chenjianxing
Date: Mon, 4 Jan 2021 11:40:12 +0800
Subject: [PATCH 10/16] =?UTF-8?q?fix:=20swagger=20=E5=AF=BC=E5=85=A5?=
=?UTF-8?q?=E6=A0=88=E6=BA=A2=E5=87=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../main/java/io/metersphere/api/parse/Swagger2Parser.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/backend/src/main/java/io/metersphere/api/parse/Swagger2Parser.java b/backend/src/main/java/io/metersphere/api/parse/Swagger2Parser.java
index d1a312941b..8d78614dad 100644
--- a/backend/src/main/java/io/metersphere/api/parse/Swagger2Parser.java
+++ b/backend/src/main/java/io/metersphere/api/parse/Swagger2Parser.java
@@ -275,6 +275,11 @@ public class Swagger2Parser extends ApiImportAbstractParser {
} else if (value instanceof RefProperty) {
RefProperty refProperty = (RefProperty) value;
String simpleRef = refProperty.getSimpleRef();
+ if (refSet.contains(simpleRef)) {
+ //避免嵌套死循环
+ jsonObject.put(key, new JSONArray());
+ return;
+ }
refSet.add(simpleRef);
Model model = definitions.get(simpleRef);
jsonObject.put(key, getBodyParameters(model.getProperties(), refSet));
From 170c358d72756d9e4210a942c1d607f2054bfd90 Mon Sep 17 00:00:00 2001
From: chenjianxing
Date: Mon, 4 Jan 2021 11:51:56 +0800
Subject: [PATCH 11/16] =?UTF-8?q?refactor:=20=E5=88=86=E9=A1=B5=E6=94=B9?=
=?UTF-8?q?=E4=B8=BA10=E6=9D=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/api/automation/report/ApiReportList.vue | 2 +-
frontend/src/business/components/api/report/ApiReportList.vue | 2 +-
frontend/src/business/components/api/test/ApiReportDialog.vue | 2 +-
frontend/src/business/components/api/test/ApiTestList.vue | 2 +-
.../components/api/test/components/ApiScenarioSelect.vue | 2 +-
.../components/performance/report/PerformanceTestReport.vue | 2 +-
.../components/performance/test/PerformanceTestList.vue | 2 +-
.../components/settings/organization/OrganizationMember.vue | 2 +-
.../settings/organization/OrganizationWorkspace.vue | 4 ++--
.../src/business/components/settings/project/MsProject.vue | 2 +-
.../src/business/components/settings/system/Organization.vue | 4 ++--
.../business/components/settings/system/SystemWorkspace.vue | 4 ++--
.../business/components/settings/system/TestResourcePool.vue | 2 +-
frontend/src/business/components/settings/system/User.vue | 2 +-
.../components/settings/workspace/WorkspaceMember.vue | 2 +-
frontend/src/business/components/track/case/TestCase.vue | 3 ---
.../components/track/case/components/SwitchProject.vue | 2 +-
17 files changed, 19 insertions(+), 22 deletions(-)
diff --git a/frontend/src/business/components/api/automation/report/ApiReportList.vue b/frontend/src/business/components/api/automation/report/ApiReportList.vue
index fb9ee71796..c9c2923042 100644
--- a/frontend/src/business/components/api/automation/report/ApiReportList.vue
+++ b/frontend/src/business/components/api/automation/report/ApiReportList.vue
@@ -108,7 +108,7 @@ export default {
tableData: [],
multipleSelection: [],
currentPage: 1,
- pageSize: 5,
+ pageSize: 10,
total: 0,
loading: false,
currentProjectId: "",
diff --git a/frontend/src/business/components/api/report/ApiReportList.vue b/frontend/src/business/components/api/report/ApiReportList.vue
index 5ca3ae8aa8..14636660fd 100644
--- a/frontend/src/business/components/api/report/ApiReportList.vue
+++ b/frontend/src/business/components/api/report/ApiReportList.vue
@@ -85,7 +85,7 @@ export default {
tableData: [],
multipleSelection: [],
currentPage: 1,
- pageSize: 5,
+ pageSize: 10,
total: 0,
loading: false,
statusFilters: [
diff --git a/frontend/src/business/components/api/test/ApiReportDialog.vue b/frontend/src/business/components/api/test/ApiReportDialog.vue
index 4b6fcda12a..cf6cc09305 100644
--- a/frontend/src/business/components/api/test/ApiReportDialog.vue
+++ b/frontend/src/business/components/api/test/ApiReportDialog.vue
@@ -45,7 +45,7 @@ export default {
tableData: [],
loading: false,
currentPage: 1,
- pageSize: 5,
+ pageSize: 10,
total: 0,
}
},
diff --git a/frontend/src/business/components/api/test/ApiTestList.vue b/frontend/src/business/components/api/test/ApiTestList.vue
index 8c2c7903f6..35785fddbc 100644
--- a/frontend/src/business/components/api/test/ApiTestList.vue
+++ b/frontend/src/business/components/api/test/ApiTestList.vue
@@ -90,7 +90,7 @@
tableData: [],
multipleSelection: [],
currentPage: 1,
- pageSize: 5,
+ pageSize: 10,
total: 0,
loading: false,
selectIds: new Set(),
diff --git a/frontend/src/business/components/api/test/components/ApiScenarioSelect.vue b/frontend/src/business/components/api/test/components/ApiScenarioSelect.vue
index 9397384d6d..96ac4b329e 100644
--- a/frontend/src/business/components/api/test/components/ApiScenarioSelect.vue
+++ b/frontend/src/business/components/api/test/components/ApiScenarioSelect.vue
@@ -63,7 +63,7 @@ export default {
},
tableData: [],
currentPage: 1,
- pageSize: 5,
+ pageSize: 10,
total: 0,
selection: false,
environmentMap: new Map()
diff --git a/frontend/src/business/components/performance/report/PerformanceTestReport.vue b/frontend/src/business/components/performance/report/PerformanceTestReport.vue
index ec247df46b..07566240e3 100644
--- a/frontend/src/business/components/performance/report/PerformanceTestReport.vue
+++ b/frontend/src/business/components/performance/report/PerformanceTestReport.vue
@@ -128,7 +128,7 @@ export default {
tableData: [],
multipleSelection: [],
currentPage: 1,
- pageSize: 5,
+ pageSize: 10,
total: 0,
loading: false,
testId: null,
diff --git a/frontend/src/business/components/performance/test/PerformanceTestList.vue b/frontend/src/business/components/performance/test/PerformanceTestList.vue
index 24246520d2..b309eee0a2 100644
--- a/frontend/src/business/components/performance/test/PerformanceTestList.vue
+++ b/frontend/src/business/components/performance/test/PerformanceTestList.vue
@@ -108,7 +108,7 @@ export default {
tableData: [],
multipleSelection: [],
currentPage: 1,
- pageSize: 5,
+ pageSize: 10,
total: 0,
loading: false,
testId: null,
diff --git a/frontend/src/business/components/settings/organization/OrganizationMember.vue b/frontend/src/business/components/settings/organization/OrganizationMember.vue
index dea048bed0..cb5cbed546 100644
--- a/frontend/src/business/components/settings/organization/OrganizationMember.vue
+++ b/frontend/src/business/components/settings/organization/OrganizationMember.vue
@@ -143,7 +143,7 @@
},
multipleSelection: [],
currentPage: 1,
- pageSize: 5,
+ pageSize: 10,
total: 0,
options: [],
loading: false,
diff --git a/frontend/src/business/components/settings/organization/OrganizationWorkspace.vue b/frontend/src/business/components/settings/organization/OrganizationWorkspace.vue
index 79abac6e22..44dfbfb158 100644
--- a/frontend/src/business/components/settings/organization/OrganizationWorkspace.vue
+++ b/frontend/src/business/components/settings/organization/OrganizationWorkspace.vue
@@ -458,10 +458,10 @@
items: [],
userList: [],
currentPage: 1,
- pageSize: 5,
+ pageSize: 10,
total: 0,
dialogCurrentPage: 1,
- dialogPageSize: 5,
+ dialogPageSize: 10,
dialogTotal: 0,
memberLineData: [],
memberForm: {},
diff --git a/frontend/src/business/components/settings/project/MsProject.vue b/frontend/src/business/components/settings/project/MsProject.vue
index 213a237372..36f71ec385 100644
--- a/frontend/src/business/components/settings/project/MsProject.vue
+++ b/frontend/src/business/components/settings/project/MsProject.vue
@@ -120,7 +120,7 @@ export default {
zentao: false,
form: {},
currentPage: 1,
- pageSize: 5,
+ pageSize: 10,
total: 0,
rules: {
name: [
diff --git a/frontend/src/business/components/settings/system/Organization.vue b/frontend/src/business/components/settings/system/Organization.vue
index 7a7196dd90..888236af0f 100644
--- a/frontend/src/business/components/settings/system/Organization.vue
+++ b/frontend/src/business/components/settings/system/Organization.vue
@@ -218,10 +218,10 @@ export default {
dialogOrgMemberUpdateVisible: false,
multipleSelection: [],
currentPage: 1,
- pageSize: 5,
+ pageSize: 10,
total: 0,
dialogCurrentPage: 1,
- dialogPageSize: 5,
+ dialogPageSize: 10,
dialogTotal: 0,
currentRow: {},
condition: {},
diff --git a/frontend/src/business/components/settings/system/SystemWorkspace.vue b/frontend/src/business/components/settings/system/SystemWorkspace.vue
index b7d58e1b88..e150a6859c 100644
--- a/frontend/src/business/components/settings/system/SystemWorkspace.vue
+++ b/frontend/src/business/components/settings/system/SystemWorkspace.vue
@@ -487,10 +487,10 @@
dialogCondition: {},
items: [],
currentPage: 1,
- pageSize: 5,
+ pageSize: 10,
total: 0,
dialogCurrentPage: 1,
- dialogPageSize: 5,
+ dialogPageSize: 10,
dialogTotal: 0,
memberLineData: [],
memberForm: {},
diff --git a/frontend/src/business/components/settings/system/TestResourcePool.vue b/frontend/src/business/components/settings/system/TestResourcePool.vue
index e9412c8547..958629e220 100644
--- a/frontend/src/business/components/settings/system/TestResourcePool.vue
+++ b/frontend/src/business/components/settings/system/TestResourcePool.vue
@@ -177,7 +177,7 @@ export default {
condition: {},
items: [],
currentPage: 1,
- pageSize: 5,
+ pageSize: 10,
total: 0,
form: {},
requiredRules: [{required: true, message: this.$t('test_resource_pool.fill_the_data'), trigger: 'blur'}],
diff --git a/frontend/src/business/components/settings/system/User.vue b/frontend/src/business/components/settings/system/User.vue
index 402b4413b1..6be9687a2b 100644
--- a/frontend/src/business/components/settings/system/User.vue
+++ b/frontend/src/business/components/settings/system/User.vue
@@ -367,7 +367,7 @@ export default {
multipleSelection: [],
userRole: [],
currentPage: 1,
- pageSize: 5,
+ pageSize: 10,
total: 0,
condition: {},
tableData: [],
diff --git a/frontend/src/business/components/settings/workspace/WorkspaceMember.vue b/frontend/src/business/components/settings/workspace/WorkspaceMember.vue
index db56275b42..7dccbe6ee6 100644
--- a/frontend/src/business/components/settings/workspace/WorkspaceMember.vue
+++ b/frontend/src/business/components/settings/workspace/WorkspaceMember.vue
@@ -133,7 +133,7 @@
},
multipleSelection: [],
currentPage: 1,
- pageSize: 5,
+ pageSize: 10,
total: 0,
}
},
diff --git a/frontend/src/business/components/track/case/TestCase.vue b/frontend/src/business/components/track/case/TestCase.vue
index f2384ccaa3..23020f1f9f 100644
--- a/frontend/src/business/components/track/case/TestCase.vue
+++ b/frontend/src/business/components/track/case/TestCase.vue
@@ -66,9 +66,6 @@ export default {
data() {
return {
result: {},
- currentPage: 1,
- pageSize: 5,
- total: 0,
projects: [],
treeNodes: [],
selectNodeIds: [],
diff --git a/frontend/src/business/components/track/case/components/SwitchProject.vue b/frontend/src/business/components/track/case/components/SwitchProject.vue
index 461316e23c..3695aabdb3 100644
--- a/frontend/src/business/components/track/case/components/SwitchProject.vue
+++ b/frontend/src/business/components/track/case/components/SwitchProject.vue
@@ -62,7 +62,7 @@ export default {
id: '',
condition: {},
currentPage: 1,
- pageSize: 5,
+ pageSize: 10,
total: 0,
url: '',
type: ''
From b9b95d63d82a5095a4173352869a968541202223 Mon Sep 17 00:00:00 2001
From: wenyann <64353056+wenyann@users.noreply.github.com>
Date: Mon, 4 Jan 2021 14:13:11 +0800
Subject: [PATCH 12/16] =?UTF-8?q?feat:=20=E5=88=A0=E9=99=A4=E6=8C=89?=
=?UTF-8?q?=E9=92=AE=E5=A2=9E=E5=8A=A0=E7=A1=AE=E8=AE=A4=E5=BC=B9=E6=A1=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../automation/scenario/EditApiScenario.vue | 19 +++++++++++++------
.../components/case/ApiCaseItem.vue | 14 +++++++++++---
2 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue
index 7339386fa3..0fcd3a79ab 100644
--- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue
+++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue
@@ -623,12 +623,19 @@
this.$refs.tag.open();
},
remove(row, node) {
- const parent = node.parent
- const hashTree = parent.data.hashTree || parent.data;
- const index = hashTree.findIndex(d => d.resourceId != undefined && row.resourceId != undefined && d.resourceId === row.resourceId)
- hashTree.splice(index, 1);
- this.sort();
- this.reload();
+ this.$alert(this.$t('api_test.definition.request.delete_confirm') + ' ' + row.name + " ?", '', {
+ confirmButtonText: this.$t('commons.confirm'),
+ callback: (action) => {
+ if (action === 'confirm') {
+ const parent = node.parent
+ const hashTree = parent.data.hashTree || parent.data;
+ const index = hashTree.findIndex(d => d.resourceId != undefined && row.resourceId != undefined && d.resourceId === row.resourceId)
+ hashTree.splice(index, 1);
+ this.sort();
+ this.reload();
+ }
+ }
+ });
}
,
copyRow(row, node) {
diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue
index 9585e3dee7..7db0d7ff40 100644
--- a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue
+++ b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue
@@ -140,10 +140,18 @@
methods: {
deleteCase(index, row) {
- this.$get('/api/testcase/delete/' + row.id, () => {
- this.$success(this.$t('commons.delete_success'));
- this.$emit('refresh');
+ this.$alert(this.$t('api_test.definition.request.delete_confirm') + ' ' + row.name + " ?", '', {
+ confirmButtonText: this.$t('commons.confirm'),
+ callback: (action) => {
+ if (action === 'confirm') {
+ this.$get('/api/testcase/delete/' + row.id, () => {
+ this.$success(this.$t('commons.delete_success'));
+ this.$emit('refresh');
+ });
+ }
+ }
});
+
},
singleRun(data) {
this.$emit('singleRun', data);
From c507e86f5238b533921c79d169dcc1d26c4984ef Mon Sep 17 00:00:00 2001
From: chenjianxing
Date: Mon, 4 Jan 2021 14:19:59 +0800
Subject: [PATCH 13/16] =?UTF-8?q?fix:=20=E5=85=B3=E8=81=94=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3=E7=94=A8=E4=BE=8B=E5=88=97=E8=A1=A8=E9=87=8D=E5=A4=8D?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mapper/ext/ExtApiDefinitionMapper.xml | 26 +++++++++----------
1 file changed, 13 insertions(+), 13 deletions(-)
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 2ca103606a..fb035d0e3d 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
@@ -297,20 +297,9 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.java
index c60c731415..483dc83f09 100644
--- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.java
+++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.java
@@ -21,4 +21,6 @@ public interface ExtTestPlanScenarioCaseMapper {
List getExecResultByPlanId(String planId);
List getIdsByPlanId(String planId);
+
+ List getNotRelevanceCaseIds(String planId, List relevanceProjectIds);
}
\ No newline at end of file
diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml
index 11767c5e7f..d3add4c1a2 100644
--- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml
+++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml
@@ -92,4 +92,18 @@
where test_plan_id = #{planId}
+
+
\ No newline at end of file
diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanApiCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanApiCaseService.java
index 95eec7639d..fd83651fcf 100644
--- a/backend/src/main/java/io/metersphere/track/service/TestPlanApiCaseService.java
+++ b/backend/src/main/java/io/metersphere/track/service/TestPlanApiCaseService.java
@@ -77,6 +77,9 @@ public class TestPlanApiCaseService {
}
public void deleteApiCaseBath(TestPlanApiCaseBatchRequest request) {
+ if (CollectionUtils.isEmpty(request.getIds())) {
+ return;
+ }
apiDefinitionExecResultService.deleteByResourceIds(request.getIds());
TestPlanApiCaseExample example = new TestPlanApiCaseExample();
example.createCriteria()
@@ -97,4 +100,11 @@ public class TestPlanApiCaseService {
apiCase.setStatus(status);
testPlanApiCaseMapper.updateByPrimaryKeySelective(apiCase);
}
+
+ public void deleteByRelevanceProjectIds(String planId, List relevanceProjectIds) {
+ TestPlanApiCaseBatchRequest request = new TestPlanApiCaseBatchRequest();
+ request.setPlanId(planId);
+ request.setIds(extTestPlanApiCaseMapper.getNotRelevanceCaseIds(planId, relevanceProjectIds));
+ deleteApiCaseBath(request);
+ }
}
diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanScenarioCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanScenarioCaseService.java
index cee39a7677..683fe4cee1 100644
--- a/backend/src/main/java/io/metersphere/track/service/TestPlanScenarioCaseService.java
+++ b/backend/src/main/java/io/metersphere/track/service/TestPlanScenarioCaseService.java
@@ -73,6 +73,9 @@ public class TestPlanScenarioCaseService {
}
public void deleteApiCaseBath(TestPlanApiCaseBatchRequest request) {
+ if (CollectionUtils.isEmpty(request.getIds())) {
+ return;
+ }
TestPlanApiScenarioExample example = new TestPlanApiScenarioExample();
example.createCriteria()
.andIdIn(request.getIds());
@@ -110,4 +113,11 @@ public class TestPlanScenarioCaseService {
request.setIds(ids);
deleteApiCaseBath(request);
}
+
+ public void deleteByRelevanceProjectIds(String planId, List relevanceProjectIds) {
+ TestPlanApiCaseBatchRequest request = new TestPlanApiCaseBatchRequest();
+ request.setIds(extTestPlanScenarioCaseMapper.getNotRelevanceCaseIds(planId, relevanceProjectIds));
+ request.setPlanId(planId);
+ deleteApiCaseBath(request);
+ }
}
diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java
index 72a403bc9b..d3d1959f1b 100644
--- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java
+++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java
@@ -10,7 +10,6 @@ import io.metersphere.api.dto.definition.ApiTestCaseRequest;
import io.metersphere.api.dto.definition.TestPlanApiCaseDTO;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.*;
-import io.metersphere.base.mapper.ext.ExtProjectMapper;
import io.metersphere.base.mapper.ext.ExtTestCaseMapper;
import io.metersphere.base.mapper.ext.ExtTestPlanMapper;
import io.metersphere.base.mapper.ext.ExtTestPlanTestCaseMapper;
@@ -27,7 +26,6 @@ import io.metersphere.notice.service.NoticeSendService;
import io.metersphere.service.SystemParameterService;
import io.metersphere.track.Factory.ReportComponentFactory;
import io.metersphere.track.domain.ReportComponent;
-
import io.metersphere.track.dto.TestCaseReportMetricDTO;
import io.metersphere.track.dto.TestPlanCaseDTO;
import io.metersphere.track.dto.TestPlanDTO;
@@ -69,8 +67,6 @@ public class TestPlanService {
@Resource
TestPlanTestCaseService testPlanTestCaseService;
@Resource
- ExtProjectMapper extProjectMapper;
- @Resource
TestCaseReportMapper testCaseReportMapper;
@Resource
TestPlanProjectMapper testPlanProjectMapper;
@@ -229,6 +225,14 @@ public class TestPlanService {
criteria.andCaseIdNotIn(caseIds);
}
testPlanTestCaseMapper.deleteByExample(testPlanTestCaseExample);
+
+ List relevanceProjectIds = new ArrayList<>();
+ relevanceProjectIds.add(testPlan.getProjectId());
+ if (!CollectionUtils.isEmpty(testPlan.getProjectIds())) {
+ relevanceProjectIds.addAll(testPlan.getProjectIds());
+ }
+ testPlanApiCaseService.deleteByRelevanceProjectIds(testPlan.getId(), relevanceProjectIds);
+ testPlanScenarioCaseService.deleteByRelevanceProjectIds(testPlan.getId(), relevanceProjectIds);
}
}