Merge remote-tracking branch 'origin/v1.3' into v1.3
This commit is contained in:
commit
42a9074074
|
@ -275,7 +275,7 @@ public class TestCaseService {
|
||||||
.map(TestCase::getName)
|
.map(TestCase::getName)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
List<ExcelErrData<TestCaseExcelData>> errList = null;
|
List<ExcelErrData<TestCaseExcelData>> errList = null;
|
||||||
if(multipartFile == null )
|
if (multipartFile == null)
|
||||||
MSException.throwException(Translator.get("upload_fail"));
|
MSException.throwException(Translator.get("upload_fail"));
|
||||||
|
|
||||||
if (multipartFile.getOriginalFilename().endsWith(".xmind")) {
|
if (multipartFile.getOriginalFilename().endsWith(".xmind")) {
|
||||||
|
@ -288,6 +288,11 @@ public class TestCaseService {
|
||||||
ExcelErrData excelErrData = new ExcelErrData(null, 1, Translator.get("upload_fail") + ":" + processLog);
|
ExcelErrData excelErrData = new ExcelErrData(null, 1, Translator.get("upload_fail") + ":" + processLog);
|
||||||
errList.add(excelErrData);
|
errList.add(excelErrData);
|
||||||
excelResponse.setErrList(errList);
|
excelResponse.setErrList(errList);
|
||||||
|
} else if (xmindParser.getNodePaths().isEmpty() && xmindParser.getTestCase().isEmpty()) {
|
||||||
|
excelResponse.setSuccess(false);
|
||||||
|
ExcelErrData excelErrData = new ExcelErrData(null, 1, Translator.get("upload_fail") + ":" + Translator.get("upload_content_is_null"));
|
||||||
|
errList.add(excelErrData);
|
||||||
|
excelResponse.setErrList(errList);
|
||||||
} else {
|
} else {
|
||||||
if (!xmindParser.getNodePaths().isEmpty()) {
|
if (!xmindParser.getNodePaths().isEmpty()) {
|
||||||
testCaseNodeService.createNodes(xmindParser.getNodePaths(), projectId);
|
testCaseNodeService.createNodes(xmindParser.getNodePaths(), projectId);
|
||||||
|
@ -299,7 +304,8 @@ public class TestCaseService {
|
||||||
excelResponse.setSuccess(true);
|
excelResponse.setSuccess(true);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
LogUtil.error(e.getMessage(), e);
|
||||||
|
MSException.throwException(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class XmindCaseParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 递归处理案例数据
|
// 递归处理案例数据
|
||||||
private void recursion(StringBuffer processBuffer, Attached parent, int level, List<Attached> attacheds) {
|
private void recursion(Attached parent, int level, List<Attached> attacheds) {
|
||||||
for (Attached item : attacheds) {
|
for (Attached item : attacheds) {
|
||||||
if (isAvailable(item.getTitle(), "(?:tc:|tc:|tc)")) { // 用例
|
if (isAvailable(item.getTitle(), "(?:tc:|tc:|tc)")) { // 用例
|
||||||
item.setParent(parent);
|
item.setParent(parent);
|
||||||
|
@ -100,7 +100,7 @@ public class XmindCaseParser {
|
||||||
item.setPath(nodePath);
|
item.setPath(nodePath);
|
||||||
item.setParent(parent);
|
item.setParent(parent);
|
||||||
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
|
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
|
||||||
recursion(processBuffer, item, level + 1, item.getChildren().getAttached());
|
recursion(item, level + 1, item.getChildren().getAttached());
|
||||||
} else {
|
} else {
|
||||||
if (!nodePath.startsWith("/")) {
|
if (!nodePath.startsWith("/")) {
|
||||||
nodePath = "/" + nodePath;
|
nodePath = "/" + nodePath;
|
||||||
|
@ -267,7 +267,6 @@ public class XmindCaseParser {
|
||||||
|
|
||||||
// 导入思维导图处理
|
// 导入思维导图处理
|
||||||
public String parse(MultipartFile multipartFile) {
|
public String parse(MultipartFile multipartFile) {
|
||||||
StringBuffer processBuffer = new StringBuffer();
|
|
||||||
try {
|
try {
|
||||||
// 获取思维导图内容
|
// 获取思维导图内容
|
||||||
List<JsonRootBean> roots = XmindParser.parseObject(multipartFile);
|
List<JsonRootBean> roots = XmindParser.parseObject(multipartFile);
|
||||||
|
@ -281,7 +280,7 @@ public class XmindCaseParser {
|
||||||
String nodePath = item.getTitle();
|
String nodePath = item.getTitle();
|
||||||
item.setPath(nodePath);
|
item.setPath(nodePath);
|
||||||
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
|
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
|
||||||
recursion(processBuffer, item, 1, item.getChildren().getAttached());
|
recursion(item, 1, item.getChildren().getAttached());
|
||||||
} else {
|
} else {
|
||||||
if (!nodePath.startsWith("/")) {
|
if (!nodePath.startsWith("/")) {
|
||||||
nodePath = "/" + nodePath;
|
nodePath = "/" + nodePath;
|
||||||
|
@ -295,7 +294,8 @@ public class XmindCaseParser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.validate();
|
|
||||||
|
this.validate(); //检查目录合规性
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
return ex.getMessage();
|
return ex.getMessage();
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,4 +160,5 @@ test_review_task_notice=Test review task notice
|
||||||
test_track.length_less_than=The title is too long, the length must be less than
|
test_track.length_less_than=The title is too long, the length must be less than
|
||||||
# check owner
|
# check owner
|
||||||
check_owner_project=The current user does not have permission to operate this project
|
check_owner_project=The current user does not have permission to operate this project
|
||||||
check_owner_test=The current user does not have permission to operate this test
|
check_owner_test=The current user does not have permission to operate this test
|
||||||
|
upload_content_is_null=Imported content is empty
|
|
@ -160,4 +160,5 @@ test_review_task_notice=测试评审任务通知
|
||||||
test_track.length_less_than=标题过长,字数必须小于
|
test_track.length_less_than=标题过长,字数必须小于
|
||||||
# check owner
|
# check owner
|
||||||
check_owner_project=当前用户没有操作此项目的权限
|
check_owner_project=当前用户没有操作此项目的权限
|
||||||
check_owner_test=当前用户没有操作此测试的权限
|
check_owner_test=当前用户没有操作此测试的权限
|
||||||
|
upload_content_is_null=导入内容为空
|
|
@ -161,4 +161,5 @@ test_review_task_notice=測試評審任務通知
|
||||||
test_track.length_less_than=標題過長,字數必須小於
|
test_track.length_less_than=標題過長,字數必須小於
|
||||||
# check owner
|
# check owner
|
||||||
check_owner_project=當前用戶沒有操作此項目的權限
|
check_owner_project=當前用戶沒有操作此項目的權限
|
||||||
check_owner_test=當前用戶沒有操作此測試的權限
|
check_owner_test=當前用戶沒有操作此測試的權限
|
||||||
|
upload_content_is_null=導入內容為空
|
|
@ -39,8 +39,7 @@
|
||||||
:disabled="!row.edit || readOnly"
|
:disabled="!row.edit || readOnly"
|
||||||
size="mini"
|
size="mini"
|
||||||
v-model="row.enable"
|
v-model="row.enable"
|
||||||
active-color="#13ce66"
|
inactive-color="#DCDFE6">
|
||||||
inactive-color="#ff4949">
|
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
|
@ -37,8 +37,7 @@
|
||||||
<el-table-column prop="status" :label="$t('commons.status')">
|
<el-table-column prop="status" :label="$t('commons.status')">
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
<el-switch v-model="scope.row.status"
|
<el-switch v-model="scope.row.status"
|
||||||
active-color="#13ce66"
|
inactive-color="#DCDFE6"
|
||||||
inactive-color="#ff4949"
|
|
||||||
active-value="ACTIVE"
|
active-value="ACTIVE"
|
||||||
inactive-value="DISABLED"
|
inactive-value="DISABLED"
|
||||||
@change="changeSwitch(scope.row)"
|
@change="changeSwitch(scope.row)"
|
||||||
|
|
|
@ -16,8 +16,7 @@
|
||||||
<el-table-column prop="status" :label="$t('test_resource_pool.enable_disable')">
|
<el-table-column prop="status" :label="$t('test_resource_pool.enable_disable')">
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
<el-switch v-model="scope.row.status"
|
<el-switch v-model="scope.row.status"
|
||||||
active-color="#13ce66"
|
inactive-color="#DCDFE6"
|
||||||
inactive-color="#ff4949"
|
|
||||||
active-value="VALID"
|
active-value="VALID"
|
||||||
inactive-value="INVALID"
|
inactive-value="INVALID"
|
||||||
@change="changeSwitch(scope.row)"
|
@change="changeSwitch(scope.row)"
|
||||||
|
|
|
@ -19,8 +19,7 @@
|
||||||
<el-table-column prop="status" :label="$t('commons.status')" width="120">
|
<el-table-column prop="status" :label="$t('commons.status')" width="120">
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
<el-switch v-model="scope.row.status"
|
<el-switch v-model="scope.row.status"
|
||||||
active-color="#13ce66"
|
inactive-color="#DCDFE6"
|
||||||
inactive-color="#ff4949"
|
|
||||||
active-value="1"
|
active-value="1"
|
||||||
inactive-value="0"
|
inactive-value="0"
|
||||||
@change="changeSwitch(scope.row)"
|
@change="changeSwitch(scope.row)"
|
||||||
|
|
Loading…
Reference in New Issue