diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index 10aa7ef89b..156dc23ca8 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -275,7 +275,7 @@ public class TestCaseService { .map(TestCase::getName) .collect(Collectors.toSet()); List> errList = null; - if(multipartFile == null ) + if (multipartFile == null) MSException.throwException(Translator.get("upload_fail")); if (multipartFile.getOriginalFilename().endsWith(".xmind")) { @@ -288,6 +288,11 @@ public class TestCaseService { ExcelErrData excelErrData = new ExcelErrData(null, 1, Translator.get("upload_fail") + ":" + processLog); errList.add(excelErrData); 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 { if (!xmindParser.getNodePaths().isEmpty()) { testCaseNodeService.createNodes(xmindParser.getNodePaths(), projectId); @@ -299,7 +304,8 @@ public class TestCaseService { excelResponse.setSuccess(true); } } catch (Exception e) { - e.printStackTrace(); + LogUtil.error(e.getMessage(), e); + MSException.throwException(e.getMessage()); } } else { diff --git a/backend/src/main/java/io/metersphere/xmind/XmindCaseParser.java b/backend/src/main/java/io/metersphere/xmind/XmindCaseParser.java index 2585b37376..79ed5e1625 100644 --- a/backend/src/main/java/io/metersphere/xmind/XmindCaseParser.java +++ b/backend/src/main/java/io/metersphere/xmind/XmindCaseParser.java @@ -90,7 +90,7 @@ public class XmindCaseParser { } // 递归处理案例数据 - private void recursion(StringBuffer processBuffer, Attached parent, int level, List attacheds) { + private void recursion(Attached parent, int level, List attacheds) { for (Attached item : attacheds) { if (isAvailable(item.getTitle(), "(?:tc:|tc:|tc)")) { // 用例 item.setParent(parent); @@ -100,7 +100,7 @@ public class XmindCaseParser { item.setPath(nodePath); item.setParent(parent); if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) { - recursion(processBuffer, item, level + 1, item.getChildren().getAttached()); + recursion(item, level + 1, item.getChildren().getAttached()); } else { if (!nodePath.startsWith("/")) { nodePath = "/" + nodePath; @@ -267,7 +267,6 @@ public class XmindCaseParser { // 导入思维导图处理 public String parse(MultipartFile multipartFile) { - StringBuffer processBuffer = new StringBuffer(); try { // 获取思维导图内容 List roots = XmindParser.parseObject(multipartFile); @@ -281,7 +280,7 @@ public class XmindCaseParser { String nodePath = item.getTitle(); item.setPath(nodePath); if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) { - recursion(processBuffer, item, 1, item.getChildren().getAttached()); + recursion(item, 1, item.getChildren().getAttached()); } else { if (!nodePath.startsWith("/")) { nodePath = "/" + nodePath; @@ -295,7 +294,8 @@ public class XmindCaseParser { } } } - this.validate(); + + this.validate(); //检查目录合规性 } catch (Exception ex) { return ex.getMessage(); } diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index abd1d31f1f..a6f319bf20 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -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 # check owner 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 \ No newline at end of file +check_owner_test=The current user does not have permission to operate this test +upload_content_is_null=Imported content is empty \ No newline at end of file diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index d4aebdce4d..fa4611ee14 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -160,4 +160,5 @@ test_review_task_notice=测试评审任务通知 test_track.length_less_than=标题过长,字数必须小于 # check owner check_owner_project=当前用户没有操作此项目的权限 -check_owner_test=当前用户没有操作此测试的权限 \ No newline at end of file +check_owner_test=当前用户没有操作此测试的权限 +upload_content_is_null=导入内容为空 \ No newline at end of file diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 21433d9522..13f7ba0b9a 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -161,4 +161,5 @@ test_review_task_notice=測試評審任務通知 test_track.length_less_than=標題過長,字數必須小於 # check owner check_owner_project=當前用戶沒有操作此項目的權限 -check_owner_test=當前用戶沒有操作此測試的權限 \ No newline at end of file +check_owner_test=當前用戶沒有操作此測試的權限 +upload_content_is_null=導入內容為空 \ No newline at end of file diff --git a/frontend/src/business/components/performance/test/components/PerformanceAdvancedConfig.vue b/frontend/src/business/components/performance/test/components/PerformanceAdvancedConfig.vue index 4459d8ef45..023fa1bad2 100644 --- a/frontend/src/business/components/performance/test/components/PerformanceAdvancedConfig.vue +++ b/frontend/src/business/components/performance/test/components/PerformanceAdvancedConfig.vue @@ -39,8 +39,7 @@ :disabled="!row.edit || readOnly" size="mini" v-model="row.enable" - active-color="#13ce66" - inactive-color="#ff4949"> + inactive-color="#DCDFE6"> diff --git a/frontend/src/business/components/settings/personal/ApiKeys.vue b/frontend/src/business/components/settings/personal/ApiKeys.vue index c9c16c9c68..8e2a85eb05 100644 --- a/frontend/src/business/components/settings/personal/ApiKeys.vue +++ b/frontend/src/business/components/settings/personal/ApiKeys.vue @@ -37,8 +37,7 @@