refactor(测试跟踪): 取消左侧模块树8层限制

--story=1012494 --user=宋昌昌 #25502 取消模块树8层限制 https://www.tapd.cn/55049933/s/1397706
This commit is contained in:
song-cc-rock 2023-07-26 12:01:57 +08:00 committed by 刘瑞斌
parent 015596d07b
commit d531082510
7 changed files with 9 additions and 49 deletions

View File

@ -246,10 +246,6 @@ public class ApiModuleService extends NodeTreeService<ApiModuleDTO> {
} }
private void validateNode(ApiModule node) { private void validateNode(ApiModule node) {
if (node.getLevel() > TestCaseConstants.MAX_NODE_DEPTH) {
MSException.throwException(Translator.get("test_case_node_level_tip")
+ TestCaseConstants.MAX_NODE_DEPTH + Translator.get("test_case_node_level"));
}
checkApiModuleExist(node); checkApiModuleExist(node);
} }

View File

@ -208,10 +208,6 @@ public class ApiScenarioModuleService extends NodeTreeService<ApiScenarioModuleD
} }
private void validateNode(ApiScenarioModule node) { private void validateNode(ApiScenarioModule node) {
if (node.getLevel() > TestCaseConstants.MAX_NODE_DEPTH) {
MSException.throwException(Translator.get("test_case_node_level_tip")
+ TestCaseConstants.MAX_NODE_DEPTH + Translator.get("test_case_node_level"));
}
checkApiScenarioModuleExist(node); checkApiScenarioModuleExist(node);
} }

View File

@ -234,21 +234,15 @@ export default {
add(param) { add(param) {
param.projectId = this.projectId; param.projectId = this.projectId;
param.protocol = this.condition.protocol; param.protocol = this.condition.protocol;
if (param && param.level >= 9) { addScenarioModule(param).then(
this.list(); () => {
this.$error(this.$t('commons.warning_module_add')); this.$success(this.$t('commons.save_success'));
return; this.list();
} else { },
addScenarioModule(param).then( (error) => {
() => { this.list();
this.$success(this.$t('commons.save_success')); }
this.list(); );
},
(error) => {
this.list();
}
);
}
}, },
remove(nodeIds) { remove(nodeIds) {
delScenarioModule(nodeIds).then( delScenarioModule(nodeIds).then(

View File

@ -460,13 +460,6 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener<Map<Integ
//校验所属模块" //校验所属模块"
if (nodePath != null) { if (nodePath != null) {
String[] nodes = nodePath.split("/"); String[] nodes = nodePath.split("/");
//校验模块深度
if (nodes.length > TestCaseConstants.MAX_NODE_DEPTH + 1) {
stringBuilder.append(Translator.get("test_case_node_level_tip"))
.append(TestCaseConstants.MAX_NODE_DEPTH)
.append(Translator.get("test_case_node_level"))
.append("; ");
}
//模块名不能为空 //模块名不能为空
for (int i = 0; i < nodes.length; i++) { for (int i = 0; i < nodes.length; i++) {
if (i != 0 && StringUtils.equals(nodes[i].trim(), StringUtils.EMPTY)) { if (i != 0 && StringUtils.equals(nodes[i].trim(), StringUtils.EMPTY)) {

View File

@ -100,10 +100,6 @@ public class TestCaseNodeService extends NodeTreeService<TestCaseNodeDTO> {
} }
private void validateNode(TestCaseNode node) { private void validateNode(TestCaseNode node) {
if (node.getLevel() > TestCaseConstants.MAX_NODE_DEPTH) {
MSException.throwException(Translator.get("test_case_node_level_tip")
+ TestCaseConstants.MAX_NODE_DEPTH + Translator.get("test_case_node_level"));
}
this.checkTestCaseNodeExist(node); this.checkTestCaseNodeExist(node);
} }

View File

@ -115,10 +115,6 @@ public class XmindCaseParser {
public void validate() { public void validate() {
nodePaths.forEach(nodePath -> { nodePaths.forEach(nodePath -> {
String[] nodes = nodePath.split("/"); String[] nodes = nodePath.split("/");
if (nodes.length > TestCaseConstants.MAX_NODE_DEPTH + 1) {
process.add(Translator.get("test_case_node_level_tip") +
TestCaseConstants.MAX_NODE_DEPTH + Translator.get("test_case_node_level"), nodePath);
}
String path = StringUtils.EMPTY; String path = StringUtils.EMPTY;
for (int i = 0; i < nodes.length; i++) { for (int i = 0; i < nodes.length; i++) {
if (i != 0 && StringUtils.equals(nodes[i].trim(), StringUtils.EMPTY)) { if (i != 0 && StringUtils.equals(nodes[i].trim(), StringUtils.EMPTY)) {
@ -161,14 +157,6 @@ public class XmindCaseParser {
if (!StringUtils.isEmpty(nodePath)) { if (!StringUtils.isEmpty(nodePath)) {
String[] nodes = nodePath.split("/"); String[] nodes = nodePath.split("/");
if (nodes.length > TestCaseConstants.MAX_NODE_DEPTH + 1) {
validatePass = false;
process.add(Translator.get("test_case_node_level_tip") +
TestCaseConstants.MAX_NODE_DEPTH + Translator.get("test_case_node_level"), nodePath);
if (!errorPath.contains(nodePath)) {
errorPath.add(nodePath);
}
}
for (int i = 0; i < nodes.length; i++) { for (int i = 0; i < nodes.length; i++) {
if (i != 0 && StringUtils.equals(nodes[i].trim(), StringUtils.EMPTY)) { if (i != 0 && StringUtils.equals(nodes[i].trim(), StringUtils.EMPTY)) {
validatePass = false; validatePass = false;

View File

@ -509,9 +509,6 @@ export default {
this.saveModuleNodeMap.set(module.id, node); this.saveModuleNodeMap.set(module.id, node);
if (module.level > 8) {
this.throwError(this.$t('commons.module_deep_limit'));
}
if (module.name.trim().length > 100) { if (module.name.trim().length > 100) {
this.throwError( this.$t('test_track.module.name') + this.$t('test_track.length_less_than') + 100); this.throwError( this.$t('test_track.module.name') + this.$t('test_track.length_less_than') + 100);
} }