refactor(项目管理): 调整消息通知模块显示字段

This commit is contained in:
guoyuqi 2024-05-15 15:22:08 +08:00 committed by Craftsman
parent 0f14d934bb
commit 10b97d1b51
4 changed files with 10 additions and 9 deletions

View File

@ -357,7 +357,7 @@ message.title.schedule_task_close=Turn off scheduled task notifications
#功能case
message.domain.name=Name
message.domain.test_plan_name=Test plan name
message.domain.testPlanName=Test plan name
message.domain.review_name=Review name
message.domain.review_status=Review status
message.domain.case_model=Edit mode
@ -447,6 +447,7 @@ message.domain.api_scenario_requestPendingRate=Request pending rate
message.domain.api_scenario_requestFakeErrorRate=Request fake error rate
message.domain.api_scenario_assertionPassRate=Assertion pass rate
# Test plan
message.domain.test_plan_name=Name
message.domain.test_plan_stage=Testing phase
message.domain.test_plan_status=Test plan status
message.domain.test_plan_description=Description

View File

@ -446,6 +446,7 @@ message.domain.api_scenario_requestPendingRate=请求未执行率
message.domain.api_scenario_requestFakeErrorRate=请求误报率
message.domain.api_scenario_assertionPassRate=断言通过率
# 测试计划
message.domain.test_plan_name=名称
message.domain.test_plan_stage=测试阶段
message.domain.test_plan_status=测试计划状态
message.domain.test_plan_description=描述

View File

@ -447,6 +447,7 @@ message.domain.api_scenario_requestPendingRate=報告請求待定率
message.domain.api_scenario_requestFakeErrorRate=報告請求誤報率
message.domain.api_scenario_assertionPassRate=報告斷言通過率
# 測試計劃
message.domain.test_plan_name=名稱
message.domain.test_plan_stage=測試階段
message.domain.test_plan_status=測試計劃狀態
message.domain.test_plan_description=描述

View File

@ -44,12 +44,10 @@ public class NoticeTemplateService {
Field[] allFields = FieldUtils.getAllFields(ApiDefinitionCaseDTO.class);
addOptionDto(messageTemplateFieldDTOList, allFields, null);
addCustomFiled(messageTemplateFieldDTOList, projectId, TemplateScene.API.toString());
//TODO获取报告
}
case NoticeConstants.TaskType.API_SCENARIO_TASK -> {
Field[] allFields = FieldUtils.getAllFields(ApiScenarioMessageDTO.class);
addOptionDto(messageTemplateFieldDTOList, allFields, null);
//TODO获取报告
}
case NoticeConstants.TaskType.API_REPORT_TASK -> {
Field[] allFields = FieldUtils.getAllFields(ApiReportMessageDTO.class);
@ -59,25 +57,21 @@ public class NoticeTemplateService {
case NoticeConstants.TaskType.TEST_PLAN_TASK -> {
Field[] allFields = FieldUtils.getAllFields(TestPlan.class);
addOptionDto(messageTemplateFieldDTOList, allFields, "test_plan_");
addCustomFiled(messageTemplateFieldDTOList, projectId, TemplateScene.TEST_PLAN.toString());
//TODO获取报告
}
case NoticeConstants.TaskType.CASE_REVIEW_TASK -> {
Field[] allFields = FieldUtils.getAllFields(CaseReview.class);
addOptionDto(messageTemplateFieldDTOList, allFields, "case_review_");
//TODO获取报告
}
case NoticeConstants.TaskType.FUNCTIONAL_CASE_TASK -> {
Field[] allFields = FieldUtils.getAllFields(FunctionalCaseMessageDTO.class);
addOptionDto(messageTemplateFieldDTOList, allFields, null);
addCustomFiled(messageTemplateFieldDTOList, projectId, TemplateScene.FUNCTIONAL.toString());
//TODO获取报告
}
case NoticeConstants.TaskType.BUG_TASK -> {
Field[] allFields = FieldUtils.getAllFields(BugMessageDTO.class);
addOptionDto(messageTemplateFieldDTOList, allFields, null);
addCustomFiled(messageTemplateFieldDTOList, projectId, TemplateScene.BUG.toString());
//TODO获取报告
}
case NoticeConstants.TaskType.BUG_SYNC_TASK -> {
Field[] allFields = FieldUtils.getAllFields(BugSyncNoticeDTO.class);
@ -88,7 +82,6 @@ public class NoticeTemplateService {
case NoticeConstants.TaskType.SCHEDULE_TASK -> {
Field[] allFields = FieldUtils.getAllFields(Schedule.class);
addOptionDto(messageTemplateFieldDTOList, allFields, "schedule_");
//TODO获取报告
}
case NoticeConstants.TaskType.JENKINS_TASK -> {
MessageTemplateFieldDTO messageTemplateFieldOperator = new MessageTemplateFieldDTO();
@ -96,7 +89,6 @@ public class NoticeTemplateService {
messageTemplateFieldOperator.setFieldSource(NoticeConstants.FieldSource.CASE_FIELD);
messageTemplateFieldOperator.setName(Translator.get("message.jenkins_name"));
messageTemplateFieldDTOList.add(messageTemplateFieldOperator);
//TODO获取报告
}
default -> messageTemplateFieldDTOList = new ArrayList<>();
}
@ -174,6 +166,12 @@ public class NoticeTemplateService {
List<MessageTemplateFieldDTO> domainTemplateFields = getDomainTemplateFields(projectId, taskType);
messageTemplateResultDTO.setFieldList(domainTemplateFields);
Map<String, String> fieldSourceMap = MessageTemplateUtils.getFieldSourceMap();
if (!StringUtils.equalsIgnoreCase(taskType, NoticeConstants.TaskType.FUNCTIONAL_CASE_TASK) && !StringUtils.equalsIgnoreCase(taskType, NoticeConstants.TaskType.BUG_TASK)) {
fieldSourceMap.remove(NoticeConstants.FieldSource.CUSTOM_FIELD);
}
if (!StringUtils.equalsIgnoreCase(taskType, NoticeConstants.TaskType.API_REPORT_TASK) && !StringUtils.equalsIgnoreCase(taskType, NoticeConstants.TaskType.TEST_PLAN_REPORT_TASK)) {
fieldSourceMap.remove(NoticeConstants.FieldSource.REPORT_FIELD);
}
List<OptionDTO> optionDTOList = new ArrayList<>();
fieldSourceMap.forEach((k, v) -> {
OptionDTO optionDTO = new OptionDTO();