Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(测试计划): 修改测试计划缺陷徽标展示&缺陷管理字段添加&缺陷管理样式调整 #31079

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/src/views/bug-management/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</template>
<a-form ref="formRef" :model="form" layout="vertical">
<div class="flex flex-row">
<div class="left mt-[16px] min-w-[732px] grow">
<div class="left mt-[16px] w-[calc(100%-428px)] grow">
<!-- 平台默认模板不展示缺陷名称, 描述 -->
<a-form-item
v-if="!isPlatformDefaultTemplate"
Expand Down Expand Up @@ -151,7 +151,7 @@
</MsFileList>
</div>
<a-divider class="ml-[16px]" direction="vertical" />
<div class="right mt-[16px] max-w-[433px] grow pr-[24px]">
<div class="right mt-[16px] w-[428px] grow pr-[24px]">
<div class="min-w-[250px] overflow-auto">
<a-skeleton v-if="isLoading" :loading="isLoading" :animation="true">
<a-space direction="vertical" class="w-full" size="large">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</MsButton>
<span v-if="hasAnyPermission(['PROJECT_BUG:READ+ADD'])">{{ t('caseManagement.featureCase.or') }}</span>
<MsButton v-permission="['PROJECT_BUG:READ+ADD']" class="ml-[8px]" @click="createDefect">
{{ t('caseManagement.featureCase.createDefect') }}
{{ t('testPlan.featureCase.noBugDataNewBug') }}
</MsButton>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<template #content>
{{ t('caseManagement.featureCase.noAssociatedDefect') }}
<span v-permission="['PROJECT_BUG:READ+ADD']" class="text-[rgb(var(--primary-4))]" @click="createDefect">{{
t('caseManagement.featureCase.createDefect')
t('testPlan.featureCase.noBugDataNewBug')
}}</span>
</template>
<a-button
Expand All @@ -29,7 +29,7 @@
{{ t('caseManagement.featureCase.linkDefect') }}
</a-button>
<a-button v-permission="['PROJECT_BUG:READ+ADD']" type="outline" @click="createDefect"
>{{ t('caseManagement.featureCase.createDefect') }}
>{{ t('testPlan.featureCase.noBugDataNewBug') }}
</a-button>
</div>
<div v-else v-permission="['FUNCTIONAL_CASE:READ+UPDATE']" class="font-medium">{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export default {
'system.orgTemplate.templateCase': '用例',
'system.orgTemplate.templateApi': '接口',
'system.orgTemplate.templateBug': '缺陷',
'system.orgTemplate.enableTip': '确认启用项目模版吗',
'system.orgTemplate.enableTip': '确认启用项目模板吗',
'system.orgTemplate.enableWarningTip': '启用后,不可恢复为组织模版,请谨慎操作!',
'system.orgTemplate.typeEmptyTip': '字段类型不能为空',
'system.orgTemplate.searchOrgPlaceholder': '请输入组织名称',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
(e: 'link'): void;
(e: 'new'): void;
(e: 'save', params: TableQueryParams): void;
(e: 'updateCount'): void;
}>();

const columns = ref<MsTableColumn>([
Expand Down Expand Up @@ -137,6 +138,14 @@
ellipsis: true,
showDrag: false,
},
{
title: 'common.creator',
slotName: 'createUser',
dataIndex: 'createUser',
showInTable: true,
width: 200,
ellipsis: true,
},
{
title: 'caseManagement.featureCase.updateUser',
slotName: 'handleUserName',
Expand Down Expand Up @@ -218,6 +227,7 @@
await testPlanCancelBug(id);
Message.success(t('caseManagement.featureCase.cancelLinkSuccess'));
initData();
emit('updateCount');
} catch (error) {
console.log(error);
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
</div>
<MsTab
v-model:active-key="activeTab"
:show-badge="false"
:content-tab-list="contentTabList"
no-content
:get-text-func="getTotal"
class="relative mx-[16px] border-b"
/>
<div :class="[' flex-1', activeTab !== 'detail' ? 'tab-content' : 'overflow-hidden']">
Expand Down Expand Up @@ -123,7 +123,7 @@
<MsTag type="danger" theme="light" size="medium" class="ml-4">
<MsIcon type="icon-icon_defect" class="!text-[14px] text-[rgb(var(--danger-6))]" size="16" />
<span class="ml-1 text-[rgb(var(--danger-6))]"> {{ t('testPlan.featureCase.bug') }}</span>
<span class="ml-1 text-[rgb(var(--danger-6))]">{{ bugCount }}</span>
<span class="ml-1 text-[rgb(var(--danger-6))]">{{ caseDetail.bugListCount }}</span>
</MsTag>
<a-dropdown @select="handleSelect">
<a-button type="outline" size="mini" class="ml-1">
Expand Down Expand Up @@ -174,6 +174,7 @@
:test-plan-case-id="activeId"
@link="linkDefect"
@new="addBug"
@update-count="loadCaseDetail()"
/>
<ExecutionHistory
v-if="activeTab === 'executionHistory'"
Expand All @@ -199,7 +200,7 @@
caseId: activeCaseId,
testPlanId:route.query.id as string,
}"
@success="addSuccess"
@success="loadCaseDetail()"
/>
</template>

Expand Down Expand Up @@ -455,8 +456,6 @@
}
}

