Merge remote-tracking branch 'origin/master'

This commit is contained in:
q4speed 2020-08-24 18:42:49 +08:00
commit abd9bad78b
13 changed files with 68 additions and 14 deletions

View File

@ -7,6 +7,7 @@
from test_case_issues, issues
where test_case_issues.issues_id = issues.id
and test_case_issues.test_case_id = #{caseId}
and issues.platform = #{platform};
and issues.platform = #{platform}
order by issues.create_time DESC
</select>
</mapper>

View File

@ -310,7 +310,11 @@ public class IssuesService {
return new Issues();
}
JSONObject jsonObject = JSONObject.parseObject(listJson);
return jsonObject.getObject("Bug", Issues.class);
JSONObject bug = jsonObject.getJSONObject("Bug");
Long created = bug.getLong("created");
Issues issues = jsonObject.getObject("Bug", Issues.class);
issues.setCreateTime(created);
return issues;
}
public Issues getJiraIssues(HttpHeaders headers, String url, String issuesId) {
@ -326,15 +330,23 @@ public class IssuesService {
JSONObject obj = JSONObject.parseObject(body);
JSONObject fields = (JSONObject) obj.get("fields");
JSONObject statusObj = (JSONObject) fields.get("status");
JSONObject assignee = (JSONObject) fields.get("assignee");
JSONObject statusCategory = (JSONObject) statusObj.get("statusCategory");
String id = obj.getString("id");
String title = fields.getString("summary");
String description = fields.getString("description");
String status = statusCategory.getString("key");
Long createTime = fields.getLong("created");
String lastmodify = "";
if (assignee != null) {
lastmodify = assignee.getString("displayName");
}
issues.setId(id);
issues.setTitle(title);
issues.setCreateTime(createTime);
issues.setLastmodify(lastmodify);
issues.setDescription(description);
issues.setStatus(status);
issues.setPlatform(IssuesManagePlatform.Jira.toString());

View File

@ -269,11 +269,17 @@ public class TestPlanService {
List<Issues> issue = issuesService.getIssues(testCase.getCaseId());
if (issue.size() > 0) {
for (Issues i : issue) {
i.setModel(testCase.getModel());
i.setModel(testCase.getNodePath());
String des = i.getDescription().replaceAll("<p>", "").replaceAll("</p>", "");
i.setDescription(des);
if (i.getLastmodify() == null || i.getLastmodify() == "") {
if (i.getReporter() != null || i.getReporter() != "") {
i.setLastmodify(i.getReporter());
}
}
}
issues.addAll(issue);
Collections.sort(issues, Comparator.comparing(Issues::getCreateTime, (t1, t2) -> t2.compareTo(t1)));
}
components.forEach(component -> {

View File

@ -20,7 +20,7 @@ create table if not exists issues
(
id varchar(50) not null
primary key,
title varchar(50) null,
title varchar(64) null,
description text null,
status varchar(50) null,
create_time bigint(13) null,

View File

@ -17,7 +17,7 @@
<slot name="button"></slot>
</span>
<span>
<ms-table-search-bar :condition.sync="condition" @change="search" class="search-bar"/>
<ms-table-search-bar :condition.sync="condition" @change="search" class="search-bar" :tip="tip"/>
<ms-table-adv-search-bar :condition.sync="condition" @search="search" v-if="isCombine"/>
</span>
</el-row>
@ -65,6 +65,12 @@
isTesterPermission: {
type: Boolean,
default: false
},
tip: {
String,
default() {
return this.$t('commons.search_by_name');
}
}
},
methods: {

View File

@ -4,7 +4,7 @@
class="search"
type="text"
size="small"
:placeholder="$t('commons.search_by_name')"
:placeholder="tip"
prefix-icon="el-icon-search"
@change="search"
maxlength="60"
@ -18,6 +18,12 @@
props: {
condition: {
type: Object
},
tip: {
String,
default() {
return this.$t('commons.search_by_name');
}
}
},
methods: {

View File

@ -4,7 +4,7 @@
<el-card class="card-content" v-loading="result.loading">
<template v-slot:header>
<ms-table-header :is-tester-permission="true" :condition.sync="condition" @search="initTableData"
<ms-table-header :is-tester-permission="true" :condition.sync="condition" @search="initTableData" :tip="$t('commons.search_by_name_or_id')"
:create-tip="$t('test_track.case.create')" @create="testCaseCreate">
<template v-slot:title>
<node-breadcrumb class="table-title" :nodes="selectParentNodes" @refresh="refresh"/>

View File

@ -137,6 +137,9 @@
this.getCaseNames();
}
},
updated() {
this.toggleSelection(this.testCases);
},
methods: {
openTestCaseRelevanceDialog() {
this.initData();
@ -178,7 +181,12 @@
this.selectIds.add(item.id);
});
} else {
this.selectIds.clear();
// this.selectIds.clear();
this.testCases.forEach(item => {
if (this.selectIds.has(item.id)) {
this.selectIds.delete(item.id);
}
});
}
},
handleSelectionChange(selection, row) {
@ -215,6 +223,16 @@
_filter(filters, this.condition);
this.initData();
},
toggleSelection(rows) {
rows.forEach(row => {
this.selectIds.forEach(id => {
if (row.id === id) {
// true
this.$refs.table.toggleRowSelection(row, true)
}
})
})
},
}
}
</script>

View File

@ -194,7 +194,7 @@
type="text"
:placeholder="$t('test_track.issue.input_title')"
v-model="testCase.issues.title"
maxlength="100"
maxlength="60"
show-word-limit
/>
<ckeditor :editor="editor" :disabled="isReadOnly" :config="editorConfig"
@ -404,7 +404,6 @@
this.activeTab = 'detail';
listenGoBack(this.handleClose);
this.initData(testCase);
this.getIssues(testCase.caseId);
},
initTest() {
this.$nextTick(() => {
@ -498,7 +497,10 @@
this.result = this.$post("/issues/add", param, () => {
this.$success(this.$t('commons.save_success'));
this.getIssues(param.testCaseId);
})
});
this.issuesSwitch = false;
this.testCase.issues.title = "";
this.testCase.issues.content = "";
},
getIssues(caseId) {
this.result = this.$get("/issues/get/" + caseId, response => {

View File

@ -32,9 +32,9 @@
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="reporter"
:label="$t('test_track.module.current_owner')"
show-overflow-tooltip>
prop="lastmodify"
:label="$t('test_track.module.current_owner')"
show-overflow-tooltip>
</el-table-column>
<el-table-column

View File

@ -60,6 +60,7 @@ export default {
not_filled: 'Not filled',
please_select: 'Please select',
search_by_name: 'Search by name',
search_by_name_or_id: 'Search by name or id',
personal_information: 'Personal Information',
exit_system: 'Exit System',
verification: 'Verification',

View File

@ -60,6 +60,7 @@ export default {
not_filled: '未填写',
please_select: '请选择',
search_by_name: '根据名称搜索',
search_by_name_or_id: '根据ID或名称搜索',
personal_information: '个人信息',
exit_system: '退出系统',
verification: '验证',

View File

@ -60,6 +60,7 @@ export default {
not_filled: '未填寫',
please_select: '請選擇',
search_by_name: '根據名稱搜索',
search_by_name_or_id: '根據ID或名稱搜索',
personal_information: '個人信息',
exit_system: '退出系統',
verification: '驗證',