fix(测试跟踪): 修复功能用例添加八层级node可以成功的缺陷

--bug=1024005 --user=王孝刚 【测试跟踪】功能用例-创建模块层级大于8层可创建成功
https://www.tapd.cn/55049933/s/1345870
This commit is contained in:
wxg0103 2023-03-07 10:38:46 +08:00 committed by wxg0103
parent 8a263ce09d
commit 202c6b5c9d
2 changed files with 8 additions and 6 deletions

View File

@ -18,6 +18,8 @@ import io.metersphere.commons.utils.CommonBeanFactory;
import io.metersphere.commons.utils.JSON;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.dto.NodeNumDTO;
import io.metersphere.dto.TestCaseDTO;
import io.metersphere.dto.TestCaseNodeDTO;
import io.metersphere.dto.TestPlanCaseDTO;
import io.metersphere.exception.ExcelException;
import io.metersphere.i18n.Translator;
@ -25,13 +27,12 @@ import io.metersphere.log.utils.ReflexObjectUtil;
import io.metersphere.log.vo.DetailColumn;
import io.metersphere.log.vo.OperatingLogDetails;
import io.metersphere.log.vo.api.ModuleReference;
import io.metersphere.dto.TestCaseDTO;
import io.metersphere.dto.TestCaseNodeDTO;
import io.metersphere.plan.request.function.QueryTestPlanCaseRequest;
import io.metersphere.plan.service.TestPlanProjectService;
import io.metersphere.plan.service.TestPlanService;
import io.metersphere.request.testcase.*;
import io.metersphere.plan.request.function.QueryTestPlanCaseRequest;
import io.metersphere.request.testreview.QueryCaseReviewRequest;
import jakarta.annotation.Resource;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession;
@ -41,7 +42,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import jakarta.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
@ -96,7 +96,7 @@ public class TestCaseNodeService extends NodeTreeService<TestCaseNodeDTO> {
private void validateNode(TestCaseNode node) {
if (node.getLevel() > TestCaseConstants.MAX_NODE_DEPTH) {
throw new RuntimeException(Translator.get("test_case_node_level_tip")
MSException.throwException(Translator.get("test_case_node_level_tip")
+ TestCaseConstants.MAX_NODE_DEPTH + Translator.get("test_case_node_level"));
}
this.checkTestCaseNodeExist(node);

View File

@ -268,7 +268,9 @@ export default {
.then(() => {
this.$success(this.$t("test_track.module.success_create"), false);
this.list();
});
}).catch(() => {
this.list();
});
},
handleImport() {
if (!this.projectId) {