fix(测试跟踪): 公共用例显示信息有误

--bug=1024428 --user=宋昌昌 【测试跟踪】公共用例库-查看用例,显示信息有误 https://www.tapd.cn/55049933/s/1351406
This commit is contained in:
song-cc-rock 2023-03-16 14:37:00 +08:00 committed by jianxing
parent cc06e1a758
commit c1010441cb
5 changed files with 33 additions and 29 deletions

View File

@ -59,6 +59,7 @@ export default {
default: false, default: false,
}, },
apiUrl: String, apiUrl: String,
isPublicShow: Boolean
}, },
watch: { watch: {
"comment.description": { "comment.description": {
@ -83,6 +84,9 @@ export default {
return name.substring(0, 2).toUpperCase(); return name.substring(0, 2).toUpperCase();
}, },
openEdit() { openEdit() {
if (this.isPublicShow) {
return;
}
if (getCurrentUser().id !== this.comment.author) { if (getCurrentUser().id !== this.comment.author) {
this.$warning(this.$t("test_track.comment.cannot_edit"), false); this.$warning(this.$t("test_track.comment.cannot_edit"), false);
return; return;
@ -97,6 +101,9 @@ export default {
this.editComment(description); this.editComment(description);
}, },
deleteComment() { deleteComment() {
if (this.isPublicShow) {
return;
}
if (getCurrentUser().id !== this.comment.author) { if (getCurrentUser().id !== this.comment.author) {
this.$warning(this.$t("test_track.comment.cannot_delete"), false); this.$warning(this.$t("test_track.comment.cannot_delete"), false);
return; return;

View File

@ -11,6 +11,7 @@
api-url="/test/case" api-url="/test/case"
@refresh="getComments" @refresh="getComments"
:readOnly="readOnly" :readOnly="readOnly"
:is-public-show="isPublicShow"
></case-comment-view-item> ></case-comment-view-item>
</div> </div>
</div> </div>
@ -25,6 +26,7 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
isPublicShow: Boolean
}, },
components: { components: {
CaseCommentViewItem, CaseCommentViewItem,

View File

@ -99,7 +99,7 @@
</el-scrollbar> </el-scrollbar>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('case.comment')" name="comment" v-if="!isPublicShow"> <el-tab-pane :label="$t('case.comment')" name="comment">
<span slot="label"> <span slot="label">
{{ $t('case.comment') }} {{ $t('case.comment') }}
<div class="el-step__icon is-text ms-api-col ms-header" v-if="comments && comments.length > 0"> <div class="el-step__icon is-text ms-api-col ms-header" v-if="comments && comments.length > 0">
@ -113,6 +113,7 @@
<el-scrollbar> <el-scrollbar>
<div class="content-container"> <div class="content-container">
<case-comment-viewer <case-comment-viewer
:is-public-show="isPublicShow"
@getComments="getComments" @getComments="getComments"
:comments="comments" :comments="comments"
ref="commentRef" ref="commentRef"
@ -138,7 +139,7 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<div class="comment-common"> <div class="comment-common" v-if="!isPublicShow">
<case-comment-component <case-comment-component
:case-id="caseId" :case-id="caseId"
:read-only="readOnly" :read-only="readOnly"

View File

@ -10,28 +10,11 @@
:screen-height="null" :screen-height="null"
@refresh="getTableData" @refresh="getTableData"
> >
<ms-table-column
min-width="200px"
width="200px"
v-if="relationshipType === 'POST'"
:label="$t('commons.relationship.type')"
>
<template>
<div class="pos-label">
{{ $t("commons.relationship.current_case") }}
</div>
<div class="pos-type pos-left-margin">
{{ $t("commons.relationship.after_finish") }}
</div>
</template>
</ms-table-column>
<ms-table-column <ms-table-column
prop="targetCustomNum" prop="targetCustomNum"
v-if="isCustomNum" v-if="isCustomNum"
:label="$t('commons.id')" :label="$t('commons.id')"
sortable sortable
min-width="100px"
width="100px" width="100px"
/> />
@ -40,7 +23,6 @@
v-else v-else
:label="$t('commons.id')" :label="$t('commons.id')"
sortable sortable
min-width="100px"
width="100px" width="100px"
/> />
@ -48,8 +30,7 @@
prop="targetName" prop="targetName"
:label="$t('case.case_name')" :label="$t('case.case_name')"
sortable sortable
min-width="256px" width="200px"
width="256px"
/> />
<ms-table-column <ms-table-column
@ -57,7 +38,6 @@
prop="versionId" prop="versionId"
:label="$t('commons.version')" :label="$t('commons.version')"
sortable sortable
min-width="100px"
width="100px" width="100px"
> >
<template v-slot:default="scope"> <template v-slot:default="scope">
@ -68,13 +48,12 @@
<ms-table-column <ms-table-column
prop="creator" prop="creator"
:label="$t('commons.create_user')" :label="$t('commons.create_user')"
min-width="120" width="100"
> >
</ms-table-column> </ms-table-column>
<ms-table-column <ms-table-column
prop="status" prop="status"
min-width="100px"
width="100px" width="100px"
:label="$t('api_test.definition.api_case_status')" :label="$t('api_test.definition.api_case_status')"
> >
@ -82,9 +61,9 @@
<status-table-item :value="$t(statusMap.get(row.status))" /> <status-table-item :value="$t(statusMap.get(row.status))" />
</template> </template>
</ms-table-column> </ms-table-column>
<ms-table-column <ms-table-column
width="200px" width="150px"
min-width="200px"
v-if="relationshipType === 'PRE'" v-if="relationshipType === 'PRE'"
:label="$t('commons.relationship.type')" :label="$t('commons.relationship.type')"
> >
@ -99,6 +78,21 @@
</ms-table-column> </ms-table-column>
</ms-table> </ms-table>
<ms-table-column
width="150px"
v-if="relationshipType === 'POST'"
:label="$t('commons.relationship.type')"
>
<template>
<div class="pos-label">
{{ $t("commons.relationship.current_case") }}
</div>
<div class="pos-type pos-left-margin">
{{ $t("commons.relationship.after_finish") }}
</div>
</template>
</ms-table-column>
<relationship-functional-relevance <relationship-functional-relevance
:case-id="caseId" :case-id="caseId"
:version-enable="versionEnable" :version-enable="versionEnable"

View File

@ -22,7 +22,7 @@
</el-col> </el-col>
<el-col :span="12" :offset="1"> <el-col :span="12" :offset="1">
<el-form-item :label="$t('commons.tag')" :label-width="formLabelWidth" prop="tag"> <el-form-item :label="$t('commons.tag')" :label-width="formLabelWidth" prop="tag">
<ms-input-tag :currentScenario="form" ref="tag" size="-" v-if="isStepTableAlive"/> <ms-input-tag :currentScenario="form" ref="tag" v-if="isStepTableAlive"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -125,7 +125,7 @@
import TestPlanStatusButton from "../../plan/common/TestPlanStatusButton"; import TestPlanStatusButton from "../../plan/common/TestPlanStatusButton";
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token"; import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
import {listenGoBack, removeGoBackListener} from "metersphere-frontend/src/utils" import {listenGoBack, removeGoBackListener} from "metersphere-frontend/src/utils"
import MsInputTag from "metersphere-frontend/src/components/MsInputTag"; import MsInputTag from "metersphere-frontend/src/components/new-ui/MsInputTag";
import i18n from "@/i18n"; import i18n from "@/i18n";
import {getMaintainer} from "@/api/project"; import {getMaintainer} from "@/api/project";
import {saveOrUpdateTestCaseReview} from "@/api/test-review"; import {saveOrUpdateTestCaseReview} from "@/api/test-review";