Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
7ab5fa1987
|
@ -8,6 +8,7 @@ import io.metersphere.base.mapper.TestPlanMapper;
|
|||
import io.metersphere.base.mapper.TestPlanTestCaseMapper;
|
||||
import io.metersphere.base.mapper.ext.ExtTestCaseMapper;
|
||||
import io.metersphere.commons.constants.TestCaseConstants;
|
||||
import io.metersphere.commons.exception.MSException;
|
||||
import io.metersphere.commons.utils.BeanUtils;
|
||||
import io.metersphere.i18n.Translator;
|
||||
import io.metersphere.track.dto.TestCaseDTO;
|
||||
|
@ -125,13 +126,7 @@ public class TestCaseNodeService {
|
|||
testCases.forEach(testCase -> {
|
||||
StringBuilder path = new StringBuilder(testCase.getNodePath());
|
||||
List<String> pathLists = Arrays.asList(path.toString().split("/"));
|
||||
|
||||
if (request.getLevel() <= pathLists.size()) {
|
||||
pathLists.set(request.getLevel(), request.getName());
|
||||
} else {
|
||||
pathLists.add(request.getName());
|
||||
}
|
||||
|
||||
pathLists.set(request.getLevel(), request.getName());
|
||||
path.delete( 0, path.length());
|
||||
for (int i = 1; i < pathLists.size(); i++) {
|
||||
path = path.append("/").append(pathLists.get(i));
|
||||
|
@ -379,7 +374,7 @@ public class TestCaseNodeService {
|
|||
|
||||
public void dragNode(DragNodeRequest request) {
|
||||
|
||||
editNode(request);
|
||||
// editNode(request);
|
||||
|
||||
List<String> nodeIds = request.getNodeIds();
|
||||
|
||||
|
@ -389,7 +384,7 @@ public class TestCaseNodeService {
|
|||
|
||||
List<TestCaseNode> updateNodes = new ArrayList<>();
|
||||
|
||||
buildUpdateTestCase(nodeTree, testCases, updateNodes, "/", 1);
|
||||
buildUpdateTestCase(nodeTree, testCases, updateNodes, "/", null, 1);
|
||||
|
||||
updateNodes = updateNodes.stream()
|
||||
.filter(item -> nodeIds.contains(item.getId()))
|
||||
|
@ -425,13 +420,18 @@ public class TestCaseNodeService {
|
|||
}
|
||||
|
||||
private void buildUpdateTestCase(TestCaseNodeDTO rootNode, List<TestCaseDTO> testCases,
|
||||
List<TestCaseNode> updateNodes, String rootPath, int level) {
|
||||
List<TestCaseNode> updateNodes, String rootPath, String pId, int level) {
|
||||
|
||||
rootPath = rootPath + rootNode.getName();
|
||||
|
||||
if (level > 5) {
|
||||
MSException.throwException(Translator.get("node_deep_limit"));
|
||||
}
|
||||
|
||||
TestCaseNode testCaseNode = new TestCaseNode();
|
||||
testCaseNode.setId(rootNode.getId());
|
||||
testCaseNode.setLevel(level);
|
||||
testCaseNode.setParentId(pId);
|
||||
updateNodes.add(testCaseNode);
|
||||
|
||||
for (TestCaseDTO item : testCases) {
|
||||
|
@ -443,7 +443,7 @@ public class TestCaseNodeService {
|
|||
List<TestCaseNodeDTO> children = rootNode.getChildren();
|
||||
if (children != null && children.size() > 0){
|
||||
for (int i = 0; i < children.size(); i++) {
|
||||
buildUpdateTestCase(children.get(i), testCases, updateNodes, rootPath + '/', level + 1);
|
||||
buildUpdateTestCase(children.get(i), testCases, updateNodes, rootPath + '/', rootNode.getId(), level + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,16 +58,17 @@ before_delete_plan=There is an associated test case under this plan, please unli
|
|||
incorrect_format=Incorrect format
|
||||
test_case_type_validate=must be functional, performance, api
|
||||
test_case_priority_validate=must be P0, P1, P2, P3
|
||||
test_case_method_validate=\ must be manual, auto
|
||||
test_case_method_validate=must be manual, auto
|
||||
test_case_name=Name
|
||||
test_case_type=Type
|
||||
test_case_maintainer=Maintainer
|
||||
test_case_priority=Priority
|
||||
test_case_method=method
|
||||
test_case_prerequisite=Prerequisite
|
||||
test_case_remark=Remark
|
||||
test_case_step_desc=Step description
|
||||
test_case_step_result=Step result
|
||||
test_case_module=module
|
||||
test_case_module=Module
|
||||
test_case=Test case
|
||||
module=Module
|
||||
preconditions_optional=Preconditions optional
|
||||
|
|
|
@ -37,7 +37,7 @@ organization_does_not_belong_to_user=当前组织不属于当前用户
|
|||
organization_id_is_null=组织 ID 不能为空
|
||||
#api
|
||||
api_load_script_error=读取脚本失败
|
||||
#test case start
|
||||
#test case
|
||||
test_case_node_level=层
|
||||
test_case_node_level_tip=模块树最大深度为
|
||||
test_case_module_not_null=所属模块不能为空
|
||||
|
@ -51,11 +51,14 @@ parse_data_error=解析数据出错
|
|||
missing_header_information=缺少头部信息
|
||||
number=第
|
||||
row=行
|
||||
incorrect_format=所属模块
|
||||
error=出错
|
||||
test_case_exist=该项目下已存在用例:
|
||||
node_deep_limit=节点深度不超过5层!
|
||||
before_delete_plan=该计划下存在关联测试用例,请先取消关联!
|
||||
incorrect_format=格式错误
|
||||
test_case_type_validate=必须为functional、performance、api
|
||||
test_case_priority_validate=必须为P0、P1、P2、P3
|
||||
test_case_method_validate=必须为manual、auto
|
||||
error=出错
|
||||
test_case_name=用例名称
|
||||
test_case_type=用例类型
|
||||
test_case_maintainer=维护人
|
||||
|
@ -80,7 +83,3 @@ do_not_modify_header_order=请勿修改表头顺序
|
|||
module_created_automatically=若无该模块将自动创建
|
||||
options=选项
|
||||
please_input_workspace_member=请填写该工作空间相关人员
|
||||
test_case_exist=该项目下已存在用例:
|
||||
node_deep_limit=节点深度不超过5层!
|
||||
before_delete_plan=该计划下存在关联测试用例,请先取消关联!
|
||||
#test case end
|
|
@ -37,7 +37,7 @@ organization_does_not_belong_to_user=當前組織不屬於當前用戶
|
|||
organization_id_is_null=組織 ID 不能為空
|
||||
#api
|
||||
api_load_script_error=讀取腳本失敗
|
||||
#test case start
|
||||
#test case
|
||||
test_case_node_level=層
|
||||
test_case_node_level_tip=模塊樹最大深度為
|
||||
test_case_module_not_null=所屬模塊不能為空
|
||||
|
@ -51,11 +51,14 @@ parse_data_error=解析數據出錯
|
|||
missing_header_information=缺少頭部信息
|
||||
number=第
|
||||
row=行
|
||||
incorrect_format=所屬模塊
|
||||
error=出錯
|
||||
test_case_exist=該項目下已存在用例:
|
||||
node_deep_limit=節點深度不超過5層!
|
||||
before_delete_plan=該計劃下存在關聯測試用例,請先取消關聯!
|
||||
incorrect_format=格式錯誤
|
||||
test_case_type_validate=必須為functional、performance、api
|
||||
test_case_priority_validate=必須為P0、P1、P2、P3
|
||||
test_case_method_validate=必須為manual、auto
|
||||
error=出錯
|
||||
test_case_name=用例名稱
|
||||
test_case_type=用例類型
|
||||
test_case_maintainer=維護人
|
||||
|
@ -79,8 +82,4 @@ remark_optional=備註選填
|
|||
do_not_modify_header_order=請勿修改表頭順序
|
||||
module_created_automatically=若無該模塊將自動創建
|
||||
options=選項
|
||||
please_input_workspace_member=請填寫該工作空間相關人員
|
||||
test_case_exist=該項目下已存在用例:
|
||||
node_deep_limit=節點深度不超過5層!
|
||||
before_delete_plan=該計劃下存在關聯測試用例,請先取消關聯!
|
||||
#test case end
|
||||
please_input_workspace_member=請填寫該工作空間相關人員
|
|
@ -124,6 +124,8 @@ export default {
|
|||
param.nodeIds = nodeIds;
|
||||
this.$post("/case/node/drag", param, () => {
|
||||
this.refreshTable();
|
||||
}, (error) => {
|
||||
this.refreshNode();
|
||||
});
|
||||
},
|
||||
refreshTable() {
|
||||
|
|
|
@ -73,7 +73,7 @@ export default {
|
|||
}
|
||||
};
|
||||
|
||||
Vue.prototype.$post = function (url, data, success) {
|
||||
Vue.prototype.$post = function (url, data, success, failure) {
|
||||
let result = {loading: true};
|
||||
if (!success) {
|
||||
return axios.post(url, data);
|
||||
|
@ -82,6 +82,9 @@ export default {
|
|||
then(success, response, result);
|
||||
}).catch(error => {
|
||||
exception(error, result);
|
||||
if (failure) {
|
||||
then(failure, error, result);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue