From 153bff333b96449921279f8ef4c2804e0948d553 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 22 Oct 2021 13:47:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A4=84=E7=90=86=E5=9B=9E=E6=94=B6?= =?UTF-8?q?=E7=AB=99=E7=9A=84=E7=94=A8=E4=BE=8B=E7=94=9F=E6=88=90=E5=85=B3?= =?UTF-8?q?=E7=B3=BB=E5=9B=BE=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/dto/RelationshipGraphData.java | 1 + .../track/controller/TestCaseController.java | 2 +- .../track/service/TestCaseNodeService.java | 2 +- .../track/service/TestCaseService.java | 15 +++++++-------- backend/src/main/java/io/metersphere/xpack | 2 +- .../case/components/TestCaseRelationshipList.vue | 14 ++++++++------ .../business/components/track/issue/IssueList.vue | 3 +++ 7 files changed, 22 insertions(+), 17 deletions(-) diff --git a/backend/src/main/java/io/metersphere/dto/RelationshipGraphData.java b/backend/src/main/java/io/metersphere/dto/RelationshipGraphData.java index 53c4d4f98d..a3185b7720 100644 --- a/backend/src/main/java/io/metersphere/dto/RelationshipGraphData.java +++ b/backend/src/main/java/io/metersphere/dto/RelationshipGraphData.java @@ -29,6 +29,7 @@ public class RelationshipGraphData { private Integer category; // 分组 private Integer x; private Integer y; + private Boolean visited = false; } @Getter diff --git a/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java b/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java index 0ce1b97481..35fdad187a 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java @@ -302,7 +302,7 @@ public class TestCaseController { @SendNotice(taskType = NoticeConstants.TaskType.TRACK_TEST_CASE_TASK, target = "#targetClass.findByBatchRequest(#request)", targetClass = TestCaseService.class, event = NoticeConstants.Event.DELETE, mailTemplate = "track/TestCaseDelete", subject = "测试用例通知") public void deleteToGcBatch(@RequestBody TestCaseBatchRequest request) { - testCaseService.deleteToGcBatch(request); + testCaseService.deleteToGcBatch(request.getIds()); } @PostMapping("/reduction") diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseNodeService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseNodeService.java index 3dbc331bcf..0e13bd0017 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseNodeService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseNodeService.java @@ -259,7 +259,7 @@ public class TestCaseNodeService extends NodeTreeService { List testCaseIdList = this.selectCaseIdByNodeIds(nodeIds); TestCaseBatchRequest request = new TestCaseBatchRequest(); request.setIds(testCaseIdList); - testCaseService.deleteToGcBatch(request); + testCaseService.deleteToGcBatch(request.getIds()); TestCaseNodeExample testCaseNodeExample = new TestCaseNodeExample(); testCaseNodeExample.createCriteria().andIdIn(nodeIds); diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index 225bc147aa..45e565aa1a 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -1477,11 +1477,7 @@ public class TestCaseService { }); } List ids = request.getIds(); - if (CollectionUtils.isNotEmpty(ids)) { - TestCaseBatchRequest deleteRequest = new TestCaseBatchRequest(); - deleteRequest.setIds(ids); - deleteTestCaseBath(deleteRequest); - } + deleteToGcBatch(ids); } private void changeOrder(TestCaseMinderEditRequest.TestCaseMinderEditItem item, String projectId) { @@ -1823,9 +1819,9 @@ public class TestCaseService { } } - public void deleteToGcBatch(TestCaseBatchRequest request) { - if (CollectionUtils.isNotEmpty(request.getIds())) { - for (String id : request.getIds()) { + public void deleteToGcBatch(List ids) { + if (CollectionUtils.isNotEmpty(ids)) { + for (String id : ids) { this.deleteTestCaseToGc(id); } } @@ -1987,6 +1983,9 @@ public class TestCaseService { } else { testCase = caseMap.get(relationshipEdge.getSourceId()); } + if (testCase == null) { + continue; // 用例可能在回收站 + } relationshipEdgeDTO.setTargetName(testCase.getName()); relationshipEdgeDTO.setCreator(testCase.getCreateUser()); relationshipEdgeDTO.setTargetNum(testCase.getNum()); diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index a86e39275a..a04a44ab83 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit a86e39275aae2a3e2e8aae705da5a4dddbd0089d +Subproject commit a04a44ab83630eb73abeb0c22ff5e26833a3aa2f diff --git a/frontend/src/business/components/track/case/components/TestCaseRelationshipList.vue b/frontend/src/business/components/track/case/components/TestCaseRelationshipList.vue index 4cefd541a2..7e7446e8e9 100644 --- a/frontend/src/business/components/track/case/components/TestCaseRelationshipList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseRelationshipList.vue @@ -112,13 +112,15 @@ export default { computed: { isCustomNum() { let template = this.$store.state.testCaseTemplate; - template.customFields.forEach(item => { - if (item.name === '用例状态') { - for (let i = 0; i < item.options.length; i++) { - this.statusMap.set(item.options[i].value, item.options[i].text); + if (template && template.customFields) { + template.customFields.forEach(item => { + if (item.name === '用例状态') { + for (let i = 0; i < item.options.length; i++) { + this.statusMap.set(item.options[i].value, item.options[i].text); + } } - } - }); + }); + } return this.$store.state.currentProjectIsCustomNum; }, }, diff --git a/frontend/src/business/components/track/issue/IssueList.vue b/frontend/src/business/components/track/issue/IssueList.vue index 5369aafd65..f2624ae7ec 100644 --- a/frontend/src/business/components/track/issue/IssueList.vue +++ b/frontend/src/business/components/track/issue/IssueList.vue @@ -327,6 +327,9 @@ export default { }); }, btnDisable(row) { + if (this.issueTemplate.platform == "metersphere" && row.platform == 'Local') { + return false; + } if (this.issueTemplate.platform !== row.platform) { return true; }