fix: 测试用例关联缺陷列表状态没更新

This commit is contained in:
chenjianxing 2021-07-07 15:48:33 +08:00 committed by jianxing
parent 8d8073acfd
commit 25ddb59527
8 changed files with 46 additions and 9 deletions

View File

@ -18,6 +18,7 @@
issues.lastmodify
from issues
<include refid="queryWhereCondition"/>
and (issues.platform_status != 'delete' or issues.platform_status is NULL)
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/>
</select>
<select id="getNextNum" resultType="io.metersphere.base.domain.Issues">
@ -25,13 +26,14 @@
</select>
<select id="getRelateIssues" resultType="io.metersphere.base.domain.IssuesDao">
select issues.id, issues.num, issues.title, issues.project_id, issues.create_time, issues.update_time,
issues.description, issues.status, issues.platform, issues.custom_fields,test_case_issues.test_case_id,
issues.description, issues.status, issues.platform, issues.custom_fields,test_case_issues.test_case_id,issues.platform_status,
issues.lastmodify
from issues
left join
test_case_issues on issues.id = test_case_issues.issues_id
<include refid="queryWhereCondition"/>
and (test_case_issues.test_case_id is null or test_case_issues.test_case_id != #{request.caseId})
and (issues.platform_status != 'delete' or issues.platform_status is NULL)
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/>
</select>
<select id="getIssueForSync" resultType="io.metersphere.base.domain.IssuesDao">

View File

@ -4,10 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import io.metersphere.base.domain.IssuesDao;
import io.metersphere.base.domain.IssuesExample;
import io.metersphere.base.domain.Project;
import io.metersphere.base.domain.TestCaseWithBLOBs;
import io.metersphere.base.domain.*;
import io.metersphere.commons.constants.IssuesManagePlatform;
import io.metersphere.commons.constants.IssuesStatus;
import io.metersphere.commons.exception.MSException;
@ -143,13 +140,13 @@ public class ZentaoPlatform extends AbstractIssuePlatform {
}
IssuesDao issues = new IssuesDao();
issues.setId(bug.getId());
issues.setPlatformStatus(bug.getStatus());
if (StringUtils.equals(bug.getDeleted(),"1")) {
issues.setPlatformStatus(IssuesStatus.DELETE.toString());
issuesMapper.updateByPrimaryKeySelective(issues);
}
issues.setTitle(bug.getTitle());
issues.setDescription(steps);
issues.setPlatformStatus(bug.getStatus());
issues.setReporter(bug.getOpenedBy());
return issues;
}

View File

@ -31,6 +31,16 @@
</ms-table-column>
<ms-table-column
:label="$t('test_track.issue.platform_status')"
v-if="isThirdPart"
prop="platformStatus">
<template v-slot="scope">
{{ scope.row.platformStatus ? scope.row.platformStatus : '--'}}
</template>
</ms-table-column>
<ms-table-column
v-else
:label="$t('test_track.issue.status')"
prop="status">
<template v-slot="scope">
@ -79,7 +89,7 @@ export default {
return getCurrentProjectID();
}
},
props: ['caseId'],
props: ['caseId', 'isThirdPart'],
methods: {
open() {
this.getIssues();

View File

@ -30,6 +30,16 @@
</ms-table-column>
<ms-table-column
:label="$t('test_track.issue.platform_status')"
v-if="isThirdPart"
prop="platformStatus">
<template v-slot="scope">
{{ scope.row.platformStatus ? scope.row.platformStatus : '--'}}
</template>
</ms-table-column>
<ms-table-column
v-else
:label="$t('test_track.issue.status')"
prop="status">
<template v-slot="scope">
@ -66,7 +76,7 @@
</ms-table>
<test-plan-issue-edit :plan-id="planId" :case-id="caseId" @refresh="getIssues" ref="issueEdit"/>
<IssueRelateList :case-id="caseId" @refresh="getIssues" ref="issueRelate"/>
<IssueRelateList :is-third-part="isThirdPart" :case-id="caseId" @refresh="getIssues" ref="issueRelate"/>
</div>
</template>
@ -78,6 +88,7 @@ import IssueDescriptionTableItem from "@/business/components/track/issue/IssueDe
import {ISSUE_STATUS_MAP} from "@/common/js/table-constants";
import IssueRelateList from "@/business/components/track/case/components/IssueRelateList";
import {getIssuesByCaseId} from "@/network/Issue";
import {getIssueTemplate} from "@/network/custom-field-template";
export default {
name: "TestCaseIssueRelate",
components: {IssueRelateList, IssueDescriptionTableItem, MsTableColumn, MsTable, TestPlanIssueEdit},
@ -87,6 +98,7 @@ export default {
data: [],
result: {},
},
isThirdPart: false
}
},
props: ['caseId', 'readOnly','planId'],
@ -95,6 +107,16 @@ export default {
return ISSUE_STATUS_MAP;
},
},
created() {
getIssueTemplate()
.then((template) => {
if (template.platform === 'metersphere') {
this.isThirdPart = false;
} else {
this.isThirdPart = true;
}
});
},
methods: {
getIssues() {
let result = getIssuesByCaseId(this.caseId, this.page);

View File

@ -69,8 +69,11 @@
<ms-table-column
:field="item"
:fields-width="fieldsWidth"
:label="$t('test_track.issue.status')"
:label="$t('test_track.issue.platform_status') "
prop="platformStatus">
<template v-slot="scope">
{{ scope.row.platformStatus ? scope.row.platformStatus : '--'}}
</template>
</ms-table-column>
<ms-table-column

View File

@ -1618,6 +1618,7 @@ export default {
issue: {
issue: "Issue",
issue_management: "Issue Management",
platform_status: "Platform Status",
issue_resource: "Issue source",
create_issue: "Create Issue",
add_issue: "Add Issue",

View File

@ -1622,6 +1622,7 @@ export default {
issue: {
issue: "缺陷",
issue_management: "缺陷管理",
platform_status: "平台状态",
issue_resource: "缺陷来源",
create_issue: "创建缺陷",
add_issue: "添加缺陷",

View File

@ -1622,6 +1622,7 @@ export default {
issue: {
issue: "缺陷",
issue_management: "缺陷管理",
platform_status: "平臺狀態",
issue_resource: "缺陷來源",
create_issue: "創建缺陷",
add_issue: "添加缺陷",