Merge remote-tracking branch 'origin/master'

This commit is contained in:
fit2-zhao 2020-09-22 12:35:50 +08:00
commit c089e27ff9
14 changed files with 122 additions and 73 deletions

@ -1 +1 @@
Subproject commit d5b4969642fd8d10cc2f949d7377e0a0e5217a3a
Subproject commit 321c869938357e8c2253e5bd86c963828664ae23

View File

@ -20,7 +20,7 @@
import MsMainContainer from "../../../common/components/MsMainContainer";
import MsAsideItem from "../../../common/components/MsAsideItem";
import EnvironmentEdit from "./environment/EnvironmentEdit";
import {listenGoBack, removeGoBackListener} from "../../../../../common/js/utils";
import {deepClone, listenGoBack, removeGoBackListener} from "../../../../../common/js/utils";
import {Environment, parseEnvironment} from "../model/EnvironmentModel";
export default {
@ -68,12 +68,13 @@
}
},
copyEnvironment(environment) {
this.currentEnvironment = environment;
if (!environment.id) {
this.$warning(this.$t('commons.please_save'));
return;
}
let newEnvironment = {};
Object.assign(newEnvironment, environment);
newEnvironment = new Environment(environment);
newEnvironment.id = null;
newEnvironment.name = this.getNoRepeatName(newEnvironment.name);
if (!this.validateEnvironment(newEnvironment)) {
@ -84,11 +85,7 @@
this.$refs.environmentItems.itemSelected(this.environments.length - 1, newEnvironment);
},
validateEnvironment(environment) {
if (!environment.name || !!environment.name && environment.name.length > 64) {
this.$error(this.$t('commons.input_limit', [1, 64]));
return false;
}
if (!this.$refs.environmentEdit.validateSocket(environment.socket)) {
if (!this.$refs.environmentEdit.validate()) {
this.$error(this.$t('commons.formatErr'));
return false;
}

View File

@ -79,6 +79,17 @@
}
});
},
validate() {
let isValidate = false;
this.$refs['environment'].validate((valid) => {
if (valid && this.$refs.commonConfig.validate() && this.$refs.httpConfig.validate()) {
isValidate = true;
} else {
isValidate = false;
}
});
return isValidate;
},
_save(environment) {
let param = this.buildParam(environment);
let url = '/api/environment/add';

View File

@ -8,13 +8,14 @@ export class Environment extends BaseConfig {
this.projectId = undefined;
this.name = undefined;
this.id = undefined;
this.config = options.config || new Config();
this.config = undefined;
this.set(options);
this.sets({}, options);
}
initOptions(options = {}) {
this.config = new Config(options.config);
return options;
}
}
@ -22,14 +23,16 @@ export class Environment extends BaseConfig {
export class Config extends BaseConfig {
constructor(options = {}) {
super();
this.commonConfig = options.commonConfig || new CommonConfig();
this.httpConfig = options.httpConfig || new HttpConfig();
this.commonConfig = undefined;
this.httpConfig = undefined;
this.databaseConfigs = [];
this.set(options);
this.sets({databaseConfigs: DatabaseConfig}, options);
}
initOptions(options = {}) {
this.commonConfig = new CommonConfig(options.commonConfig);
this.httpConfig = new HttpConfig(options.httpConfig);
options.databaseConfigs = options.databaseConfigs || [];
return options;
}

View File

@ -32,12 +32,12 @@
<el-submenu v-permission="['test_manager','test_user','test_viewer']"
index="8" popper-class="submenu">
<template v-slot:title>用例评审</template>
<template v-slot:title>{{$t('test_track.review.test_review')}}</template>
<ms-recent-list ref="reviewRecent" :options="reviewRecent"/>
<el-divider/>
<ms-show-all :index="'/track/review/all'"/>
<el-menu-item :index="testCaseReviewEditPath" class="blank_item"/>
<ms-create-button v-permission="['test_manager','test_user']" :index="'/track/review/create'" title="创建用例评审"/>
<ms-create-button v-permission="['test_manager','test_user']" :index="'/track/review/create'" :title="$t('test_track.review.create_review')"/>
</el-submenu>
<el-submenu v-permission="['test_manager','test_user','test_viewer']" index="7" popper-class="submenu">
@ -94,7 +94,7 @@ export default {
}
},
reviewRecent: {
title: "最近的评审",
title: this.$t('test_track.recent_review'),
url: "/test/case/review/recent/5",
index: function (item) {
return '/track/review/view/' + item.id;

View File

@ -3,7 +3,7 @@
<div>
<el-dialog :close-on-click-modal="false"
:title="operationType === 'edit' ? '编辑用例评审' : '创建用例评审'"
:title="operationType === 'edit' ? $t('test_track.review.edit_review') : $t('test_track.review.create_review')"
:visible.sync="dialogFormVisible"
@close="close"
v-loading="result.loading"
@ -14,8 +14,8 @@
<el-row>
<el-col :span="8" :offset="1">
<el-form-item
placeholder="请输入评审标题"
label="评审标题"
:placeholder="$t('test_track.review.input_review_name')"
:label="$t('test_track.review.review_name')"
:label-width="formLabelWidth"
prop="name">
<el-input v-model="form.name"/>
@ -23,10 +23,10 @@
</el-col>
<el-col :span="11" :offset="2">
<el-form-item :label="$t('test_track.plan.plan_project')" :label-width="formLabelWidth" prop="projectIds">
<el-form-item :label="$t('test_track.review.review_project')" :label-width="formLabelWidth" prop="projectIds">
<el-select
v-model="form.projectIds"
:placeholder="$t('test_track.plan.input_plan_project')"
:placeholder="$t('test_track.review.input_review_project')"
multiple
style="width: 100%"
collapse-tags
@ -44,10 +44,10 @@
<el-row>
<el-col :span="10" :offset="1">
<el-form-item label="评审人" :label-width="formLabelWidth" prop="userIds">
<el-form-item :label="$t('test_track.review.reviewer')" :label-width="formLabelWidth" prop="userIds">
<el-select
v-model="form.userIds"
placeholder="请选择评审人"
:placeholder="$t('test_track.review.input_reviewer')"
filterable multiple
collapse-tags
>
@ -62,7 +62,7 @@
</el-col>
<el-col :span="10">
<el-form-item label="截止时间" :label-width="formLabelWidth" prop="endTime">
<el-form-item :label="$t('test_track.review.end_time')" :label-width="formLabelWidth" prop="endTime">
<el-date-picker @change="endTimeChange" type="datetime" :placeholder="$t('commons.select_date')"
v-model="form.endTime"/>
</el-form-item>
@ -84,7 +84,7 @@
<el-row v-if="operationType == 'edit'" type="flex" justify="left" style="margin-top: 10px;">
<el-col :span="19" :offset="1">
<el-form-item label="当前状态" :label-width="formLabelWidth" prop="status">
<el-form-item :label="$t('test_track.review.review_status')" :label-width="formLabelWidth" prop="status">
<test-plan-status-button :status="form.status" @statusChange="statusChange"/>
</el-form-item>
</el-col>

View File

@ -3,8 +3,8 @@
<template v-slot:header>
<ms-table-header :is-tester-permission="true" :condition.sync="condition"
@search="initTableData" @create="testCaseReviewCreate"
create-tip="创建用例评审"
title="用例评审"/>
:create-tip="$t('test_track.review.create_review')"
:title="$t('test_track.review.test_review')"/>
</template>
<el-table
@ -16,28 +16,28 @@
@row-click="intoReview">
<el-table-column
prop="name"
label="评审名称"
:label="$t('test_track.review.review_name')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="reviewer"
label="评审人"
:label="$t('test_track.review.reviewer')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="projectName"
label="所属项目"
:label="$t('test_track.review.review_project')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="creator"
label="发起人"
:label="$t('test_track.review.review_creator')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="status"
column-key="status"
:label="$t('test_track.plan.plan_status')"
:label="$t('test_track.review.review_status')"
show-overflow-tooltip>
<template v-slot:default="scope">
<span class="el-dropdown-link">
@ -55,7 +55,7 @@
</el-table-column>
<el-table-column
prop="endTime"
label="截止时间"
:label="$t('test_track.review.end_time')"
show-overflow-tooltip>
<template v-slot:default="scope">
<span>{{ scope.row.endTime | timestampFormatDate }}</span>
@ -77,7 +77,7 @@
<ms-table-pagination :change="initTableData" :current-page.sync="currentPage" :page-size.sync="pageSize"
:total="total"/>
<ms-delete-confirm title="取消用例关联" @delete="_handleDelete" ref="deleteConfirm"/>
<ms-delete-confirm :title="$t('test_track.review.delete')" @delete="_handleDelete" ref="deleteConfirm"/>
</el-card>
</template>

View File

@ -5,7 +5,7 @@
<select-menu
:data="testReviews"
:current-data="currentReview"
title="评审"
:title="$t('test_track.review_view.review')"
@dataChange="changeReview"/>
<node-tree class="node-tree"
v-loading="result.loading"

View File

@ -2,7 +2,7 @@
<div>
<el-dialog title="关联测试评审"
<el-dialog :title="$t('test_track.review_view.relevance_case')"
:visible.sync="dialogFormVisible"
@close="close"
width="60%" v-loading="result.loading"

View File

@ -5,13 +5,13 @@
<ms-table-header :is-tester-permission="true" :condition.sync="condition" @search="initTableData"
:show-create="false" :tip="$t('commons.search_by_name_or_id')">
<template v-slot:title>
<node-breadcrumb class="table-title" :nodes="selectParentNodes" @refresh="refresh" title="全部评审"/>
<node-breadcrumb class="table-title" :nodes="selectParentNodes" @refresh="refresh" :title="$t('test_track.review_view.all_review')"/>
</template>
<template v-slot:button>
<ms-table-button :is-tester-permission="true" icon="el-icon-video-play"
content="开始用例评审" @click="startReview"/>
:content="$t('test_track.review_view.start_review')" @click="startReview"/>
<ms-table-button :is-tester-permission="true" icon="el-icon-connection"
content="关联用例评审"
:content="$t('test_track.review_view.relevance_case')"
@click="$emit('openTestReviewRelevanceDialog')"/>
</template>
</ms-table-header>
@ -91,13 +91,13 @@
<el-table-column
prop="projectName"
:label="$t('test_track.plan.plan_project')"
:label="$t('test_track.review.review_project')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="reviewerName"
label="评审人"
:label="$t('test_track.review.review_creator')"
show-overflow-tooltip
>
</el-table-column>
@ -106,7 +106,7 @@
prop="status"
:filters="statusFilters"
column-key="status"
:label="$t('test_track.plan_view.execute_result')">
:label="$t('test_track.review_view.execute_result')">
<template v-slot:default="scope">
<span class="el-dropdown-link">
<status-table-item :value="scope.row.status"/>
@ -348,41 +348,10 @@ export default {
});
},
handleSelectAll(selection) {
if (selection.length > 0) {
if (selection.length === 1) {
this.selectRows.add(selection[0]);
} else {
this.tableData.forEach(item => {
this.$set(item, "showMore", true);
this.selectRows.add(item);
});
}
} else {
this.selectRows.clear();
this.tableData.forEach(row => {
this.$set(row, "showMore", false);
})
}
},
handleSelectionChange(selection, row) {
if (this.selectRows.has(row)) {
this.$set(row, "showMore", false);
this.selectRows.delete(row);
} else {
this.$set(row, "showMore", true);
this.selectRows.add(row);
}
let arr = Array.from(this.selectRows);
// 1
if (this.selectRows.size === 1) {
this.$set(arr[0], "showMore", false);
} else if (this.selectRows.size === 2) {
arr.forEach(row => {
this.$set(row, "showMore", true);
})
}
},
handleBatch(type) {
if (this.selectRows.size < 1) {

@ -1 +1 @@
Subproject commit 0a375848d034d20eaf05caf11769e1c75c39235c
Subproject commit f2d5a342c82e629f510550d5778d752bb73bf5e7

View File

@ -617,6 +617,7 @@ export default {
length_less_than: "The length less than",
recent_plan: "Recent plan",
recent_case: "Recent case",
recent_review: "Recent review",
pass_rate: "Pass rate",
execution_result: ": Please select the execution result",
actual_result: ": The actual result is empty",
@ -722,6 +723,28 @@ export default {
plan_delete_confirm: "All use cases under this plan will be deleted,confirm delete test plan: ",
plan_delete: "Delete test plan",
},
review: {
test_review: "Test Review",
create_review: "Create Review",
edit_review: "Edit Review",
review_name: "Name",
reviewer: "Reviewer",
review_project: "Project",
review_creator: "Creator",
review_status: "Status",
end_time: "EndTime",
delete: "Delete",
input_review_name: "Please enter the name of the review",
input_review_project: "Please select the project",
input_reviewer: "Please select reviewer",
},
review_view: {
review: "Review",
all_review: "All Review",
start_review: "Start Review",
relevance_case: "Relevance Case",
execute_result: "Result",
},
module: {
search: "Search module",
rename: "Rename",

View File

@ -619,6 +619,7 @@ export default {
length_less_than: "长度必须小于",
recent_plan: "最近的计划",
recent_case: "最近的用例",
recent_review: "最近的评审",
pass_rate: "通过率",
execution_result: ": 请选择执行结果",
actual_result: ": 实际结果为空",
@ -725,6 +726,28 @@ export default {
plan_delete_confirm: "将删除该测试计划下所有用例,确认删除测试计划: ",
plan_delete: "删除计划",
},
review: {
test_review: "用例评审",
create_review: "创建用例评审",
edit_review: "编辑用例评审",
review_name: "评审名称",
reviewer: "评审人",
review_project: "所属项目",
review_creator: "发起人",
review_status: "当前状态",
end_time: "截止时间",
delete: "删除评审",
input_review_name: "请输入评审名称",
input_review_project: "请选择所属项目",
input_reviewer: "请选择评审人",
},
review_view: {
review: "评审",
all_review: "全部评审",
start_review: "开始评审",
relevance_case: "关联用例",
execute_result: "执行结果",
},
module: {
search: "搜索模块",
rename: "重命名",

View File

@ -619,6 +619,7 @@ export default {
length_less_than: "長度必須小於",
recent_plan: "最近的計劃",
recent_case: "最近的用例",
recent_review: "最近的評審",
pass_rate: "通過率",
execution_result: ": 請選擇執行結果",
actual_result: ": 實際結果為空",
@ -725,6 +726,28 @@ export default {
plan_delete_confirm: "將刪除該測試計劃下所有用例,確認刪除測試計劃: ",
plan_delete: "刪除計劃",
},
review: {
test_review: "用例評審",
create_review: "創建用例評審",
edit_review: "編輯用例評審",
review_name: "評審名稱",
reviewer: "評審人",
review_project: "所屬項目",
review_creator: "發起人",
review_status: "當前狀態",
end_time: "截止時間",
delete: "刪除評審",
input_review_name: "請輸入評審名稱",
input_review_project: "請選擇所屬項目",
input_reviewer: "請選擇評審人",
},
review_view: {
review: "評審",
all_review: "全部評審",
start_review: "開始評審",
relevance_case: "關聯用例",
execute_result: "執行結果",
},
module: {
search: "搜索模塊",
rename: "重命名",