From 8170ffe3a426a613f14392ae14b979e071ae760d Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 17 Mar 2021 15:06:19 +0800 Subject: [PATCH 01/12] =?UTF-8?q?fix(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95)?= =?UTF-8?q?:=20=E4=BF=AE=E5=A4=8D=E6=8A=A5=E5=91=8A=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E8=BF=9B=E5=85=A5starting=E7=9A=84=E6=8A=A5?= =?UTF-8?q?=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rmanceTestReport.vue => PerformanceTestReportList.vue} | 8 ++------ frontend/src/business/components/performance/router.js | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) rename frontend/src/business/components/performance/report/{PerformanceTestReport.vue => PerformanceTestReportList.vue} (97%) diff --git a/frontend/src/business/components/performance/report/PerformanceTestReport.vue b/frontend/src/business/components/performance/report/PerformanceTestReportList.vue similarity index 97% rename from frontend/src/business/components/performance/report/PerformanceTestReport.vue rename to frontend/src/business/components/performance/report/PerformanceTestReportList.vue index 8e46a0708d..02e4a052df 100644 --- a/frontend/src/business/components/performance/report/PerformanceTestReport.vue +++ b/frontend/src/business/components/performance/report/PerformanceTestReportList.vue @@ -93,7 +93,7 @@ import MsTablePagination from "../../common/pagination/TablePagination"; import MsContainer from "../../common/components/MsContainer"; import MsMainContainer from "../../common/components/MsMainContainer"; import MsPerformanceReportStatus from "./PerformanceReportStatus"; -import {getCurrentProjectID} from "../../../../common/js/utils"; +import {getCurrentProjectID} from "@/common/js/utils"; import MsTableOperatorButton from "../../common/components/MsTableOperatorButton"; import ReportTriggerModeItem from "../../common/tableItem/ReportTriggerModeItem"; import {REPORT_CONFIGS} from "../../common/components/search/search-components"; @@ -104,7 +104,7 @@ import {_filter, _sort} from "@/common/js/tableUtils"; export default { - name: "PerformanceTestReport", + name: "PerformanceTestReportList", components: { MsTableHeader, ReportTriggerModeItem, @@ -186,10 +186,6 @@ export default { this.multipleSelection = val; }, handleEdit(report) { - if (report.status === "Starting") { - this.$info(this.$t('report.being_generated')) - return false - } this.$router.push({ path: '/performance/report/view/' + report.id }) diff --git a/frontend/src/business/components/performance/router.js b/frontend/src/business/components/performance/router.js index 6f3e24799e..7b8f266e53 100644 --- a/frontend/src/business/components/performance/router.js +++ b/frontend/src/business/components/performance/router.js @@ -4,7 +4,7 @@ const PerformanceTest = () => import('@/business/components/performance/Performa const PerformanceTestHome = () => import('@/business/components/performance/home/PerformanceTestHome') const EditPerformanceTest = () => import('@/business/components/performance/test/EditPerformanceTest') const PerformanceTestList = () => import('@/business/components/performance/test/PerformanceTestList') -const PerformanceTestReport = () => import('@/business/components/performance/report/PerformanceTestReport') +const PerformanceTestReportList = () => import('@/business/components/performance/report/PerformanceTestReportList') const PerformanceChart = () => import('@/business/components/performance/report/components/PerformanceChart') const PerformanceReportView = () => import('@/business/components/performance/report/PerformanceReportView') @@ -51,7 +51,7 @@ export default { { path: "report/:type", name: "perReport", - component: PerformanceTestReport + component: PerformanceTestReportList }, { path: "chart", From 41d7619d746d8d4ae2936bf850e99fb5ec5f9193 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 17 Mar 2021 16:24:14 +0800 Subject: [PATCH 02/12] =?UTF-8?q?fix(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95)?= =?UTF-8?q?:=20=E4=BF=AE=E5=A4=8D=E6=8A=A5=E5=91=8A=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E6=97=B6=E7=9A=84rps=E9=80=89=E9=A1=B9=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E7=82=B9=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/components/PerformancePressureConfig.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/business/components/performance/report/components/PerformancePressureConfig.vue b/frontend/src/business/components/performance/report/components/PerformancePressureConfig.vue index 633b28f122..6ef4fc1ef0 100644 --- a/frontend/src/business/components/performance/report/components/PerformancePressureConfig.vue +++ b/frontend/src/business/components/performance/report/components/PerformancePressureConfig.vue @@ -46,10 +46,10 @@
- +  
- +   Date: Wed, 17 Mar 2021 16:59:33 +0800 Subject: [PATCH 03/12] =?UTF-8?q?fix:=20=E8=84=91=E5=9B=BE=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/track/service/TestCaseService.java | 3 +++ .../components/common/components/MsModuleMinder.vue | 9 +++++++++ .../components/track/common/minder/TestCaseMinder.vue | 7 +++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index 9deb78377d..36579a7de3 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -731,6 +731,9 @@ public class TestCaseService { public void minderEdit(TestCaseMinderEditRequest request) { List data = request.getData(); data.forEach(item -> { + if (StringUtils.isBlank(item.getNodeId()) || item.getNodeId().equals("root")) { + item.setNodeId(""); + } item.setProjectId(request.getProjectId()); if (StringUtils.isBlank(item.getId()) || item.getId().length() < 20) { item.setId(UUID.randomUUID().toString()); diff --git a/frontend/src/business/components/common/components/MsModuleMinder.vue b/frontend/src/business/components/common/components/MsModuleMinder.vue index f489472ba8..4838d71d50 100644 --- a/frontend/src/business/components/common/components/MsModuleMinder.vue +++ b/frontend/src/business/components/common/components/MsModuleMinder.vue @@ -96,6 +96,15 @@ export default { }, parse(root, children) { root.children = []; + if (root.data.id === 'root') { + // nodeId 为空的用例 + let rootChildData = this.dataMap.get(""); + if (rootChildData) { + rootChildData.forEach((dataNode) => { + root.children.push(dataNode); + }) + } + } // 添加数据节点 let dataNodes = this.dataMap.get(root.data.id); if (dataNodes) { diff --git a/frontend/src/business/components/track/common/minder/TestCaseMinder.vue b/frontend/src/business/components/track/common/minder/TestCaseMinder.vue index fd374674d8..c4588fa03b 100644 --- a/frontend/src/business/components/track/common/minder/TestCaseMinder.vue +++ b/frontend/src/business/components/track/common/minder/TestCaseMinder.vue @@ -47,9 +47,9 @@ name: "TestCaseMinder", } }, save(data) { + console.log(this.dataMap); let saveCases = []; this.buildSaveCase(data.root, saveCases, undefined); - console.log(saveCases); let param = { projectId: this.projectId, data: saveCases @@ -72,6 +72,9 @@ name: "TestCaseMinder", }, _buildSaveCase(node, saveCases, parent) { let data = node.data; + if (!data.text) { + return; + } let isChange = false; let testCase = { id: data.id, @@ -81,7 +84,7 @@ name: "TestCaseMinder", type: data.type ? data.type : 'functional', method: data.method ? data.method: 'manual', maintainer: data.maintainer, - priority: 'P' + data.priority, + priority: 'P' + (data.priority ? data.priority : 0), }; if (data.changed) isChange = true; let steps = []; From 72bb3b8368af1224716758cac2a91b7d7a5ccc01 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 17 Mar 2021 17:22:26 +0800 Subject: [PATCH 04/12] =?UTF-8?q?refactor(=E6=80=A7=E8=83=BD=E6=B5=8B?= =?UTF-8?q?=E8=AF=95):=20k8s=20job=E8=AE=BE=E7=BD=AE=E5=8F=8D=E4=BA=B2?= =?UTF-8?q?=E5=92=8C=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/java/io/metersphere/xpack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index efd6af73b7..adefde265f 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit efd6af73b7c5cc53cd4515772000bc1436c49837 +Subproject commit adefde265ff12d4ea909353c3f46008f8a8e17e7 From 54d180084a8924f62961e554e1a85e82c7fc5ea1 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 17 Mar 2021 17:31:42 +0800 Subject: [PATCH 05/12] chore: sync --- frontend/src/business/components/xpack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index f278121988..b2571e06e8 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit f2781219889c2f993436bcc3ea90038f588fa73e +Subproject commit b2571e06e8b211821409115cc2c4a7c52cbac1db From b00a5a4fcd0c9c6056ad53d04d54f9b58f00810c Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 17 Mar 2021 17:47:49 +0800 Subject: [PATCH 06/12] =?UTF-8?q?refactor(=E6=80=A7=E8=83=BD=E6=B5=8B?= =?UTF-8?q?=E8=AF=95):=20=E8=B0=83=E6=95=B4rps=E4=B8=8A=E9=99=90=E4=B8=BA9?= =?UTF-8?q?9999,=E8=BF=AD=E4=BB=A3=E6=AC=A1=E6=95=B0=E4=B8=8A=E9=99=90?= =?UTF-8?q?=E4=B8=BA9999999?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/components/PerformancePressureConfig.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue b/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue index 29df9f4e18..b4c4317915 100644 --- a/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue +++ b/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue @@ -67,7 +67,7 @@ v-model="threadGroup.rpsLimit" @change="calculateChart(threadGroup)" :min="1" - :max="500" + :max="99999" size="mini"/>
@@ -112,7 +112,7 @@ :disabled="isReadOnly" v-model="threadGroup.iterateNum" :min="1" - :max="10000" + :max="9999999" @change="calculateChart(threadGroup)" size="mini"/>
@@ -124,7 +124,7 @@ :disabled="isReadOnly || !threadGroup.rpsLimitEnable" v-model="threadGroup.rpsLimit" :min="1" - :max="500" + :max="99999" size="mini"/>
From 41f81dff5e1cce8f5cfd705509cd5633610ff763 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 17 Mar 2021 18:19:34 +0800 Subject: [PATCH 07/12] =?UTF-8?q?fix:=20=E9=94=99=E8=AF=AF=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=97=B6=E5=8F=82=E6=95=B0=E7=B1=BB=E5=9E=8B=E4=B8=8D?= =?UTF-8?q?=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/handler/RestControllerExceptionHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/controller/handler/RestControllerExceptionHandler.java b/backend/src/main/java/io/metersphere/controller/handler/RestControllerExceptionHandler.java index 6534abf2fe..32bb4e9d89 100644 --- a/backend/src/main/java/io/metersphere/controller/handler/RestControllerExceptionHandler.java +++ b/backend/src/main/java/io/metersphere/controller/handler/RestControllerExceptionHandler.java @@ -32,7 +32,7 @@ public class RestControllerExceptionHandler { @ExceptionHandler(SQLException.class) - public ResultHolder sqlExceptionHandler(HttpServletRequest request, HttpServletResponse response, MSException e) { + public ResultHolder sqlExceptionHandler(HttpServletRequest request, HttpServletResponse response, SQLException e) { response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value()); return ResultHolder.error("SQL error happened, please check logs."); } From 94b7cd3e4c8fa14dfe72ea73528bfde386bfe266 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 17 Mar 2021 18:32:15 +0800 Subject: [PATCH 08/12] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA)?= =?UTF-8?q?:=20=E7=94=A8=E4=BE=8B=E5=85=B3=E8=81=94Zentao=E9=9C=80?= =?UTF-8?q?=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/track/dto/DemandDTO.java | 1 + .../track/issue/AbstractIssuePlatform.java | 2 +- .../metersphere/track/issue/JiraPlatform.java | 7 ++- .../track/issue/LocalPlatform.java | 2 +- .../metersphere/track/issue/TapdPlatform.java | 35 +++++++++------ .../track/issue/ZentaoPlatform.java | 43 +++++++++++++++++-- .../track/service/DemandService.java | 11 ++--- .../track/case/components/TestCaseEdit.vue | 29 +++++++++---- 8 files changed, 93 insertions(+), 37 deletions(-) diff --git a/backend/src/main/java/io/metersphere/track/dto/DemandDTO.java b/backend/src/main/java/io/metersphere/track/dto/DemandDTO.java index 546f1a836c..1fba8cad3b 100644 --- a/backend/src/main/java/io/metersphere/track/dto/DemandDTO.java +++ b/backend/src/main/java/io/metersphere/track/dto/DemandDTO.java @@ -8,4 +8,5 @@ import lombok.Setter; public class DemandDTO { private String id; private String name; + private String platform; } diff --git a/backend/src/main/java/io/metersphere/track/issue/AbstractIssuePlatform.java b/backend/src/main/java/io/metersphere/track/issue/AbstractIssuePlatform.java index 6c89ff1732..3f809848aa 100644 --- a/backend/src/main/java/io/metersphere/track/issue/AbstractIssuePlatform.java +++ b/backend/src/main/java/io/metersphere/track/issue/AbstractIssuePlatform.java @@ -102,7 +102,7 @@ public abstract class AbstractIssuePlatform implements IssuesPlatform { * * @return 其他平台和本地项目绑定的属性值 */ - abstract String getProjectId(); + abstract String getProjectId(String projectId); protected boolean isIntegratedPlatform(String orgId, String platform) { IntegrationRequest request = new IntegrationRequest(); diff --git a/backend/src/main/java/io/metersphere/track/issue/JiraPlatform.java b/backend/src/main/java/io/metersphere/track/issue/JiraPlatform.java index 204366015e..b4d3772bda 100644 --- a/backend/src/main/java/io/metersphere/track/issue/JiraPlatform.java +++ b/backend/src/main/java/io/metersphere/track/issue/JiraPlatform.java @@ -103,7 +103,7 @@ public class JiraPlatform extends AbstractIssuePlatform { String auth = EncryptUtils.base64Encoding(account + ":" + password); String testCaseId = issuesRequest.getTestCaseId(); - String jiraKey = getProjectId(); + String jiraKey = getProjectId(null); if (StringUtils.isBlank(jiraKey)) { @@ -200,7 +200,10 @@ public class JiraPlatform extends AbstractIssuePlatform { } @Override - String getProjectId() { + String getProjectId(String projectId) { + if (StringUtils.isNotBlank(projectId)) { + return projectService.getProjectById(projectId).getJiraKey(); + } TestCaseWithBLOBs testCase = testCaseService.getTestCase(testCaseId); Project project = projectService.getProjectById(testCase.getProjectId()); return project.getJiraKey(); diff --git a/backend/src/main/java/io/metersphere/track/issue/LocalPlatform.java b/backend/src/main/java/io/metersphere/track/issue/LocalPlatform.java index a588c95092..51479778e2 100644 --- a/backend/src/main/java/io/metersphere/track/issue/LocalPlatform.java +++ b/backend/src/main/java/io/metersphere/track/issue/LocalPlatform.java @@ -66,7 +66,7 @@ public class LocalPlatform extends AbstractIssuePlatform { } @Override - String getProjectId() { + String getProjectId(String projectId) { return null; } diff --git a/backend/src/main/java/io/metersphere/track/issue/TapdPlatform.java b/backend/src/main/java/io/metersphere/track/issue/TapdPlatform.java index 6440c70074..41efb3e496 100644 --- a/backend/src/main/java/io/metersphere/track/issue/TapdPlatform.java +++ b/backend/src/main/java/io/metersphere/track/issue/TapdPlatform.java @@ -36,7 +36,7 @@ public class TapdPlatform extends AbstractIssuePlatform { @Override public List getIssue() { List list = new ArrayList<>(); - String tapdId = getProjectId(); + String tapdId = getProjectId(""); TestCaseIssuesExample example = new TestCaseIssuesExample(); example.createCriteria().andTestCaseIdEqualTo(testCaseId); @@ -67,18 +67,22 @@ public class TapdPlatform extends AbstractIssuePlatform { @Override public List getDemandList(String projectId) { - System.out.println(projectId); List demandList = new ArrayList<>(); - String url = "https://api.tapd.cn/stories?workspace_id=" + projectId; - ResultHolder call = call(url); - String listJson = JSON.toJSONString(call.getData()); - JSONArray jsonArray = JSON.parseArray(listJson); - System.out.println(jsonArray); - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject o = jsonArray.getJSONObject(i); - DemandDTO demand = o.getObject("Story", DemandDTO.class); - demandList.add(demand); + try { + String url = "https://api.tapd.cn/stories?workspace_id=" + getProjectId(projectId); + ResultHolder call = call(url); + String listJson = JSON.toJSONString(call.getData()); + JSONArray jsonArray = JSON.parseArray(listJson); + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject o = jsonArray.getJSONObject(i); + DemandDTO demand = o.getObject("Story", DemandDTO.class); + demand.setPlatform(IssuesManagePlatform.Tapd.name()); + demandList.add(demand); + } + } catch (Exception e) { + LogUtil.error(e.getMessage()); } + return demandList; } @@ -111,7 +115,7 @@ public class TapdPlatform extends AbstractIssuePlatform { public void addIssue(IssuesRequest issuesRequest) { String url = "https://api.tapd.cn/bugs"; String testCaseId = issuesRequest.getTestCaseId(); - String tapdId = getProjectId(); + String tapdId = getProjectId(""); if (StringUtils.isBlank(tapdId)) { MSException.throwException("未关联Tapd 项目ID"); @@ -172,7 +176,7 @@ public class TapdPlatform extends AbstractIssuePlatform { @Override public List getPlatformUser() { List users = new ArrayList<>(); - String projectId = getProjectId(); + String projectId = getProjectId(""); String url = "https://api.tapd.cn/workspaces/users?workspace_id=" + projectId; ResultHolder call = call(url); String listJson = JSON.toJSONString(call.getData()); @@ -186,7 +190,10 @@ public class TapdPlatform extends AbstractIssuePlatform { } @Override - String getProjectId() { + String getProjectId(String projectId) { + if (StringUtils.isNotBlank(projectId)) { + return projectService.getProjectById(projectId).getTapdId(); + } TestCaseWithBLOBs testCase = testCaseService.getTestCase(testCaseId); Project project = projectService.getProjectById(testCase.getProjectId()); return project.getTapdId(); diff --git a/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java b/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java index dd2b0caa51..2659cb1c88 100644 --- a/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java +++ b/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java @@ -48,7 +48,10 @@ public class ZentaoPlatform extends AbstractIssuePlatform { } @Override - String getProjectId() { + String getProjectId(String projectId) { + if (StringUtils.isNotBlank(projectId)) { + return projectService.getProjectById(projectId).getZentaoId(); + } TestCaseWithBLOBs testCase = testCaseService.getTestCase(testCaseId); Project project = projectService.getProjectById(testCase.getProjectId()); return project.getZentaoId(); @@ -88,7 +91,39 @@ public class ZentaoPlatform extends AbstractIssuePlatform { @Override public List getDemandList(String projectId) { - return null; + //getTestStories + List list = new ArrayList<>(); + try { + String session = login(); + String key = getProjectId(projectId); + HttpEntity requestEntity = new HttpEntity<>(new HttpHeaders()); + RestTemplate restTemplate = new RestTemplate(); + ResponseEntity responseEntity = restTemplate.exchange(url + "api-getModel-story-getProductStories-productID={key}?zentaosid=" + session, + HttpMethod.POST, requestEntity, String.class, key); + String body = responseEntity.getBody(); + JSONObject obj = JSONObject.parseObject(body); + + LogUtil.info("project story" + key + obj); + + if (obj != null) { + JSONObject data = obj.getJSONObject("data"); + String s = JSON.toJSONString(data); + Map map = JSONArray.parseObject(s, Map.class); + Collection values = map.values(); + values.forEach(v -> { + JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(v)); + DemandDTO demandDTO = new DemandDTO(); + demandDTO.setId(jsonObject.getString("id")); + demandDTO.setName(jsonObject.getString("title")); + demandDTO.setPlatform(IssuesManagePlatform.Zentao.name()); + list.add(demandDTO); + }); + + } + } catch (Exception e) { + LogUtil.error("get zentao bug fail " + e.getMessage()); + } + return list; } private Issues getZentaoIssues(String bugId) { @@ -135,7 +170,7 @@ public class ZentaoPlatform extends AbstractIssuePlatform { public void addIssue(IssuesRequest issuesRequest) { String session = login(); - String projectId = getProjectId(); + String projectId = getProjectId(null); if (StringUtils.isBlank(projectId)) { MSException.throwException("add zentao bug fail, project zentao id is null"); @@ -279,7 +314,7 @@ public class ZentaoPlatform extends AbstractIssuePlatform { public List getBuilds() { String session = login(); - String projectId = getProjectId(); + String projectId = getProjectId(null); HttpHeaders httpHeaders = new HttpHeaders(); HttpEntity requestEntity = new HttpEntity<>(httpHeaders); RestTemplate restTemplate = new RestTemplate(); diff --git a/backend/src/main/java/io/metersphere/track/service/DemandService.java b/backend/src/main/java/io/metersphere/track/service/DemandService.java index 06a89abd43..5463ea27ae 100644 --- a/backend/src/main/java/io/metersphere/track/service/DemandService.java +++ b/backend/src/main/java/io/metersphere/track/service/DemandService.java @@ -32,9 +32,7 @@ public class DemandService { public List getDemandList(String projectId) { Project project = projectMapper.selectByPrimaryKey(projectId); SessionUser user = SessionUtils.getUser(); -/* - String orgId = "88aceecf-5764-4094-96a9-f82bd52e77ad"; -*/ + String orgId = user.getLastOrganizationId(); boolean tapd = issuesService.isIntegratedPlatform(orgId, IssuesManagePlatform.Tapd.toString()); boolean jira = issuesService.isIntegratedPlatform(orgId, IssuesManagePlatform.Jira.toString()); @@ -48,7 +46,6 @@ public class DemandService { if (StringUtils.isNotBlank(tapdId)) { platforms.add(IssuesManagePlatform.Tapd.name()); } - issueRequest.setProjectId(tapdId); } if (jira) { @@ -56,7 +53,6 @@ public class DemandService { if (StringUtils.isNotBlank(jiraKey)) { platforms.add(IssuesManagePlatform.Jira.name()); } - issueRequest.setProjectId(jiraKey); } if (zentao) { @@ -64,13 +60,14 @@ public class DemandService { if (StringUtils.isNotBlank(zentaoId)) { platforms.add(IssuesManagePlatform.Zentao.name()); } - issueRequest.setProjectId(zentaoId); } + List platformList = IssueFactory.createPlatforms(platforms, issueRequest); platformList.forEach(platform -> { - List demand = platform.getDemandList(issueRequest.getProjectId()); + List demand = platform.getDemandList(projectId); list.addAll(demand); }); + return list; } } diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index 4ddd1d4e2a..a40f69d661 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -136,12 +136,12 @@ - @@ -761,18 +761,31 @@ export default { }); } }, + visibleChange(flag) { + if (flag) { + this.getDemandOptions() + } + }, getDemandOptions() { - this.projectId = getCurrentProjectID() - this.result = this.$get("demand/list/" + this.projectId, response => { - this.demandOptions = response.data; - this.demandOptions.unshift({id: 'other', name: this.$t('test_track.case.other')}) - }); + if (this.demandOptions.length === 0) { + this.projectId = getCurrentProjectID(); + this.result = {loading : true}; + this.$get("demand/list/" + this.projectId).then(response => { + this.demandOptions = response.data.data; + this.demandOptions.unshift({id: 'other', name: this.$t('test_track.case.other'), platform: 'Other'}) + this.result = {loading : false}; + }).catch(() => { + this.result = {loading : false}; + }) + } }, getSelectOptions() { this.getModuleOptions(); this.getMaintainerOptions(); this.getTestOptions(); - // this.getDemandOptions() + if (this.type === 'edit') { + this.getDemandOptions(); + } }, resetForm() { From 319450d701f43877fe73d184a6bb10edfbd5ca72 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 17 Mar 2021 18:44:59 +0800 Subject: [PATCH 09/12] =?UTF-8?q?style(=E6=8E=A5=E5=8F=A3=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96):=20=E6=AD=A5=E9=AA=A4=E6=9C=80=E5=A4=A7?= =?UTF-8?q?=E5=8C=96=E6=97=B6=E5=86=85=E5=AE=B9=E8=BF=87=E5=A4=9A=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scenario/common/ApiBaseComponent.vue | 32 ++++--- .../scenario/maximize/MaximizeScenario.vue | 83 +++++++++++-------- .../scenario/maximize/MsLeftContainer.vue | 8 ++ 3 files changed, 77 insertions(+), 46 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue b/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue index a2462b7669..837b8e655c 100644 --- a/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue @@ -1,21 +1,23 @@