diff --git a/frontend/src/business/components/track/common/minder/TestCaseMinder.vue b/frontend/src/business/components/track/common/minder/TestCaseMinder.vue index c90c0df551..8be8b5815b 100644 --- a/frontend/src/business/components/track/common/minder/TestCaseMinder.vue +++ b/frontend/src/business/components/track/common/minder/TestCaseMinder.vue @@ -248,9 +248,7 @@ name: "TestCaseMinder", let pId = parent ? (parent.newId ? parent.newId : parent.id) : null; if (!isModuleNodeData(parent)) { - let tip = data.text + '不能创建非模块节点下'; - this.$error(tip) - throw new Error(tip); + this.throwError(this.$t('test_track.case.minder_not_module_tip', [data.text])); } let module = { @@ -303,16 +301,16 @@ name: "TestCaseMinder", return; } + if (parent.id === 'root') { + this.throwError(this.$t('test_track.case.minder_all_module_tip')); + } + if (parent.isExtraNode) { - let tip = '无法在临时节点"' + parent.text + '"下创建用例'; - this.$error(tip) - throw new Error(tip); + this.throwError(this.$t('test_track.case.minder_tem_node_tip', [parent.text])); } if (data.type === 'node') { - let tip = data.text + '是模块,不能修改为用例'; - this.$error(tip) - throw new Error(tip); + this.throwError(this.$t('test_track.case.minder_is_module_tip', [data.text])); } let isChange = false; @@ -405,9 +403,7 @@ name: "TestCaseMinder", this.saveCases.push(testCase); } if (testCase.nodeId !== 'root' && testCase.nodeId.length < 15) { - let tip = this.$t('test_track.case.create_case') + "'" + testCase.name + "'" + this.$t('test_track.case.minder_create_tip'); - this.$error(tip) - throw new Error(tip); + this.throwError(this.$t('test_track.case.create_case') + "'" + testCase.name + "'" + this.$t('test_track.case.minder_create_tip')); } }, pushDeleteNode(data) { @@ -446,6 +442,10 @@ name: "TestCaseMinder", data.isExtraNode = true; return nodeData; }, + throwError(tip) { + this.$error(tip) + throw new Error(tip); + }, tagEditCheck() { return tagEditCheck; }, diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index d35675b636..34a015d152 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -1887,6 +1887,10 @@ export default { minder_issue_delete_tip: "Successfully cancel the defect association", check_select: "Please check the case", export_all_cases: 'Are you sure you want to export all use cases?', + minder_tem_node_tip: "Cannot create case {0} under the temporary node", + minder_is_module_tip: "{0} is a module and cannot be modified as a use ca", + minder_not_module_tip: "Module {0}, cannot be created under a non-module node", + minder_all_module_tip: 'All case are virtual modules. Please create use cases in other modules', input_test_case: 'Please enter the associated case name', test_name: 'TestName', other: '--Other--', diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 28747b43b3..4214401d2d 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -1884,6 +1884,10 @@ export default { text_describe_tip: "使用于简单的测试场景,没有明确的测试步骤", change_type: "更改类型", minder_create_tip: "失败, 无法在脑图创建其父模块", + minder_tem_node_tip: "无法在临时节点{0}下创建用例", + minder_is_module_tip: "{0}是模块,不能修改为用例", + minder_not_module_tip: "模块{0},不能创建在非模块节点下", + minder_all_module_tip: "全部用例为虚拟模块,请在其他模块创建用例", minder_issue_delete_tip: "取消缺陷关联成功", check_select: "请勾选用例", export_all_cases: '确定要导出全部用例吗?', diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index eebb477d50..24c738e449 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -1884,6 +1884,10 @@ export default { text_describe_tip: "使用於簡單的測試場景,沒有明確的測試步驟", change_type: "更改類型", minder_create_tip: "失敗, 無法在腦圖創建其父模塊", + minder_tem_node_tip: "無法在臨時節點{0}下創建用例", + minder_is_module_tip: "{0}是模塊,不能修改為用例", + minder_not_module_tip: "模塊{0},不能創建在非模塊節點下", + minder_all_module_tip: "全部用例為虛擬模塊,請在其他模塊創建用例", minder_issue_delete_tip: "取消缺陷關聯成功", check_select: "請勾選用例", export_all_cases: '確定要導出全部用例嗎?',