Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
q4speed 2020-05-21 15:56:43 +08:00
commit d6da86b7b5
8 changed files with 46 additions and 24 deletions

View File

@ -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);
}

View File

@ -35,7 +35,7 @@
padding: 20px;
}
ms-main-container {
.ms-main-container {
height: calc(100vh - 40px);
}

View File

@ -63,6 +63,9 @@
open(type, data, nodeIds) {
this.type = type;
this.node = data;
if (type == 'edit') {
this.form.name = this.node.name;
}
this.nodeIds = nodeIds;
this.dialogFormVisible = true;
},

View File

@ -15,8 +15,7 @@
:expand-on-click-node="false"
highlight-current
:draggable="draggable"
ref="tree"
>
ref="tree">
<template v-slot:default="{node,data}">
<span class="custom-tree-node father" @click="handleNodeSelect(node)">
<span class="node-icon">
@ -31,8 +30,7 @@
effect="dark"
:open-delay="200"
:content="$t('test_track.module.rename')"
placement="top"
>
placement="top">
<i @click.stop="openEditNodeDialog('edit', data)" class="el-icon-edit"></i>
</el-tooltip>
<el-tooltip
@ -40,8 +38,7 @@
effect="dark"
:open-delay="200"
:content="$t('test_track.module.add_submodule')"
placement="top"
>
placement="top">
<i @click.stop="openEditNodeDialog('add', data)" class="el-icon-circle-plus-outline"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark"

View File

@ -10,13 +10,15 @@
<el-table-column
prop="name"
fixed
:label="$t('commons.name')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="priority"
:label="$t('test_track.case.priority')">
:label="$t('test_track.case.priority')"
show-overflow-tooltip>
<template v-slot:default="scope">
<priority-table-item :value="scope.row.priority" ref="priority"/>
</template>
@ -33,7 +35,8 @@
<el-table-column
prop="status"
:label="$t('test_track.plan_view.execute_result')">
:label="$t('test_track.plan_view.execute_result')"
show-overflow-tooltip>
<template v-slot:default="scope">
<status-table-item :value="scope.row.status"/>
</template>
@ -41,7 +44,8 @@
<el-table-column
prop="planName"
:label="$t('test_track.plan.test_plan')">
:label="$t('test_track.plan.test_plan')"
show-overflow-tooltip>
</el-table-column>
</el-table>

View File

@ -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);

View File

@ -15,7 +15,7 @@
<div class="name-edit">
<el-button plain size="mini" icon="el-icon-back" @click="handleClose">{{$t('test_track.return')}}</el-button>
&nbsp;
<span>{{report.name}}</span>
<span class="title">{{report.name}}</span>
</div>
</el-col>
<el-col :span="12" class="head-right">

View File

@ -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",
@ -421,7 +421,7 @@ export default {
rename: "Rename",
add_submodule: "Add submodule",
add_module: "Add module",
name: "Module name",
name: "Name",
delete_confirm: "Confirm delete module:",
delete_all_resource: "and all submodules and test cases under the module",
module: "Module",
@ -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",