From 196bcec3bfe5ce90a5793635c4d4fdfaad84f29f Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 23 Oct 2020 12:47:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E5=BC=95=E7=94=A8=E5=A4=8D=E5=88=B6=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=B5=8B=E8=AF=95=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/java/io/metersphere/xpack | 2 +- .../api/test/components/ApiScenarioConfig.vue | 2 +- .../api/test/components/ApiScenarioSelect.vue | 38 ++++++++++++++++++- frontend/src/business/components/xpack | 2 +- 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index cf6b065263..ee74568be0 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit cf6b06526324326a563d933e07118fac014a63b4 +Subproject commit ee74568be0beba46da19616f5832e83f9164c688 diff --git a/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue b/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue index 749d4bfe36..98f388dfc0 100644 --- a/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue +++ b/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue @@ -61,7 +61,7 @@ :request="selected" :scenario="currentScenario" v-if="isRequest"/> - + diff --git a/frontend/src/business/components/api/test/components/ApiScenarioSelect.vue b/frontend/src/business/components/api/test/components/ApiScenarioSelect.vue index 7c90de1762..45d2fa98d5 100644 --- a/frontend/src/business/components/api/test/components/ApiScenarioSelect.vue +++ b/frontend/src/business/components/api/test/components/ApiScenarioSelect.vue @@ -43,6 +43,7 @@ import MsTableSearchBar from "@/business/components/common/components/MsTableSea import MsTableAdvSearchBar from "@/business/components/common/components/search/MsTableAdvSearchBar"; import MsApiScenarioSelectSubTable from "@/business/components/api/test/components/ApiScenarioSelectSubTable"; import {Scenario} from "@/business/components/api/test/model/ScenarioModel"; +import {parseEnvironment} from "../model/EnvironmentModel"; export default { name: "MsApiScenarioSelect", @@ -51,7 +52,8 @@ export default { MsTableAdvSearchBar, MsTableSearchBar, MsTablePagination, MsTableHeader }, props: { - excludeId: String + excludeId: String, + projectId: String }, data() { return { @@ -64,6 +66,7 @@ export default { pageSize: 5, total: 0, selection: false, + environmentMap: new Map() } }, methods: { @@ -94,19 +97,50 @@ export default { } scenarios.push(scenario); } + this.initScenarioEnvironment(scenarios); this.$emit('select', scenarios); }, + getEnvironment() { + if (this.projectId) { + this.result = this.$get('/api/environment/list/' + this.projectId, response => { + let environments = response.data; + this.environmentMap = new Map(); + environments.forEach(environment => { + parseEnvironment(environment); + this.environmentMap.set(environment.id, environment); + }); + }); + } + }, + initScenarioEnvironment(scenarios) { + scenarios.forEach(scenario => { + if (scenario.environmentId) { + let env = this.environmentMap.get(scenario.environmentId); + if (!env) { + scenario.environmentId = undefined; + scenario.environment = undefined; + } else { + scenario.environment = env; + } + } else { + scenario.environmentId = undefined; + scenario.environment = undefined; + } + }); + }, clone(row) { let scenarios = []; row.selected.forEach(options => { // 去掉ID,创建新的ID options.id = undefined; scenarios.push(new Scenario(options)); - }) + }); + this.initScenarioEnvironment(scenarios); this.$emit('select', scenarios); }, open() { this.search(); + this.getEnvironment(); this.visible = true; }, close() { diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index 06d935cd1d..cc38137a69 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit 06d935cd1d22ab36f09763745c2aff8ad3fb08c1 +Subproject commit cc38137a69a0f20fadece9c0f9f50a9468c4ace9 From 70602c9d95863bdbdec7b021d6ffaa6addb653c0 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Fri, 23 Oct 2020 13:35:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E5=8E=BB=E6=8E=89sql=E4=B8=8A?= =?UTF-8?q?=E7=9A=84=E5=88=86=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/base/mapper/ext/ExtTestCaseReviewMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewMapper.xml index 4c1976ad86..1ff3351f72 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewMapper.xml @@ -70,6 +70,6 @@ from project, test_case_review_project where project.id = test_case_review_project.project_id and project.workspace_id = #{workspaceId} - and test_case_review_project.review_id = #{reviewId}; + and test_case_review_project.review_id = #{reviewId} \ No newline at end of file