From bf1bc4a67788dd25c2809c460e9c4e1ab1a7e466 Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Mon, 26 Aug 2024 18:06:09 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=96=B0=E5=BB=BA=E7=BC=BA?= =?UTF-8?q?=E9=99=B7=E6=8A=BD=E5=B1=89=E9=A1=B5=E9=9D=A2=E8=B0=83=E6=95=B4?= =?UTF-8?q?&=E5=85=B3=E8=81=94=E7=BC=BA=E9=99=B7=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/modules/test-plan/testPlan.ts | 5 + .../src/api/requrls/test-plan/testPlan.ts | 2 + .../business/ms-bug-operation/index.vue | 5 +- .../ms-minders/featureCaseMinder/bugList.vue | 4 +- .../testPlanFeatureCaseMinder/index.vue | 4 +- frontend/src/enums/associateBugEnum.ts | 7 + .../views/bug-management/createAndEditBug.vue | 4 +- frontend/src/views/bug-management/edit.vue | 13 +- .../tabContent/tabBug/addDefectDrawer.vue | 245 +++++++----------- .../tabContent/tabBug/tabDefect.vue | 14 +- .../linkDefectDrawer.vue | 68 ++++- .../detail/apiCase/components/caseTable.vue | 60 ++++- .../apiScenario/components/scenarioTable.vue | 53 ++++ .../detail/bugManagement/caseCountPopover.vue | 6 + .../featureCase/components/caseTable.vue | 105 +++++++- .../detail/featureCase/detail/index.vue | 4 +- .../views/test-plan/testPlan/detail/index.vue | 23 ++ .../views/test-plan/testPlan/locale/en-US.ts | 1 + .../views/test-plan/testPlan/locale/zh-CN.ts | 1 + 19 files changed, 427 insertions(+), 197 deletions(-) create mode 100644 frontend/src/enums/associateBugEnum.ts rename frontend/src/views/case-management/{caseManagementFeature/components/tabContent/tabBug => components}/linkDefectDrawer.vue (71%) diff --git a/frontend/src/api/modules/test-plan/testPlan.ts b/frontend/src/api/modules/test-plan/testPlan.ts index 6ff6a5ac8e..8f534d5e9c 100644 --- a/frontend/src/api/modules/test-plan/testPlan.ts +++ b/frontend/src/api/modules/test-plan/testPlan.ts @@ -56,6 +56,7 @@ import { GetTestPlanModuleCountUrl, GetTestPlanModuleUrl, GetTestPlanUsersUrl, + GetUnAssociatedListUrl, MoveTestPlanModuleUrl, planDetailBugPageUrl, PlanDetailExecuteHistoryUrl, @@ -438,3 +439,7 @@ export function testPlanAssociateModuleCount(data: TableQueryParams) { export function getExecuteUserOption(projectId: string, keyword?: string) { return MSR.get({ url: `${GetTestPlanExecutorOptionsUrl}/${projectId}`, params: { keyword } }); } +// 获取测试计划未关联抽屉缺陷列表 +export function getTestPlanBugPage(data: TableQueryParams) { + return MSR.post>({ url: GetUnAssociatedListUrl, data }); +} diff --git a/frontend/src/api/requrls/test-plan/testPlan.ts b/frontend/src/api/requrls/test-plan/testPlan.ts index 82f93bb09e..76dbada689 100644 --- a/frontend/src/api/requrls/test-plan/testPlan.ts +++ b/frontend/src/api/requrls/test-plan/testPlan.ts @@ -155,3 +155,5 @@ export const EditPlanMinderUrl = '/test-plan/mind/data/edit'; export const TestPlanAssociationUrl = '/test-plan/association/api/case/module/count'; // 获取执行人下拉选项 export const GetTestPlanExecutorOptionsUrl = '/test-plan-execute/user-option'; +// 获取测试计划未关联缺陷列表 +export const GetUnAssociatedListUrl = '/test-plan/functional/case/associate/bug/page'; diff --git a/frontend/src/components/business/ms-bug-operation/index.vue b/frontend/src/components/business/ms-bug-operation/index.vue index 24f5870ee2..4339852fce 100644 --- a/frontend/src/components/business/ms-bug-operation/index.vue +++ b/frontend/src/components/business/ms-bug-operation/index.vue @@ -16,7 +16,7 @@ - + diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/tabDefect.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/tabDefect.vue index 6da052c2e1..433999de8c 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/tabDefect.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/tabDefect.vue @@ -106,15 +106,11 @@ - + @@ -135,9 +131,9 @@ import useTable from '@/components/pure/ms-table/useTable'; import AddDefectDrawer from './addDefectDrawer.vue'; import BugList from './bugList.vue'; - import LinkDefectDrawer from './linkDefectDrawer.vue'; import BugNamePopover from '@/views/case-management/caseManagementFeature/components/tabContent/tabBug/bugNamePopover.vue'; import TableFilter from '@/views/case-management/caseManagementFeature/components/tableFilter.vue'; + import LinkDefectDrawer from '@/views/case-management/components/linkDefectDrawer.vue'; import { getBugList, getCustomOptionHeader } from '@/api/modules/bug-management'; import { @@ -148,11 +144,11 @@ import { useI18n } from '@/hooks/useI18n'; import { useAppStore } from '@/store'; import useFeatureCaseStore from '@/store/modules/case/featureCase'; - import { characterLimit } from '@/utils'; import { hasAnyPermission } from '@/utils/permission'; import { BugListItem, BugOptionItem } from '@/models/bug-management'; import type { TableQueryParams } from '@/models/common'; + import { AssociatedBugApiTypeEnum } from '@/enums/associateBugEnum'; import { TestPlanRouteEnum } from '@/enums/routeEnum'; import { makeColumns } from '@/views/case-management/caseManagementFeature/components/utils'; @@ -360,6 +356,7 @@ getFetch(); } } catch (error) { + // eslint-disable-next-line no-console console.log(error); } finally { cancelLoading.value = false; @@ -386,6 +383,7 @@ getFetch(); showLinkDrawer.value = false; } catch (error) { + // eslint-disable-next-line no-console console.log(error); } finally { drawerLoading.value = false; diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/linkDefectDrawer.vue b/frontend/src/views/case-management/components/linkDefectDrawer.vue similarity index 71% rename from frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/linkDefectDrawer.vue rename to frontend/src/views/case-management/components/linkDefectDrawer.vue index 585de84268..8512aa3d8b 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/linkDefectDrawer.vue +++ b/frontend/src/views/case-management/components/linkDefectDrawer.vue @@ -4,7 +4,7 @@ :mask="true" :title="t('caseManagement.featureCase.linkDefect')" :ok-text="t('caseManagement.featureCase.associated')" - :ok-disabled="propsRes.selectedKeys.size === 0" + :ok-disabled="currentCaseTable.propsRes.value.selectedKeys.size === 0" :width="1200" :mask-closable="true" unmount-on-close @@ -29,15 +29,15 @@ @@ -52,10 +52,13 @@ import useTable from '@/components/pure/ms-table/useTable'; import BugNamePopover from '@/views/case-management/caseManagementFeature/components/tabContent/tabBug/bugNamePopover.vue'; + import { getBugList } from '@/api/modules/bug-management'; import { getDrawerDebugPage } from '@/api/modules/case-management/featureCase'; + import { getTestPlanBugPage } from '@/api/modules/test-plan/testPlan'; import { useI18n } from '@/hooks/useI18n'; import { useAppStore } from '@/store'; + import { AssociatedBugApiTypeEnum } from '@/enums/associateBugEnum'; import { TableKeyEnum } from '@/enums/tableEnum'; import debounce from 'lodash-es/debounce'; @@ -63,13 +66,21 @@ const { t } = useI18n(); const appStore = useAppStore(); + const getModuleTreeApiMap: Record = { + [AssociatedBugApiTypeEnum.FUNCTIONAL_BUG_LIST]: getDrawerDebugPage, // 功能用例-关联缺陷 + [AssociatedBugApiTypeEnum.TEST_PLAN_BUG_LIST]: getTestPlanBugPage, // 测试计划-关联缺陷 + [AssociatedBugApiTypeEnum.BUG_TOTAL_LIST]: getBugList, // 总缺陷列表 + }; + const currentProjectId = computed(() => appStore.currentProjectId); const props = withDefaults( defineProps<{ - visible: boolean; - caseId: string; + loadApi: AssociatedBugApiTypeEnum; // 关联缺陷接口类型 drawerLoading: boolean; + visible: boolean; + caseId?: string; // 用例id + isBatch?: boolean; showSelectorAll?: boolean; }>(), { @@ -140,8 +151,8 @@ }, ]; - const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector } = useTable( - getDrawerDebugPage, + const getTotalBugTable = useTable( + getModuleTreeApiMap[AssociatedBugApiTypeEnum.BUG_TOTAL_LIST], { scroll: { x: '100%' }, columns, @@ -163,6 +174,33 @@ } ); + const getSingleBugTable = useTable( + getModuleTreeApiMap[props.loadApi], + { + scroll: { x: '100%' }, + columns, + tableKey: TableKeyEnum.CASE_MANAGEMENT_TAB_DEFECT, + selectable: true, + showSelectorAll: props.showSelectorAll, + heightUsed: 340, + }, + (record) => { + return { + ...record, + tags: (record.tags || []).map((item: string, i: number) => { + return { + id: `${record.id}-${i}`, + name: item, + }; + }), + }; + } + ); + + const currentCaseTable = computed(() => { + return props.isBatch ? getTotalBugTable : getSingleBugTable; + }); + const keyword = ref(''); const showDrawer = computed({ @@ -175,7 +213,7 @@ }); function handleDrawerConfirm() { - const { excludeKeys, selectedKeys, selectorStatus } = propsRes.value; + const { excludeKeys, selectedKeys, selectorStatus } = currentCaseTable.value.propsRes.value; const params = { excludeIds: [...excludeKeys], selectIds: selectorStatus === 'all' ? [] : [...selectedKeys], @@ -192,12 +230,16 @@ } function handleDrawerCancel() { - resetSelector(); + currentCaseTable.value.resetSelector(); } function getFetch() { - setLoadListParams({ keyword: keyword.value, projectId: currentProjectId.value, sourceId: props.caseId }); - loadList(); + currentCaseTable.value.setLoadListParams({ + keyword: keyword.value, + projectId: currentProjectId.value, + sourceId: props.caseId, + }); + currentCaseTable.value.loadList(); } const searchList = debounce(() => { @@ -208,7 +250,7 @@ () => props.visible, (val) => { if (val) { - resetSelector(); + currentCaseTable.value.resetSelector(); getFetch(); } } diff --git a/frontend/src/views/test-plan/testPlan/detail/apiCase/components/caseTable.vue b/frontend/src/views/test-plan/testPlan/detail/apiCase/components/caseTable.vue index cbfa445c86..26597e7bca 100644 --- a/frontend/src/views/test-plan/testPlan/detail/apiCase/components/caseTable.vue +++ b/frontend/src/views/test-plan/testPlan/detail/apiCase/components/caseTable.vue @@ -43,6 +43,10 @@ :bug-list="record.bugList" :resource-id="record.id" :bug-count="record.bugCount || 0" + :existed-defect="existedDefect" + @load-list="loadList" + @associated="associatedDefect(false, record.id)" + @create="newDefect(record.id)" /> @@ -128,6 +142,8 @@ import apiStatus from '@/views/api-test/components/apiStatus.vue'; import CaseAndScenarioReportDrawer from '@/views/api-test/components/caseAndScenarioReportDrawer.vue'; import ExecutionStatus from '@/views/api-test/report/component/reportStatus.vue'; + import AddDefectDrawer from '@/views/case-management/caseManagementFeature/components/tabContent/tabBug/addDefectDrawer.vue'; + import LinkDefectDrawer from '@/views/case-management/components/linkDefectDrawer.vue'; import BatchApiMoveModal from '@/views/test-plan/testPlan/components/batchApiMoveModal.vue'; import { @@ -151,6 +167,7 @@ import { DragSortParams, ModuleTreeNode } from '@/models/common'; import type { PlanDetailApiCaseItem, PlanDetailApiCaseQueryParams } from '@/models/testPlan/testPlan'; + import { AssociatedBugApiTypeEnum } from '@/enums/associateBugEnum'; import { ReportEnum } from '@/enums/reportEnum'; import { ApiTestRouteEnum } from '@/enums/routeEnum'; import { TableKeyEnum } from '@/enums/tableEnum'; @@ -394,6 +411,16 @@ eventTag: 'disassociate', permission: ['PROJECT_TEST_PLAN:READ+ASSOCIATION'], }, + { + label: 'caseManagement.featureCase.linkDefect', + eventTag: 'linkDefect', + permission: ['PROJECT_BUG:READ'], + }, + { + label: 'testPlan.featureCase.noBugDataNewBug', + eventTag: 'newBug', + permission: ['PROJECT_BUG:READ+ADD'], + }, ], }; }); @@ -625,6 +652,28 @@ }); } + const showLinkBugDrawer = ref(false); + const associatedCaseId = ref(); + const existedDefect = inject>('existedDefect', ref(0)); + + const isBatchAssociate = ref(false); + // 关联缺陷 + function associatedDefect(isBatch: boolean, caseId?: string) { + isBatchAssociate.value = isBatch; + associatedCaseId.value = caseId; + showLinkBugDrawer.value = true; + } + + const drawerLoading = ref(false); + + const showCreateBugDrawer = ref(false); + + // 新建缺陷 + function newDefect(caseId?: string) { + associatedCaseId.value = caseId; + showCreateBugDrawer.value = true; + } + // 批量批量移动 const batchUpdateParams = ref(); const batchMoveModalVisible = ref(false); @@ -650,16 +699,17 @@ case 'move': batchMoveModalVisible.value = true; break; + case 'linkDefect': + associatedDefect(true); + break; + case 'newBug': + newDefect(); + break; default: break; } } - const showLinkDrawer = ref(false); - const showCreateDrawer = ref(false); - - const drawerLoading = ref(false); - // 去接口用例详情页面 function toDetail(record: PlanDetailApiCaseItem) { openNewPage(ApiTestRouteEnum.API_TEST_MANAGEMENT, { diff --git a/frontend/src/views/test-plan/testPlan/detail/apiScenario/components/scenarioTable.vue b/frontend/src/views/test-plan/testPlan/detail/apiScenario/components/scenarioTable.vue index a80e796c7b..ea1113ff64 100644 --- a/frontend/src/views/test-plan/testPlan/detail/apiScenario/components/scenarioTable.vue +++ b/frontend/src/views/test-plan/testPlan/detail/apiScenario/components/scenarioTable.vue @@ -55,6 +55,10 @@ :bug-list="record.bugList" :resource-id="record.id" :bug-count="record.bugCount || 0" + :existed-defect="existedDefect" + @load-list="loadList" + @associated="associatedDefect(false, record.id)" + @create="newDefect(record.id)" /> @@ -126,6 +141,8 @@ import apiStatus from '@/views/api-test/components/apiStatus.vue'; import CaseAndScenarioReportDrawer from '@/views/api-test/components/caseAndScenarioReportDrawer.vue'; import ExecutionStatus from '@/views/api-test/report/component/reportStatus.vue'; + import AddDefectDrawer from '@/views/case-management/caseManagementFeature/components/tabContent/tabBug/addDefectDrawer.vue'; + import LinkDefectDrawer from '@/views/case-management/components/linkDefectDrawer.vue'; import BatchApiMoveModal from '@/views/test-plan/testPlan/components/batchApiMoveModal.vue'; import { @@ -149,6 +166,7 @@ import { DragSortParams, ModuleTreeNode } from '@/models/common'; import type { PlanDetailApiScenarioItem, PlanDetailApiScenarioQueryParams } from '@/models/testPlan/testPlan'; + import { AssociatedBugApiTypeEnum } from '@/enums/associateBugEnum'; import { ReportEnum } from '@/enums/reportEnum'; import { ApiTestRouteEnum } from '@/enums/routeEnum'; import { TableKeyEnum } from '@/enums/tableEnum'; @@ -376,6 +394,16 @@ eventTag: 'disassociate', permission: ['PROJECT_TEST_PLAN:READ+ASSOCIATION'], }, + { + label: 'caseManagement.featureCase.linkDefect', + eventTag: 'linkDefect', + permission: ['PROJECT_BUG:READ'], + }, + { + label: 'testPlan.featureCase.noBugDataNewBug', + eventTag: 'newBug', + permission: ['PROJECT_BUG:READ+ADD'], + }, ], }; }); @@ -613,6 +641,25 @@ const batchUpdateParams = ref(); const batchMoveModalVisible = ref(false); + const existedDefect = inject>('existedDefect', ref(0)); + const isBatchAssociate = ref(false); + const showLinkBugDrawer = ref(false); + const associatedCaseId = ref(); + const drawerLoading = ref(false); + // 关联缺陷 + function associatedDefect(isBatch: boolean, caseId?: string) { + isBatchAssociate.value = isBatch; + associatedCaseId.value = caseId; + showLinkBugDrawer.value = true; + } + + const showCreateBugDrawer = ref(false); + // 新建缺陷 + function newDefect(caseId?: string) { + associatedCaseId.value = caseId; + showCreateBugDrawer.value = true; + } + // 处理表格选中后批量操作 async function handleTableBatch(event: BatchActionParams, params: BatchActionQueryParams) { tableSelected.value = params?.selectedIds || []; @@ -634,6 +681,12 @@ case 'move': batchMoveModalVisible.value = true; break; + case 'linkDefect': + associatedDefect(true); + break; + case 'newBug': + newDefect(); + break; default: break; } diff --git a/frontend/src/views/test-plan/testPlan/detail/bugManagement/caseCountPopover.vue b/frontend/src/views/test-plan/testPlan/detail/bugManagement/caseCountPopover.vue index f2a74b2e8f..bd1612b6e5 100644 --- a/frontend/src/views/test-plan/testPlan/detail/bugManagement/caseCountPopover.vue +++ b/frontend/src/views/test-plan/testPlan/detail/bugManagement/caseCountPopover.vue @@ -47,6 +47,12 @@ showTooltip: true, width: 200, }, + { + title: 'testPlan.caseType', + dataIndex: 'type', + showTooltip: true, + width: 200, + }, ]; const { propsRes, propsEvent } = useTable(undefined, { diff --git a/frontend/src/views/test-plan/testPlan/detail/featureCase/components/caseTable.vue b/frontend/src/views/test-plan/testPlan/detail/featureCase/components/caseTable.vue index 750e061473..16ae68e40c 100644 --- a/frontend/src/views/test-plan/testPlan/detail/featureCase/components/caseTable.vue +++ b/frontend/src/views/test-plan/testPlan/detail/featureCase/components/caseTable.vue @@ -66,7 +66,9 @@ @change="() => handleEditLastExecResult(record)" > @@ -77,11 +79,15 @@ @@ -188,11 +210,13 @@ MsTableProps, } from '@/components/pure/ms-table/type'; import useTable from '@/components/pure/ms-table/useTable'; - import BugCountPopover from '@/components/business/ms-bug-operation/bugCountPopover.vue'; + import MsBugOperation from '@/components/business/ms-bug-operation/index.vue'; import CaseLevel from '@/components/business/ms-case-associate/caseLevel.vue'; import ExecuteResult from '@/components/business/ms-case-associate/executeResult.vue'; import { getMinderOperationParams } from '@/components/business/ms-minders/caseReviewMinder/utils'; import MsTestPlanFeatureCaseMinder from '@/components/business/ms-minders/testPlanFeatureCaseMinder/index.vue'; + import AddDefectDrawer from '@/views/case-management/caseManagementFeature/components/tabContent/tabBug/addDefectDrawer.vue'; + import LinkDefectDrawer from '@/views/case-management/components/linkDefectDrawer.vue'; import BatchApiMoveModal from '@/views/test-plan/testPlan/components/batchApiMoveModal.vue'; import BatchUpdateExecutorModal from '@/views/test-plan/testPlan/components/batchUpdateExecutorModal.vue'; import ExecuteForm from '@/views/test-plan/testPlan/detail/featureCase/components/executeForm.vue'; @@ -216,8 +240,9 @@ import { characterLimit } from '@/utils'; import { hasAllPermission, hasAnyPermission } from '@/utils/permission'; - import { DragSortParams, ModuleTreeNode } from '@/models/common'; + import { DragSortParams, ModuleTreeNode, TableQueryParams } from '@/models/common'; import type { ExecuteFeatureCaseFormParams, PlanDetailFeatureCaseItem } from '@/models/testPlan/testPlan'; + import { AssociatedBugApiTypeEnum } from '@/enums/associateBugEnum'; import { LastExecuteResults } from '@/enums/caseEnum'; import { TestPlanRouteEnum } from '@/enums/routeEnum'; import { TableKeyEnum } from '@/enums/tableEnum'; @@ -419,6 +444,19 @@ }; } ); + const existedDefect = inject>('existedDefect', ref(0)); + + function getLinkAction() { + return existedDefect.value + ? [ + { + label: 'caseManagement.featureCase.linkDefect', + eventTag: 'linkDefect', + permission: ['PROJECT_BUG:READ'], + }, + ] + : []; + } const batchActions = computed(() => { return { @@ -441,6 +479,12 @@ eventTag: 'disassociate', permission: ['PROJECT_TEST_PLAN:READ+ASSOCIATION'], }, + ...getLinkAction(), + { + label: 'testPlan.featureCase.noBugDataNewBug', + eventTag: 'newBug', + permission: ['PROJECT_BUG:READ+ADD'], + }, ], }; }); @@ -748,6 +792,49 @@ batchExecuteForm.value = { ...defaultExecuteForm }; } + const showLinkBugDrawer = ref(false); + const associatedCaseId = ref(); + const drawerLoading = ref(false); + + // TODO 等待联调 + function saveHandler(params: TableQueryParams) { + try { + drawerLoading.value = true; + Message.success(t('caseManagement.featureCase.associatedSuccess')); + resetCaseList(); + initModules(); + emit('refresh'); + showLinkBugDrawer.value = false; + } catch (error) { + // eslint-disable-next-line no-console + console.log(error); + } finally { + drawerLoading.value = false; + } + } + + function refreshList() { + resetCaseList(); + initModules(); + emit('refresh'); + } + + const isBatchAssociate = ref(false); + + // 关联缺陷 + function associatedDefect(isBatch: boolean, caseId?: string) { + isBatchAssociate.value = isBatch; + associatedCaseId.value = caseId; + showLinkBugDrawer.value = true; + } + + const showCreateBugDrawer = ref(false); + // 新建缺陷 + function newDefect(caseId?: string) { + associatedCaseId.value = caseId; + showCreateBugDrawer.value = true; + } + // 批量修改执行人 和 批量移动 const batchUpdateExecutorModalVisible = ref(false); const batchMoveModalVisible = ref(false); @@ -766,6 +853,12 @@ case 'move': batchMoveModalVisible.value = true; break; + case 'linkDefect': + associatedDefect(true); + break; + case 'newBug': + newDefect(); + break; default: break; } diff --git a/frontend/src/views/test-plan/testPlan/detail/featureCase/detail/index.vue b/frontend/src/views/test-plan/testPlan/detail/featureCase/detail/index.vue index 5d59448c11..cefa170c01 100644 --- a/frontend/src/views/test-plan/testPlan/detail/featureCase/detail/index.vue +++ b/frontend/src/views/test-plan/testPlan/detail/featureCase/detail/index.vue @@ -223,6 +223,7 @@ :case-id="activeCaseId" :drawer-loading="drawerLoading" :show-selector-all="false" + :load-api="AssociatedBugApiTypeEnum.TEST_PLAN_BUG_LIST" @save="associateSuccessHandler" /> (0); + + async function initBugList() { + if (!hasAnyPermission(['PROJECT_BUG:READ'])) { + return; + } + const res = await getBugList({ + current: 1, + pageSize: 10, + sort: {}, + filter: {}, + keyword: '', + combine: {}, + searchMode: 'AND', + projectId: appStore.currentProjectId, + }); + createdBugCount.value = res.total || 0; + } + provide('existedDefect', createdBugCount); + async function initDetail() { try { loading.value = true; detail.value = await getTestPlanDetail(planId.value); getStatistics(); + initBugList(); } catch (error) { // eslint-disable-next-line no-console console.log(error); diff --git a/frontend/src/views/test-plan/testPlan/locale/en-US.ts b/frontend/src/views/test-plan/testPlan/locale/en-US.ts index b59bf4e261..88793f477c 100644 --- a/frontend/src/views/test-plan/testPlan/locale/en-US.ts +++ b/frontend/src/views/test-plan/testPlan/locale/en-US.ts @@ -152,4 +152,5 @@ export default { 'testPlan.planStartToEndTimeTip': 'The test plan timed out', 'testPlan.planConfigReport': 'Configuration Report', 'testPlan.planAutomaticGeneration': 'Automatic generation', + 'testPlan.caseType': 'Use Case types', }; diff --git a/frontend/src/views/test-plan/testPlan/locale/zh-CN.ts b/frontend/src/views/test-plan/testPlan/locale/zh-CN.ts index 52331ffe36..570acd36a8 100644 --- a/frontend/src/views/test-plan/testPlan/locale/zh-CN.ts +++ b/frontend/src/views/test-plan/testPlan/locale/zh-CN.ts @@ -141,4 +141,5 @@ export default { 'testPlan.planStartToEndTimeTip': '测试计划已超时', 'testPlan.planConfigReport': '自定义报告', 'testPlan.planAutomaticGeneration': '自动生成', + 'testPlan.caseType': '用例类型', };