fix(测试跟踪):1新增关联用例导致用例评审状态变更,2复制用例标题超长展示错位

--bug=1024444 --user=王旭 【测试跟踪】用例评审-关联垮项目用例-用例评审结果为终态-评审列表状态仍为进行中 https://www.tapd.cn/55049933/s/1350520

--bug=1024244 --user=王旭 【测试跟踪】用例复制,标题为超长文本时复制展示错位 https://www.tapd.cn/55049933/s/1350513
This commit is contained in:
WangXu10 2023-03-15 15:09:44 +08:00 committed by fit2-zhao
parent d3c2fba41b
commit df74750df6
7 changed files with 52 additions and 26 deletions

View File

@ -104,9 +104,5 @@ public class TestReviewTestCaseController {
testReviewTestCaseService.updateOrder(request); testReviewTestCaseService.updateOrder(request);
} }
@GetMapping("/auto-check/{caseId}")
public void autoCheck(@PathVariable String caseId) {
testReviewTestCaseService.checkStatus(caseId);
}
} }

View File

@ -144,6 +144,9 @@ public class TestCaseReviewService {
request.setReviewerId(SessionUtils.getUserId()); request.setReviewerId(SessionUtils.getUserId());
} }
List<TestCaseReviewDTO> list = extTestCaseReviewMapper.list(request); List<TestCaseReviewDTO> list = extTestCaseReviewMapper.list(request);
list.forEach(testCaseReviewDTO -> {
testReviewTestCaseService.checkStatus(testCaseReviewDTO);
});
calcReviewRate(list); calcReviewRate(list);
setReviews(list); setReviews(list);
return list; return list;
@ -521,11 +524,11 @@ public class TestCaseReviewService {
} }
TestCaseReview testCaseReview = testCaseReviewMapper.selectByPrimaryKey(request.getReviewId()); TestCaseReview testCaseReview = testCaseReviewMapper.selectByPrimaryKey(request.getReviewId());
if (StringUtils.equals(testCaseReview.getStatus(), TestCaseReviewStatus.Prepare.name()) if (StringUtils.equals(testCaseReview.getStatus(), TestCaseReviewStatus.Prepare.name())) {
|| StringUtils.equals(testCaseReview.getStatus(), TestCaseReviewStatus.Completed.name())) {
testCaseReview.setStatus(TestCaseReviewStatus.Underway.name()); testCaseReview.setStatus(TestCaseReviewStatus.Underway.name());
testCaseReviewMapper.updateByPrimaryKey(testCaseReview); testCaseReviewMapper.updateByPrimaryKey(testCaseReview);
} }
} }
public List<String> getTestCaseReviewerIds(String reviewId) { public List<String> getTestCaseReviewerIds(String reviewId) {

View File

@ -15,6 +15,7 @@ import io.metersphere.constants.TestCaseCommentType;
import io.metersphere.constants.TestCaseReviewCommentStatus; import io.metersphere.constants.TestCaseReviewCommentStatus;
import io.metersphere.constants.TestCaseReviewPassRule; import io.metersphere.constants.TestCaseReviewPassRule;
import io.metersphere.dto.TestCaseCommentDTO; import io.metersphere.dto.TestCaseCommentDTO;
import io.metersphere.dto.TestCaseReviewDTO;
import io.metersphere.dto.TestReviewCaseDTO; import io.metersphere.dto.TestReviewCaseDTO;
import io.metersphere.excel.converter.TestReviewCaseStatus; import io.metersphere.excel.converter.TestReviewCaseStatus;
import io.metersphere.log.vo.DetailColumn; import io.metersphere.log.vo.DetailColumn;
@ -768,16 +769,16 @@ public class TestReviewTestCaseService {
/** /**
* 检查执行结果自动更新计划状态 * 检查执行结果自动更新计划状态
* @param caseId * @param testCaseReviewDTO
*/ */
public void checkStatus(String caseId) { public void checkStatus(TestCaseReviewDTO testCaseReviewDTO) {
TestCaseReview testCaseReview = testCaseReviewMapper.selectByPrimaryKey(caseId); if (testCaseReviewDTO.getEndTime() != null && testCaseReviewDTO.getEndTime() < System.currentTimeMillis() && !testCaseReviewDTO.getStatus().equals(TestPlanStatus.Finished.name())) {
if (testCaseReview.getEndTime() != null && testCaseReview.getEndTime() < System.currentTimeMillis()) {
TestCaseReviewExample example = new TestCaseReviewExample(); TestCaseReviewExample example = new TestCaseReviewExample();
example.createCriteria().andIdEqualTo(caseId); example.createCriteria().andIdEqualTo(testCaseReviewDTO.getId());
TestCaseReview review = new TestCaseReview(); TestCaseReview review = new TestCaseReview();
review.setStatus(TestPlanStatus.Finished.name()); review.setStatus(TestPlanStatus.Finished.name());
testCaseReviewMapper.updateByExampleSelective(review,example); testCaseReviewMapper.updateByExampleSelective(review,example);
testCaseReviewDTO.setStatus(TestPlanStatus.Finished.name());
} }
} }
} }

View File

@ -273,6 +273,3 @@ export function checkProjectPermission(projectId) {
return get(BASE_URL + "check/permission/" + projectId); return get(BASE_URL + "check/permission/" + projectId);
} }
export function testCaseAutoCheck(caseId) {
return get(`/test/review/case/auto-check/${caseId}`);
}

View File

