From 7714805698d634a5ec6e8b20127597c04fd8f397 Mon Sep 17 00:00:00 2001 From: q4speed Date: Fri, 28 Aug 2020 17:10:17 +0800 Subject: [PATCH 1/4] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/components/api/test/ApiTestList.vue | 15 ++------------- .../components/api/test/OneClickOperation.vue | 6 ++---- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/frontend/src/business/components/api/test/ApiTestList.vue b/frontend/src/business/components/api/test/ApiTestList.vue index 18779dc6fa..8c2c7903f6 100644 --- a/frontend/src/business/components/api/test/ApiTestList.vue +++ b/frontend/src/business/components/api/test/ApiTestList.vue @@ -17,7 +17,7 @@ + @filter-change="filter" @select-all="select" @select="select"> @@ -127,18 +127,7 @@ create() { this.$router.push('/api/test/create'); }, - - handleSelectAll(selection) { - this.selectIds.clear() - this.selectProjectNames.clear() - this.selectProjectId.clear() - selection.forEach(s => { - this.selectIds.add(s.id) - this.selectProjectNames.add(s.projectName) - this.selectProjectId.add(s.projectId) - }) - }, - selectionChange(selection) { + select(selection) { this.selectIds.clear() this.selectProjectNames.clear() this.selectProjectId.clear() diff --git a/frontend/src/business/components/api/test/OneClickOperation.vue b/frontend/src/business/components/api/test/OneClickOperation.vue index 9ea2c7e268..3081b87d8e 100644 --- a/frontend/src/business/components/api/test/OneClickOperation.vue +++ b/frontend/src/business/components/api/test/OneClickOperation.vue @@ -26,7 +26,7 @@ import MsApiScenarioConfig from "./components/ApiScenarioConfig"; import MsApiReportStatus from "../report/ApiReportStatus"; import MsApiReportDialog from "./ApiReportDialog"; - import {getUUID} from "../../../../common/js/utils"; + import {getUUID} from "@/common/js/utils"; export default { @@ -95,13 +95,12 @@ }, checkName(callback) { for (let i of this.selectProjectId) { - this.result = this.$post('/api/checkName', {name: this.ruleForm.testName, projectId: i}, response => { + this.result = this.$post('/api/checkName', {name: this.ruleForm.testName, projectId: i}, () => { if (callback) callback(); }) } }, _getEnvironmentAndRunTest: function (item) { - let count = 0; this.result = this.$get('/api/environment/list/' + item.projectId, response => { let environments = response.data; let environmentMap = new Map(); @@ -131,7 +130,6 @@ scenarioDefinition: JSON.parse(item.scenarioDefinition), schedule: {}, }); - console.log(test) this.test = this.test || test; if (this.tests.length > 1) { this.test.scenarioDefinition = this.test.scenarioDefinition.concat(test.scenarioDefinition); From c29dd9324369feb30399e413451dea1851e9c98a Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Fri, 28 Aug 2020 17:24:24 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E7=82=B9=E5=87=BB=E5=86=8D=E6=AC=A1=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E6=97=B6=E6=9F=A5=E8=AF=A2=E6=97=B6=E9=97=B4=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/PerformanceReportView.vue | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/frontend/src/business/components/performance/report/PerformanceReportView.vue b/frontend/src/business/components/performance/report/PerformanceReportView.vue index 6492b79630..34b33e0bd0 100644 --- a/frontend/src/business/components/performance/report/PerformanceReportView.vue +++ b/frontend/src/business/components/performance/report/PerformanceReportView.vue @@ -142,6 +142,10 @@ export default { } }, initReportTimeInfo() { + if (this.status === 'Starting') { + this.clearData(); + return; + } if (this.reportId) { this.result = this.$get("/performance/report/content/report_time/" + this.reportId) .then(res => { @@ -155,7 +159,7 @@ export default { } }).catch(() => { this.clearData(); - }) + }); } }, initWebSocket() { @@ -226,10 +230,15 @@ export default { onMessage(e) { this.$set(this.report, "refresh", e.data); // 触发刷新 this.$set(this.report, "status", 'Running'); + this.status = 'Running'; this.initReportTimeInfo(); window.console.log('receive a message:', e.data); }, onClose(e) { + if (e.code === 1005) { + // 强制删除之后关闭socket,不用刷新report + return; + } this.$set(this.report, "refresh", Math.random()); // 触发刷新 this.$set(this.report, "status", 'Completed'); this.initReportTimeInfo(); @@ -262,9 +271,6 @@ export default { }); }, - beforeDestroy() { - this.websocket.close() //离开路由之后断开websocket连接 - }, watch: { '$route'(to) { if (to.name === "perReportView") { @@ -295,6 +301,9 @@ export default { }); } + } else { + console.log("close socket."); + this.websocket.close() //离开路由之后断开websocket连接 } } } From b88e3d5bff6c925b3e31267b92be19bf6b812b2e Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Fri, 28 Aug 2020 18:16:27 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20jira=20=E6=8F=90=E4=BA=A4=E7=BC=BA?= =?UTF-8?q?=E9=99=B7=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../track/service/IssuesService.java | 7 +++++-- .../organization/IssuesManagement.vue | 21 ++++++++++++++++--- frontend/src/i18n/en-US.js | 5 ++++- frontend/src/i18n/zh-CN.js | 5 ++++- frontend/src/i18n/zh-TW.js | 5 ++++- 5 files changed, 35 insertions(+), 8 deletions(-) diff --git a/backend/src/main/java/io/metersphere/track/service/IssuesService.java b/backend/src/main/java/io/metersphere/track/service/IssuesService.java index 718fdcd05a..76e55cf953 100644 --- a/backend/src/main/java/io/metersphere/track/service/IssuesService.java +++ b/backend/src/main/java/io/metersphere/track/service/IssuesService.java @@ -224,6 +224,10 @@ public class IssuesService { String account = object.getString("account"); String password = object.getString("password"); String url = object.getString("url"); + String issuetype = object.getString("issuetype"); + if (StringUtils.isBlank(issuetype)) { + MSException.throwException("Jira 问题类型为空"); + } String auth = EncryptUtils.base64Encoding(account + ":" + password); String testCaseId = issuesRequest.getTestCaseId(); @@ -252,8 +256,7 @@ public class IssuesService { " \"summary\":\"" + issuesRequest.getTitle() + "\",\n" + " \"description\": " + JSON.toJSONString(desc) + ",\n" + " \"issuetype\":{\n" + - " \"id\":\"10009\",\n" + - " \"name\":\"Defect\"\n" + + " \"name\":\"" + issuetype + "\"\n" + " }\n" + " }\n" + "}"; diff --git a/frontend/src/business/components/settings/organization/IssuesManagement.vue b/frontend/src/business/components/settings/organization/IssuesManagement.vue index f8c58a3d72..b92784626b 100644 --- a/frontend/src/business/components/settings/organization/IssuesManagement.vue +++ b/frontend/src/business/components/settings/organization/IssuesManagement.vue @@ -25,6 +25,9 @@ + + + @@ -43,10 +46,13 @@
{{$t('organization.integration.use_tip')}}
- 1. {{$t('organization.integration.use_tip_one')}} + 1. {{$t('organization.integration.use_tip_tapd')}}
- 2. {{$t('organization.integration.use_tip_two')}} + 2. {{$t('organization.integration.use_tip_jira')}} +
+
+ 3. {{$t('organization.integration.use_tip_two')}} {{$t('organization.integration.link_the_project_now')}} @@ -85,6 +91,11 @@ required: true, message: this.$t('organization.integration.input_jira_url'), trigger: ['change', 'blur'] + }, + issuetype: { + required: true, + message: this.$t('organization.integration.input_jira_issuetype'), + trigger: ['change', 'blur'] } }, } @@ -105,6 +116,7 @@ this.$set(this.form, 'account', config.account); this.$set(this.form, 'password', config.password); this.$set(this.form, 'url', config.url); + this.$set(this.form, 'issuetype', config.issuetype); } else { this.clear(); } @@ -153,7 +165,8 @@ let auth = { account: this.form.account, password: this.form.password, - url: this.form.url + url: this.form.url, + issuetype: this.form.issuetype }; param.organizationId = getCurrentUser().lastOrganizationId; param.platform = this.platform; @@ -188,6 +201,7 @@ this.$set(this.form, 'account', config.account); this.$set(this.form, 'password', config.password); this.$set(this.form, 'url', config.url); + this.$set(this.form, 'issuetype', config.issuetype); } else { this.clear(); } @@ -197,6 +211,7 @@ this.$set(this.form, 'account', ''); this.$set(this.form, 'password', ''); this.$set(this.form, 'url', ''); + this.$set(this.form, 'issuetype', ''); this.$nextTick(() => { this.$refs.form.clearValidate(); }); diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 0ec14010a0..398045b91b 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -186,11 +186,14 @@ export default { api_account: 'API account', api_password: 'API password', jira_url: 'JIRA url', + jira_issuetype: 'JIRA issuetype', input_api_account: 'please enter account', input_api_password: 'Please enter password', input_jira_url: 'Please enter Jira address, for example: https://metersphere.atlassian.net/', + input_jira_issuetype: 'Please enter the question type', use_tip: 'Usage guidelines:', - use_tip_one: 'Basic Auth account information is queried in "Company Management-Security and Integration-Open Platform"', + use_tip_tapd: 'Basic Auth account information is queried in "Company Management-Security and Integration-Open Platform"', + use_tip_jira: 'Jira software server authentication information is account password, Jira software cloud authentication information is account + token (account settings-security-create API token)', use_tip_two: 'After saving the Basic Auth account information, you need to manually associate the ID/key in the Metersphere project', link_the_project_now: 'Link the project now', cancel_edit: 'Cancel edit', diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 974ac9d8ab..53136704ea 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -187,11 +187,14 @@ export default { api_account: 'API 账号', api_password: 'API 口令', jira_url: 'JIRA 地址', + jira_issuetype: '问题类型', input_api_account: '请输入账号', input_api_password: '请输入口令', input_jira_url: '请输入Jira地址,例:https://metersphere.atlassian.net/', + input_jira_issuetype: '请输入问题类型', use_tip: '使用指引:', - use_tip_one: 'Basic Auth 账号信息在"公司管理-安全与集成-开放平台"中查询', + use_tip_tapd: 'Tapd Basic Auth 账号信息在"公司管理-安全与集成-开放平台"中查询', + use_tip_jira: 'Jira software server 认证信息为 账号密码,Jira software cloud 认证信息为 账号+令牌(账户设置-安全-创建API令牌)', use_tip_two: '保存 Basic Auth 账号信息后,需要在 Metersphere 项目中手动关联 ID/key', link_the_project_now: '马上关联项目', cancel_edit: '取消编辑', diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 681aa06395..2e1ec0b27c 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -185,11 +185,14 @@ export default { api_account: 'API 賬號', api_password: 'API 口令', jira_url: 'JIRA 地址', + jira_issuetype: '問題類型', input_api_account: '請輸入賬號', input_api_password: '請輸入口令', input_jira_url: '請輸入Jira地址,例:https://metersphere.atlassian.net/', + input_jira_issuetype: '請輸入問題類型', use_tip: '使用指引:', - use_tip_one: 'Basic Auth 賬號信息在"公司管理-安全與集成-開放平台"中查詢', + use_tip_tapd: 'Basic Auth 賬號信息在"公司管理-安全與集成-開放平台"中查詢', + use_tip_jira: 'Jira software server 認證信息為 賬號密碼,Jira software cloud 認證信息為 賬號+令牌(賬戶設置-安全-創建API令牌)', use_tip_two: '保存 Basic Auth 賬號信息後,需要在 Metersphere 項目中手動關聯 ID/key', link_the_project_now: '馬上關聯項目', cancel_edit: '取消編輯', From 29d43bee4c2e84e0b938533e82f9c198a6aa8ac0 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 28 Aug 2020 19:24:13 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20GET=E8=AF=B7=E6=B1=82url=E5=A4=9A=E5=B8=A6=E4=BA=86&?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/api/controller/APITestController.java | 2 +- .../java/io/metersphere/api/parse/JmeterDocumentParser.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/controller/APITestController.java b/backend/src/main/java/io/metersphere/api/controller/APITestController.java index d423ab0604..bf555b0493 100644 --- a/backend/src/main/java/io/metersphere/api/controller/APITestController.java +++ b/backend/src/main/java/io/metersphere/api/controller/APITestController.java @@ -66,7 +66,7 @@ public class APITestController { @PostMapping(value = "/update", consumes = {"multipart/form-data"}) public void update(@RequestPart("request") SaveAPITestRequest request, @RequestPart(value = "file") MultipartFile file, @RequestPart(value = "files") List bodyFiles) { - apiTestService.update(request, file, bodyFiles); + apiTestService.update(request, file, bodyFiles); } @PostMapping(value = "/copy") diff --git a/backend/src/main/java/io/metersphere/api/parse/JmeterDocumentParser.java b/backend/src/main/java/io/metersphere/api/parse/JmeterDocumentParser.java index 253ae0ff6d..efa1771c8c 100644 --- a/backend/src/main/java/io/metersphere/api/parse/JmeterDocumentParser.java +++ b/backend/src/main/java/io/metersphere/api/parse/JmeterDocumentParser.java @@ -157,7 +157,7 @@ public class JmeterDocumentParser { u += k + "=" + ScriptEngineUtils.calculate(v); return u; }); - ele.setTextContent(url + params); + ele.setTextContent(url + ((params != null && !params.equals("?")) ? params : "")); break; case "Argument.value": String textContent = ele.getTextContent();