const bugCount = ref<number>(0);

const showLinkDrawer = ref<boolean>(false);
const drawerLoading = ref<boolean>(false);

Expand All @@ -482,27 +481,21 @@
}
const bugRef = ref();

async function getBugTotal() {
try {
const params = {
testPlanCaseId: activeId.value,
caseId: activeCaseId.value,
projectId: appStore.currentProjectId,
current: 1,
pageSize: 10,
};
const res = await associatedBugPage(params);
bugCount.value = res.total;
} catch (error) {
console.log(error);
}
}

function addSuccess() {
if (activeTab.value === 'defectList') {
bugRef.value?.initData();
} else {
getBugTotal();
}
}

function getTotal(key: string) {
const { bugListCount, historyCount } = caseDetail.value;
switch (key) {
case 'defectList':
return bugListCount > 99 ? `99+` : `${bugListCount}`;
case 'executionHistory':
return historyCount > 99 ? `99+` : `${historyCount}`;
default:
return '';
}
}

Expand All @@ -518,6 +511,7 @@
Message.success(t('caseManagement.featureCase.associatedSuccess'));
showLinkDrawer.value = false;
addSuccess();
loadCaseDetail();
} catch (error) {
console.log(error);
} finally {
Expand Down Expand Up @@ -559,9 +553,9 @@
moduleIds,
};
}
if (activeTab.value === 'detail') {
getBugTotal();
}
// if (activeTab.value === 'detail') {
// getBugTotal();
// }
getPlanDetail();
initBugList();
await loadCase();
Expand All @@ -571,16 +565,6 @@
() => {
loadCaseDetail();
initBugList();
getBugTotal();
}
);

watch(
() => activeTab.value,
(val) => {
if (val === 'detail') {
getBugTotal();
}
}
);
</script>
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/views/test-plan/testPlan/locale/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ export default {
'testPlan.testPlanIndex.apiScenarioCase': '接口场景用例',
'testPlan.testPlanIndex.deleteArchivedPlan': '计划 已归档,删除后数据不可恢复,请谨慎操作!',
'testPlan.testPlanIndex.deletePendingPlan': '计划 未执行,删除后数据不可恢复,请谨慎操作!',
'testPlan.testPlanIndex.deleteRunningPlan':
'计划 进行中,删除后,终止执行且不可恢复,定时任务停止并删除,请谨慎操作!',
'testPlan.testPlanIndex.deleteRunningPlan': '计划 进行中,删除后,终止执行且不可恢复,请谨慎操作!',
'testPlan.testPlanIndex.deleteCompletedPlan':
'建议计划 已完成 ,选择归档,用例信息及执行结果都将被保留;若继续删除,数据将不会恢复,请谨慎操作!',
'testPlan.testPlanIndex.confirmArchivePlan': '归档后,执行信息不再更新且不可编辑,数据不可恢复,请谨慎操作!',
Expand Down
Loading