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 01d6fb3e53..7811553000 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(); 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/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); 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连接 } } } 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: '取消編輯',