diff --git a/backend/framework/sdk/src/main/resources/i18n/project_en_US.properties b/backend/framework/sdk/src/main/resources/i18n/project_en_US.properties index 8f0ecd5b8a..c73d912fd1 100644 --- a/backend/framework/sdk/src/main/resources/i18n/project_en_US.properties +++ b/backend/framework/sdk/src/main/resources/i18n/project_en_US.properties @@ -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 diff --git a/backend/framework/sdk/src/main/resources/i18n/project_zh_CN.properties b/backend/framework/sdk/src/main/resources/i18n/project_zh_CN.properties index bdd836010f..a1551b9fed 100644 --- a/backend/framework/sdk/src/main/resources/i18n/project_zh_CN.properties +++ b/backend/framework/sdk/src/main/resources/i18n/project_zh_CN.properties @@ -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=描述 diff --git a/backend/framework/sdk/src/main/resources/i18n/project_zh_TW.properties b/backend/framework/sdk/src/main/resources/i18n/project_zh_TW.properties index be153dbb3f..c3c9c9363b 100644 --- a/backend/framework/sdk/src/main/resources/i18n/project_zh_TW.properties +++ b/backend/framework/sdk/src/main/resources/i18n/project_zh_TW.properties @@ -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=描述 diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/service/NoticeTemplateService.java b/backend/services/project-management/src/main/java/io/metersphere/project/service/NoticeTemplateService.java index ddba734d6b..41614067ff 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/service/NoticeTemplateService.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/service/NoticeTemplateService.java @@ -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 domainTemplateFields = getDomainTemplateFields(projectId, taskType); messageTemplateResultDTO.setFieldList(domainTemplateFields); Map 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 optionDTOList = new ArrayList<>(); fieldSourceMap.forEach((k, v) -> { OptionDTO optionDTO = new OptionDTO();