@ -1,12 +1,23 @@
<template> <template>
<div v-if="dialogVisible" class="batch-move" v-loading="result.loading"> <div v-if="dialogVisible" class="batch-move" v-loading="result.loading">
<el-dialog :title="this.$t(isMoveBatch ? 'test_track.case.batch_move_to' : 'test_track.case.batch_copy_to', [moveCaseTitle, selectNum])" <el-dialog
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
:before-close="close" :before-close="close"
:destroy-on-close="true" :destroy-on-close="true"
width="40%" width="40%"
append-to-body append-to-body
:close-on-click-modal="false"> :close-on-click-modal="false">
<el-tooltip :content="contentTitle" placement="top" width="width" v-if="!publicEnable">
<span class="tooltipStyle" v-if="isMoveBatch">"{{moveCaseTitle|ellipsis}}"{{selectNum}}个用例 移动到</span>
<span class="tooltipStyle" v-else>"{{moveCaseTitle|ellipsis}}"{{selectNum}}个用例 复制到</span>
</el-tooltip>
<el-tooltip :content="contentTitle" placement="top" width="width" v-else>
<span class="tooltipStyle" v-if="selectNum>1">"{{moveCaseTitle|ellipsis}}"{{selectNum}}个用例 复制到</span>
<span class="tooltipStyle" v-else>"{{moveCaseTitle|ellipsis}}" 复制到</span>
</el-tooltip>
<el-input :placeholder="$t('test_track.module.search_by_name')" v-model="filterText" size="small" prefix-icon="el-icon-search"/> <el-input :placeholder="$t('test_track.module.search_by_name')" v-model="filterText" size="small" prefix-icon="el-icon-search"/>
<el-scrollbar style="margin-top: 12px; border: 1px solid #DEE0E3; border-radius: 4px;"> <el-scrollbar style="margin-top: 12px; border: 1px solid #DEE0E3; border-radius: 4px;">
@ -62,7 +73,8 @@ export default {
filterText: "", filterText: "",
result: {}, result: {},
isMoveBatch: false, isMoveBatch: false,
selectNum: 0 selectNum: 0,
contentTitle:""
} }
}, },
props: { props: {
@ -85,6 +97,7 @@ export default {
this.selectNum = selectNum; this.selectNum = selectNum;
this.selectIds = selectIds; this.selectIds = selectIds;
this.moduleOptions = moduleOptions; this.moduleOptions = moduleOptions;
this.contentTitle = this.$t(this.isMoveBatch ? 'test_track.case.batch_move_to' : 'test_track.case.batch_copy_to', [this.moveCaseTitle, this.selectNum]);
}, },
save() { save() {
if (!this.currentKey) { if (!this.currentKey) {
@ -123,6 +136,18 @@ export default {
nodeClick() { nodeClick() {
this.currentKey = this.$refs.tree.getCurrentKey(); this.currentKey = this.$refs.tree.getCurrentKey();
} }
},
filters: {
//使...
ellipsis(value) {
if (!value) {
return '';
}
if (value.length > 20) {
return value.slice(0, 20) + '...';
}
return value;
}
} }
} }
</script> </script>
@ -191,4 +216,16 @@ export default {
height: 32px; height: 32px;
border-radius: 4px; border-radius: 4px;
} }
.tooltipStyle{
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
white-space:nowrap;
width:100%;
height:34px;
display: inline-block;
title:content;
font-size: x-large;
}
</style> </style>

View File

@ -1780,7 +1780,7 @@ export default {
color: #646a73; color: #646a73;
align-items: center; align-items: center;
margin-left: px2rem(8); margin-left: px2rem(8);
padding: 0 0.5rem; padding: -1 0.5rem;
.version-icon { .version-icon {
width: 20.17px; width: 20.17px;

View File

@ -195,7 +195,7 @@ import MsTable from "metersphere-frontend/src/components/table/MsTable";
import MsTableColumn from "metersphere-frontend/src/components/table/MsTableColumn"; import MsTableColumn from "metersphere-frontend/src/components/table/MsTableColumn";
import MsTableHeaderSelectPopover from "metersphere-frontend/src/components/table/MsTableHeaderSelectPopover"; import MsTableHeaderSelectPopover from "metersphere-frontend/src/components/table/MsTableHeaderSelectPopover";
import HeaderLabelOperate from "metersphere-frontend/src/components/head/HeaderLabelOperate"; import HeaderLabelOperate from "metersphere-frontend/src/components/head/HeaderLabelOperate";
import {editTestReviewTestCaseOrder, getTestReviewTestCase,testCaseAutoCheck} from "@/api/testCase"; import {editTestReviewTestCaseOrder, getTestReviewTestCase} from "@/api/testCase";
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token"; import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
import {hasLicense} from "metersphere-frontend/src/utils/permission"; import {hasLicense} from "metersphere-frontend/src/utils/permission";
import TestCaseReviewStatusTableItem from "@/business/common/tableItems/TestCaseReviewStatusTableItem"; import TestCaseReviewStatusTableItem from "@/business/common/tableItems/TestCaseReviewStatusTableItem";
@ -404,7 +404,6 @@ export default {
this.$refs.headerCustom.open(list); this.$refs.headerCustom.open(list);
}, },
initTableData(callback) { initTableData(callback) {
this.autoCheckStatus();
initCondition(this.condition, this.condition.selectAll); initCondition(this.condition, this.condition.selectAll);
if (this.reviewId) { if (this.reviewId) {
this.condition.reviewId = this.reviewId; this.condition.reviewId = this.reviewId;
@ -436,13 +435,6 @@ export default {
this.getNexPageData(); this.getNexPageData();
} }
}, },
autoCheckStatus() {
//
if (!this.reviewId) {
return;
}
testCaseAutoCheck(this.reviewId);
},
getNexPageData() { getNexPageData() {
getTestReviewTestCase(this.currentPage * this.pageSize + 1, 1, this.condition) getTestReviewTestCase(this.currentPage * this.pageSize + 1, 1, this.condition)
.then((response) => { .then((response) => {