From d5566fc4fe3b4e606b98e3c0bb68d3d28dea868c Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 17 Dec 2021 11:05:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89=E4=B8=ADcase=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E8=BF=87=E9=95=BF=E5=AF=BC=E8=87=B4=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V102__v1.15.5_release.sql | 2 ++ .../api/definition/components/case/ApiCaseItem.vue | 13 +++++++++---- frontend/src/i18n/en-US.js | 1 + frontend/src/i18n/zh-CN.js | 1 + frontend/src/i18n/zh-TW.js | 1 + 5 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 backend/src/main/resources/db/migration/V102__v1.15.5_release.sql diff --git a/backend/src/main/resources/db/migration/V102__v1.15.5_release.sql b/backend/src/main/resources/db/migration/V102__v1.15.5_release.sql new file mode 100644 index 0000000000..748ca1c6cb --- /dev/null +++ b/backend/src/main/resources/db/migration/V102__v1.15.5_release.sql @@ -0,0 +1,2 @@ +ALTER TABLE api_definition_exec_result + MODIFY COLUMN name VARCHAR (255); \ No newline at end of file diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue index d7fd938142..2fbd303ee3 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue @@ -6,7 +6,8 @@ @@ -408,9 +409,6 @@ export default { saveCase(row, hideAlert) { let tmp = JSON.parse(JSON.stringify(row)); this.isShowInput = false; - if (this.validate(tmp)) { - return; - } tmp.request.body = row.request.body; let bodyFiles = this.getBodyUploadFiles(tmp); tmp.projectId = getCurrentProjectID(); @@ -466,6 +464,9 @@ export default { }); }, saveTestCase(row, hideAlert) { + if (this.validate(row)) { + return; + } if (this.compare.indexOf(row.id) === -1) { this.compare.push(row.id); if (this.api.saved) { @@ -500,6 +501,10 @@ export default { this.$warning(this.$t('api_test.input_name')); return true; } + if (row.name.length > 100) { + this.$warning(this.$t('api_test.input_name_length')); + return true; + } }, showExecResult(item) { item.active = true; diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 9e36eb6569..965ccc18f6 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -985,6 +985,7 @@ export default { invert_select: "Invert select", select_or_invert: "Select all/Invert select", input_name: "Please enter the test name", + input_name_length: "The length of the test name cannot exceed 100", select_project: "Please select project", variable_name: "Variable name", variable: "Variable", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index b8d25b1ba5..bb29d58789 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -992,6 +992,7 @@ export default { invert_select: "反选", select_or_invert: "全选/反选", input_name: "请输入测试名称", + input_name_length: "测试名称长度不能超过100", select_project: "请选择项目", variable_name: "变量名", variable: "变量", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 0de7b3276a..55c6f11e4f 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -989,6 +989,7 @@ export default { invert_select: "反選", select_or_invert: "全選/反選", input_name: "請輸入測試名稱", + input_name_length: "測試名稱長度不能超過100", select_project: "請選擇項目", variable_name: "變量名", variable: "變量",