From dd1880facf8ed4afb53ed523ae1703218013cb8a Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 18 Jan 2022 17:12:11 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=84=91=E5=9B=BE=E5=9C=A8?= =?UTF-8?q?=E5=85=A8=E9=83=A8=E7=94=A8=E4=BE=8B=E4=B8=8B=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E6=8F=90=E7=A4=BA=E9=94=99=E8=AF=AF=20--bug?= =?UTF-8?q?=3D1009685=20--user=3D=E9=99=88=E5=BB=BA=E6=98=9F=20=E3=80=90?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA=E3=80=91=E8=84=91=E5=9B=BE?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E7=94=A8=E4=BE=8B=EF=BC=8C=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E7=B2=98=E8=B4=B4=E4=BF=9D=E5=AD=98=E5=90=8E=EF=BC=8C=E5=8E=9F?= =?UTF-8?q?=E5=A7=8B=E7=94=A8=E4=BE=8B=E6=B2=A1=E6=9C=89=E4=BA=86=20https:?= =?UTF-8?q?//www.tapd.cn/55049933/s/10934188?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../track/common/minder/TestCaseMinder.vue | 24 +++++++++---------- frontend/src/i18n/en-US.js | 4 ++++ frontend/src/i18n/zh-CN.js | 4 ++++ frontend/src/i18n/zh-TW.js | 4 ++++ 4 files changed, 24 insertions(+), 12 deletions(-) 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: '確定要導出全部用例嗎?',