From d031adf090d2988ed68ed9709a550e02e6598a04 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 21 May 2020 14:41:08 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=A8=A1=E7=89=88=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TestCaseReportTemplateService.java | 15 +++++++++++++ .../business/components/settings/Setting.vue | 2 +- .../home/components/TestCaseSideList.vue | 10 ++++++--- .../report/TestCaseReportTemplateEdit.vue | 5 ++++- .../comonents/report/TestCaseReportView.vue | 2 +- frontend/src/i18n/en-US.js | 22 +++++++++---------- 6 files changed, 39 insertions(+), 17 deletions(-) diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseReportTemplateService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseReportTemplateService.java index 73beab6443..6c50055d7b 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseReportTemplateService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseReportTemplateService.java @@ -3,6 +3,8 @@ package io.metersphere.track.service; import io.metersphere.base.domain.TestCaseReportTemplate; import io.metersphere.base.domain.TestCaseReportTemplateExample; import io.metersphere.base.mapper.TestCaseReportTemplateMapper; +import io.metersphere.commons.exception.MSException; +import io.metersphere.commons.utils.SessionUtils; import io.metersphere.track.request.testCaseReport.QueryTemplateRequest; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -43,13 +45,26 @@ public class TestCaseReportTemplateService { public void addTestCaseReportTemplate(TestCaseReportTemplate testCaseReportTemplate) { testCaseReportTemplate.setId(UUID.randomUUID().toString()); + checkCaseReportTemplateExist(testCaseReportTemplate); testCaseReportTemplateMapper.insert(testCaseReportTemplate); } public void editTestCaseReportTemplate(TestCaseReportTemplate testCaseReportTemplate) { + checkCaseReportTemplateExist(testCaseReportTemplate); testCaseReportTemplateMapper.updateByPrimaryKeyWithBLOBs(testCaseReportTemplate); } + private void checkCaseReportTemplateExist (TestCaseReportTemplate testCaseReportTemplate) { + TestCaseReportTemplateExample example = new TestCaseReportTemplateExample(); + example.createCriteria() + .andNameEqualTo(testCaseReportTemplate.getName()) + .andWorkspaceIdEqualTo(SessionUtils.getCurrentWorkspaceId()) + .andIdNotEqualTo(testCaseReportTemplate.getId()); + if (testCaseReportTemplateMapper.selectByExample(example).size() > 0) { + MSException.throwException("同一工作空间下不能存在同名模版"); + } + } + public int deleteTestCaseReportTemplate(String id) { return testCaseReportTemplateMapper.deleteByPrimaryKey(id); } diff --git a/frontend/src/business/components/settings/Setting.vue b/frontend/src/business/components/settings/Setting.vue index 7f98f9b560..c171c4f9eb 100644 --- a/frontend/src/business/components/settings/Setting.vue +++ b/frontend/src/business/components/settings/Setting.vue @@ -35,7 +35,7 @@ padding: 20px; } - ms-main-container { + .ms-main-container { height: calc(100vh - 40px); } diff --git a/frontend/src/business/components/track/home/components/TestCaseSideList.vue b/frontend/src/business/components/track/home/components/TestCaseSideList.vue index 3bf1f489af..8aae85075c 100644 --- a/frontend/src/business/components/track/home/components/TestCaseSideList.vue +++ b/frontend/src/business/components/track/home/components/TestCaseSideList.vue @@ -10,13 +10,15 @@ + :label="$t('test_track.case.priority')" + show-overflow-tooltip> @@ -33,7 +35,8 @@ + :label="$t('test_track.plan_view.execute_result')" + show-overflow-tooltip> @@ -41,7 +44,8 @@ + :label="$t('test_track.plan.test_plan')" + show-overflow-tooltip> diff --git a/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportTemplateEdit.vue b/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportTemplateEdit.vue index 4c31103a4b..ad2aa547f4 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportTemplateEdit.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportTemplateEdit.vue @@ -206,9 +206,12 @@ }); }, handleSave() { - if (this.template.name == '') { + if (this.template.name == null || this.template.name == '') { this.$warning(this.$t('test_track.plan_view.input_template_name')); return; + } else if (this.template.name.length > 64) { + this.$warning(this.$t('commons.name') + this.$t('test_track.length_less_than') + '64'); + return; } let param = {}; this.buildParam(param); diff --git a/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportView.vue b/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportView.vue index 5758c000de..97a6297aaa 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportView.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportView.vue @@ -15,7 +15,7 @@
{{$t('test_track.return')}}   - {{report.name}} + {{report.name}}
diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index ee6d6b4216..c4ca613cd9 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -333,7 +333,7 @@ export default { test_name: "Test" }, test_track: { - test_track: "Test Track", + test_track: "Track", confirm: "Confirm", cancel: "Cancel", project: "Project", @@ -344,7 +344,7 @@ export default { recent_case: "Recent case", pass_rate: "Pass rate", case: { - test_case: "Test case", + test_case: "Case", move: "Move case", case_list: "Test case list", create_case: "Create case", @@ -353,13 +353,13 @@ export default { no_project: "There is no project in this workspace, please create the project first", priority: "Priority", type: "Type", - method: "The test way", + method: "Method", auto: "Auto", manual: "Manual", create: "Create test case", case_type: "Case Type", name: "Test case name", - module: "Subordinate to the module", + module: "Module", maintainer: "Maintainer", steps: "Steps", number: "Number", @@ -393,12 +393,12 @@ export default { } }, plan: { - test_plan: "Test Plan", + test_plan: "Plan", create_plan: "Create test plan", edit_plan: "Edit test plan", plan_name: "Test plan name", - plan_project: "Related project", - plan_stage: "Testing phase", + plan_project: "Project", + plan_stage: "Stage", plan_status: "Status", smoke_test: "Smoke test", functional_test: "Functional test", @@ -434,9 +434,9 @@ export default { }, plan_view: { plan: "Plan", - relevance_test_case: "Relevance test case", + relevance_test_case: "Relevance case", executor: "Executor", - execute_result: "Execute result", + execute_result: "Result", pass: "Pass", failure: "Failure", blocking: "Blocking", @@ -447,7 +447,7 @@ export default { all_case: "All case", pre_case: "The last case", next_case: "The next case", - change_execution_results: "Change execution results", + change_execution_results: "Change results", change_executor: "Change executor", select_executor: "Select executor", select_execute_result: "Select execute result", @@ -462,7 +462,7 @@ export default { base_info: "Base info", test_result: "Test result", result_distribution: "Result distribution", - custom_component: "Custom component", + custom_component: "Custom", create_report: "Create report", view_report: "View report", component_library: "Component library", From 647f3eac34b4de69008b831ad4b505fe675475f7 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 21 May 2020 14:51:24 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E6=97=B6=E5=A1=AB=E5=85=85=E5=8E=9F=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/business/components/track/common/NodeEdit.vue | 3 +++ .../src/business/components/track/common/NodeTree.vue | 9 +++------ frontend/src/i18n/en-US.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/business/components/track/common/NodeEdit.vue b/frontend/src/business/components/track/common/NodeEdit.vue index 5062df93a9..5d258cd5ff 100644 --- a/frontend/src/business/components/track/common/NodeEdit.vue +++ b/frontend/src/business/components/track/common/NodeEdit.vue @@ -63,6 +63,9 @@ open(type, data, nodeIds) { this.type = type; this.node = data; + if (this.node) { + this.form.name = this.node.name; + } this.nodeIds = nodeIds; this.dialogFormVisible = true; }, diff --git a/frontend/src/business/components/track/common/NodeTree.vue b/frontend/src/business/components/track/common/NodeTree.vue index 6c2c07a687..5c304dfe7a 100644 --- a/frontend/src/business/components/track/common/NodeTree.vue +++ b/frontend/src/business/components/track/common/NodeTree.vue @@ -15,8 +15,7 @@ :expand-on-click-node="false" highlight-current :draggable="draggable" - ref="tree" - > + ref="tree">