diff --git a/test-track/frontend/src/business/case/components/TestCaseList.vue b/test-track/frontend/src/business/case/components/TestCaseList.vue index 983caaa045..929860a838 100644 --- a/test-track/frontend/src/business/case/components/TestCaseList.vue +++ b/test-track/frontend/src/business/case/components/TestCaseList.vue @@ -312,7 +312,7 @@ import { getCustomFieldValueForTrack, getProjectMemberOption } from "@/business/utils/sdk-utils"; -import {initTestCaseConditionComponents, openCaseEdit} from "@/business/case/test-case"; +import {getTagToolTips, initTestCaseConditionComponents, openCaseEdit, parseColumnTag} from "@/business/case/test-case"; export default { @@ -628,25 +628,10 @@ export default { }); }, getTagToolTips(tags) { - try { - let showTips = ''; - tags.forEach((item) => { - showTips += item + ','; - }); - return showTips.substr(0, showTips.length - 1); - } catch (e) { - return ''; - } + return getTagToolTips(tags); }, parseColumnTag(tags) { - if (tags.length > 1) { - let parseTags = []; - parseTags.push(tags[0]); - parseTags.push("+" + (tags.length - 1)); - return parseTags; - } else { - return tags; - } + return parseColumnTag(tags); }, initConditionComponents() { this.condition.components = initTestCaseConditionComponents(this.condition, this.testCaseTemplate.customFields, this.trashEnable); diff --git a/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue b/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue index b8fb4a9bed..93cf126228 100644 --- a/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue +++ b/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue @@ -143,9 +143,20 @@ :label="$t('commons.tag')" min-width="80"> @@ -240,7 +251,7 @@ import {useStore} from "@/store"; import {getProjectMemberUserFilter} from "@/api/user"; import TypeTableItem from "@/business/common/tableItems/planview/TypeTableItem"; import {getVersionFilters} from "@/business/utils/sdk-utils"; -import {openCaseEdit} from "@/business/case/test-case"; +import {getTagToolTips, openCaseEdit, parseColumnTag} from "@/business/case/test-case"; import PublicTestCaseShow from "@/business/case/components/public/PublicTestCaseShow" @@ -503,6 +514,12 @@ export default { }) } }, + getTagToolTips(tags) { + return getTagToolTips(tags); + }, + parseColumnTag(tags) { + return parseColumnTag(tags); + }, isOwner(testCase) { return testCase.maintainer === this.currentUser || testCase.createUser === this.currentUser; }, diff --git a/test-track/frontend/src/business/case/test-case.js b/test-track/frontend/src/business/case/test-case.js index ecc05e3dec..ef23efaa3a 100644 --- a/test-track/frontend/src/business/case/test-case.js +++ b/test-track/frontend/src/business/case/test-case.js @@ -96,3 +96,27 @@ export function openCaseCreate(query, v) { }); window.open(TestCaseData.href, '_blank'); } + +export function getTagToolTips(tags) { + try { + let showTips = ''; + tags.forEach((item) => { + showTips += item + ','; + }); + return showTips.substr(0, showTips.length - 1); + } catch (e) { + return ''; + } +} + + +export function parseColumnTag(tags) { + if (tags.length > 1) { + let parseTags = []; + parseTags.push(tags[0]); + parseTags.push("+" + (tags.length - 1)); + return parseTags; + } else { + return tags; + } +}