fix: 处理回收站的用例生成关系图的情况

This commit is contained in:
chenjianxing 2021-10-22 13:47:51 +08:00 committed by jianxing
parent 51210f25d1
commit 153bff333b
7 changed files with 22 additions and 17 deletions

View File

@ -29,6 +29,7 @@ public class RelationshipGraphData {
private Integer category; // 分组
private Integer x;
private Integer y;
private Boolean visited = false;
}
@Getter

View File

@ -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")

View File

@ -259,7 +259,7 @@ public class TestCaseNodeService extends NodeTreeService<TestCaseNodeDTO> {
List<String> 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);

View File

@ -1477,11 +1477,7 @@ public class TestCaseService {
});
}
List<String> 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<String> 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());

@ -1 +1 @@
Subproject commit a86e39275aae2a3e2e8aae705da5a4dddbd0089d
Subproject commit a04a44ab83630eb73abeb0c22ff5e26833a3aa2f

View File

@ -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;
},
},

View File

@ -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;
}