From f385215320a496486f6ad407db16d423346da108 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 26 Mar 2024 19:11:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=95=E5=85=A5=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=A1=86=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1037632 --user=王孝刚 【接口测试】定义-接口/用例-前置/后置-SQL操作-引入数据源-搜索框文案应该是「通过名称搜索」 https://www.tapd.cn/55049933/s/1481267 --- backend/framework/sdk/src/main/resources/i18n/api.properties | 1 + .../sdk/src/main/resources/i18n/api_en_US.properties | 4 +++- .../sdk/src/main/resources/i18n/api_zh_CN.properties | 4 +++- .../sdk/src/main/resources/i18n/api_zh_TW.properties | 4 +++- .../metersphere/api/service/definition/ApiReportService.java | 4 +++- .../api/service/scenario/ApiScenarioReportService.java | 4 +++- .../src/views/api-test/components/quoteSqlSourceDrawer.vue | 2 +- frontend/src/views/api-test/debug/locale/en-US.ts | 1 + frontend/src/views/api-test/debug/locale/zh-CN.ts | 1 + 9 files changed, 19 insertions(+), 6 deletions(-) diff --git a/backend/framework/sdk/src/main/resources/i18n/api.properties b/backend/framework/sdk/src/main/resources/i18n/api.properties index c6d1a5ab57..a0d860ba8a 100644 --- a/backend/framework/sdk/src/main/resources/i18n/api.properties +++ b/backend/framework/sdk/src/main/resources/i18n/api.properties @@ -384,6 +384,7 @@ api_scenario_report_not_exist=场景报告不存在 permission.api_plugin.name=接口插件 permission.api_step.name=步骤 api_response_name_code_unique=响应名称 + 响应码需要唯一 +api_report_default_env=默认环境 #module:ApiScenarioCsv api_scenario_csv.file_id.not_blank=文件ID不能为空 diff --git a/backend/framework/sdk/src/main/resources/i18n/api_en_US.properties b/backend/framework/sdk/src/main/resources/i18n/api_en_US.properties index 3bad851314..46b89d5ec0 100644 --- a/backend/framework/sdk/src/main/resources/i18n/api_en_US.properties +++ b/backend/framework/sdk/src/main/resources/i18n/api_en_US.properties @@ -433,4 +433,6 @@ api_test_case.environment_id.length_range=Environment ID length must be between api_scenario.target_module_id.length_range=Target module ID length must be between 0-50 api_scenario.group_id.length_range=Group ID length must be between 0-50 -api_scenario.environment_id.length_range=Environment ID length must be between 0-50 \ No newline at end of file +api_scenario.environment_id.length_range=Environment ID length must be between 0-50 + +api_report_default_env=Default environment \ No newline at end of file diff --git a/backend/framework/sdk/src/main/resources/i18n/api_zh_CN.properties b/backend/framework/sdk/src/main/resources/i18n/api_zh_CN.properties index 6738a8b615..3916cea394 100644 --- a/backend/framework/sdk/src/main/resources/i18n/api_zh_CN.properties +++ b/backend/framework/sdk/src/main/resources/i18n/api_zh_CN.properties @@ -401,4 +401,6 @@ api_test_case.environment_id.length_range=环境ID长度必须在0-50之间 api_scenario.target_module_id.length_range=目标模块ID长度必须在0-50之间 api_scenario.group_id.length_range=环境组ID长度必须在0-50之间 -api_scenario.environment_id.length_range=环境ID长度必须在0-50之间 \ No newline at end of file +api_scenario.environment_id.length_range=环境ID长度必须在0-50之间 + +api_report_default_env=默认环境 \ No newline at end of file diff --git a/backend/framework/sdk/src/main/resources/i18n/api_zh_TW.properties b/backend/framework/sdk/src/main/resources/i18n/api_zh_TW.properties index 19ec0eb19e..926272d622 100644 --- a/backend/framework/sdk/src/main/resources/i18n/api_zh_TW.properties +++ b/backend/framework/sdk/src/main/resources/i18n/api_zh_TW.properties @@ -400,4 +400,6 @@ api_test_case.priority.length_range_=用例等級長度必須在0-50之間 api_test_case.environment_id.length_range=環境ID長度必須在0-50之間 api_scenario.target_module_id.length_range=目標模塊ID長度必須在0-50之間 api_scenario.group_id.length_range=环境組ID長度必須在0-50之間 -api_scenario.environment_id.length_range=環境ID長度必須在0-50之間 \ No newline at end of file +api_scenario.environment_id.length_range=環境ID長度必須在0-50之間 + +api_report_default_env=默认環境 \ No newline at end of file diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiReportService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiReportService.java index fd2239de11..d48246da23 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiReportService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiReportService.java @@ -187,12 +187,14 @@ public class ApiReportService { //查询资源池名称 apiReportDTO.setPoolName(testResourcePoolMapper.selectByPrimaryKey(apiReportDTO.getPoolId()).getName()); //查询环境名称 + String environmentName = Translator.get("api_report_default_env"); if (StringUtils.isNoneBlank(apiReportDTO.getEnvironmentId())) { Environment environment = environmentMapper.selectByPrimaryKey(apiReportDTO.getEnvironmentId()); if (environment != null) { - apiReportDTO.setEnvironmentName(environment.getName()); + environmentName = environment.getName(); } } + apiReportDTO.setEnvironmentName(environmentName); apiReportDTO.setCreatUserName(userMapper.selectByPrimaryKey(apiReportDTO.getCreateUser()).getName()); //需要查询出所有的步骤 if (BooleanUtils.isTrue(apiReport.getIntegrated())) { diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioReportService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioReportService.java index 296a420325..3c7faaa49a 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioReportService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioReportService.java @@ -201,12 +201,14 @@ public class ApiScenarioReportService { //查询资源池名称 scenarioReportDTO.setPoolName(testResourcePoolMapper.selectByPrimaryKey(scenarioReport.getPoolId()).getName()); //查询环境名称 + String environmentName = Translator.get("api_report_default_env"); if (StringUtils.isNotBlank(scenarioReport.getEnvironmentId())) { Environment environment = environmentMapper.selectByPrimaryKey(scenarioReport.getEnvironmentId()); if (environment != null) { - scenarioReportDTO.setEnvironmentName(environment.getName()); + environmentName = environment.getName(); } } + scenarioReportDTO.setEnvironmentName(environmentName); scenarioReportDTO.setCreatUserName(userMapper.selectByPrimaryKey(scenarioReport.getCreateUser()).getName()); return scenarioReportDTO; } diff --git a/frontend/src/views/api-test/components/quoteSqlSourceDrawer.vue b/frontend/src/views/api-test/components/quoteSqlSourceDrawer.vue index 1a7ff00203..492ab71af2 100644 --- a/frontend/src/views/api-test/components/quoteSqlSourceDrawer.vue +++ b/frontend/src/views/api-test/components/quoteSqlSourceDrawer.vue @@ -10,7 +10,7 @@