diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java index ca7b5f8671..c6e3d23319 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java @@ -125,7 +125,7 @@ public class ElementUtil { boolean isRepository = false; BodyFile file = item.getFiles().get(0); boolean isRef = StringUtils.equalsIgnoreCase(file.getStorage(), StorageConstants.FILE_REF.name()); - String path = StringUtils.join(BODY_FILE_DIR, File.pathSeparator, item.getFiles().get(0).getId(), "_", item.getFiles().get(0).getName()); + String path = StringUtils.join(BODY_FILE_DIR, File.separator, item.getFiles().get(0).getId(), "_", item.getFiles().get(0).getName()); if (StringUtils.equalsIgnoreCase(file.getStorage(), StorageConstants.FILE_REF.name())) { fileId = file.getFileId(); FileMetadata fileMetadata = fileMetadataService.getFileMetadataById(fileId); diff --git a/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioEnvService.java b/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioEnvService.java index 2b6fa4155d..b82474612d 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioEnvService.java +++ b/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioEnvService.java @@ -74,14 +74,11 @@ public class ApiScenarioEnvService { List hasFullUrlList = new ArrayList<>(); for (MsTestElement testElement : hashTree) { this.formatElement(testElement, env, hasFullUrlList); - if (CollectionUtils.isNotEmpty(testElement.getHashTree()) && !hasFullUrlList.contains(false)) { + if (CollectionUtils.isNotEmpty(testElement.getHashTree())) { getHashTree(testElement.getHashTree(), env, hasFullUrlList); } - if (hasFullUrlList.contains(false)) { - env.setFullUrl(false); - break; - } } + env.setFullUrl(!hasFullUrlList.contains(false)); return env; } @@ -92,12 +89,9 @@ public class ApiScenarioEnvService { tree = tree.stream().filter(item -> item.isEnable()).collect(Collectors.toList()); for (MsTestElement element : tree) { this.formatElement(element, env, hasFullUrlList); - if (CollectionUtils.isNotEmpty(element.getHashTree()) && !hasFullUrlList.contains(false)) { + if (CollectionUtils.isNotEmpty(element.getHashTree())) { getHashTree(element.getHashTree(), env, hasFullUrlList); } - if (hasFullUrlList.contains(false)) { - break; - } } } catch (Exception e) { LogUtil.error(e); diff --git a/api-test/backend/src/main/java/io/metersphere/service/plan/TestPlanApiCaseService.java b/api-test/backend/src/main/java/io/metersphere/service/plan/TestPlanApiCaseService.java index 87cf7dfe72..f850abefe5 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/plan/TestPlanApiCaseService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/plan/TestPlanApiCaseService.java @@ -439,11 +439,16 @@ public class TestPlanApiCaseService { try { responseObj = JSON.parseMap(execResult.getContent()); } catch (Exception e) { + LogUtil.error("转换content失败!", e); } if (StringUtils.isNotEmpty(execResult.getEnvConfig())) { responseObj.put("envName", apiDefinitionService.getEnvNameByEnvConfig(execResult.getProjectId(), execResult.getEnvConfig())); } - item.setResponse(responseObj.toString()); + /* + * 之前这里的写法是responseObj.toString()。 + * 猜测是fastjson转换之后,只是单纯的把JSONObject改成了map。所以这里放进去的不是json格式的数据 + */ + item.setResponse(JSON.toJSONString(responseObj)); } }); } diff --git a/api-test/frontend/src/business/automation/scenario/common/JDBCProcessorContent.vue b/api-test/frontend/src/business/automation/scenario/common/JDBCProcessorContent.vue index 7948629256..383cf91b79 100644 --- a/api-test/frontend/src/business/automation/scenario/common/JDBCProcessorContent.vue +++ b/api-test/frontend/src/business/automation/scenario/common/JDBCProcessorContent.vue @@ -147,7 +147,7 @@ export default { }; }, created() { - this.getEnvironments(); + this.getEnvironments(null, 'created'); }, computed: { projectId() { @@ -235,7 +235,7 @@ export default { this.initDataSource(undefined, undefined, targetDataSourceName); }); }, - getEnvironments(environmentId) { + getEnvironments(environmentId, isCreated) { let envId = ''; let id = this.request.projectId ? this.request.projectId : this.projectId; let scenarioEnvId = this.scenarioId !== '' ? this.scenarioId + '_' + id : id; @@ -262,7 +262,11 @@ export default { envId = this.request.refEevMap.get(id); } } - if (envId === this.request.originalEnvironmentId && this.request.originalDataSourceId) { + if ( + envId === this.request.originalEnvironmentId && + this.request.originalDataSourceId && + isCreated !== 'created' + ) { this.request.dataSourceId = this.request.originalDataSourceId; } let targetDataSourceName = ''; diff --git a/system-setting/frontend/src/i18n/lang/zh-CN.js b/system-setting/frontend/src/i18n/lang/zh-CN.js index e6a295ff45..c4880b7964 100644 --- a/system-setting/frontend/src/i18n/lang/zh-CN.js +++ b/system-setting/frontend/src/i18n/lang/zh-CN.js @@ -24,8 +24,8 @@ const message = { title: '显示设置', logo: '系统 LOGO', loginLogo: '登录页左上角 LOGO', - loginImage: '登陆页面右侧图片', - loginTitle: '登陆页面提示信息', + loginImage: '登录页面右侧图片', + loginTitle: '登录页面提示信息', pageTitle: '页面 Title', sysTitle: '系统名称', theme_style: '主题风格设置', diff --git a/system-setting/frontend/src/i18n/lang/zh-TW.js b/system-setting/frontend/src/i18n/lang/zh-TW.js index 38a4f69a6a..7f1791fca7 100644 --- a/system-setting/frontend/src/i18n/lang/zh-TW.js +++ b/system-setting/frontend/src/i18n/lang/zh-TW.js @@ -24,8 +24,8 @@ const message = { title: '顯示設置', logo: '系統 LOGO', loginLogo: '登錄頁左上角 LOGO', - loginImage: '登陸頁面右側圖片', - loginTitle: '登陸頁面提示信息', + loginImage: '登錄頁面右側圖片', + loginTitle: '登錄頁面提示信息', pageTitle: '頁面 Title', sysTitle: '系統名稱', theme_style: '主題風格設置', diff --git a/test-track/frontend/src/business/case/components/RelationshipFunctionalRelevance.vue b/test-track/frontend/src/business/case/components/RelationshipFunctionalRelevance.vue index aae2dfd351..af0008d57d 100644 --- a/test-track/frontend/src/business/case/components/RelationshipFunctionalRelevance.vue +++ b/test-track/frontend/src/business/case/components/RelationshipFunctionalRelevance.vue @@ -16,6 +16,7 @@ import {getPageDate, getPageInfo} from "metersphere-frontend/src/utils/tableUtil import {TEST_PLAN_RELEVANCE_FUNC_CONFIGS} from "metersphere-frontend/src/components/search/search-components"; import FunctionalRelevance from "@/business/plan/view/comonents/functional/FunctionalRelevance"; import {addTestCaseRelationship, getTestCaseNodesByCaseFilter, testCaseRelationshipRelateList} from "@/api/testCase"; +import {parseTag} from "@/business/utils/sdk-utils"; export default { name: "RelationshipFunctionalRelevance", @@ -86,10 +87,7 @@ export default { .then(response => { getPageDate(response, this.page); let data = this.page.data; - data.forEach(item => { - item.checked = false; - item.tags = JSON.parse(item.tags); - }); + parseTag(data); }) }, getTreeNodes(vueObj) { diff --git a/test-track/frontend/src/business/plan/view/comonents/api/RelevanceCaseList.vue b/test-track/frontend/src/business/plan/view/comonents/api/RelevanceCaseList.vue index cb6f0b98df..aacfa70d22 100644 --- a/test-track/frontend/src/business/plan/view/comonents/api/RelevanceCaseList.vue +++ b/test-track/frontend/src/business/plan/view/comonents/api/RelevanceCaseList.vue @@ -114,7 +114,7 @@ import { } from "metersphere-frontend/src/components/search/search-components"; import MsSearch from "metersphere-frontend/src/components/search/MsSearch"; import ApiListContainer from "@/business/plan/view/comonents/api/ApiListContainer"; -import {buildBatchParam, hasLicense, isProjectVersionEnable} from "@/business/utils/sdk-utils"; +import {buildBatchParam, hasLicense, isProjectVersionEnable, parseTag} from "@/business/utils/sdk-utils"; import PriorityTableItem from "@/business/common/tableItems/planview/PriorityTableItem"; import {apiDefinitionGet} from "@/api/remote/api/api-definition"; import {testPlanApiCaseRelevanceList} from "@/api/remote/plan/test-plan-api-case"; @@ -246,11 +246,7 @@ export default { this.loading = false; this.total = response.data.itemCount; this.tableData = response.data.listObject; - this.tableData.forEach(item => { - if (item.tags && item.tags.length > 0) { - item.tags = JSON.parse(item.tags); - } - }); + parseTag(this.tableData); }); }, clear() { diff --git a/test-track/frontend/src/business/plan/view/comonents/api/TestPlanApiCaseList.vue b/test-track/frontend/src/business/plan/view/comonents/api/TestPlanApiCaseList.vue index b8e779a89d..1e1db96465 100644 --- a/test-track/frontend/src/business/plan/view/comonents/api/TestPlanApiCaseList.vue +++ b/test-track/frontend/src/business/plan/view/comonents/api/TestPlanApiCaseList.vue @@ -593,9 +593,7 @@ export default { // 这里先打开报告,建立 websock // 否则可能执行完了才建立 websock,拿不到结果 this.$refs.apiCaseResult.open(reportId); - setTimeout(() => { - run(row.id, reportId); - }, 3000); + run(row.id, reportId); }, handleTestEnd(reportId) { if (this.runningReport.has(reportId)) { diff --git a/test-track/frontend/src/business/plan/view/comonents/functional/TestPlanFunctionalRelevance.vue b/test-track/frontend/src/business/plan/view/comonents/functional/TestPlanFunctionalRelevance.vue index 8de536c038..37c39602a8 100644 --- a/test-track/frontend/src/business/plan/view/comonents/functional/TestPlanFunctionalRelevance.vue +++ b/test-track/frontend/src/business/plan/view/comonents/functional/TestPlanFunctionalRelevance.vue @@ -18,6 +18,7 @@ import FunctionalRelevance from "@/business/plan/view/comonents/functional/Funct import {testPlanRelevance} from "@/api/remote/plan/test-plan"; import {testCaseRelateList} from "@/api/testCase"; import {testCaseNodeListPlanRelate} from "@/api/test-case-node"; +import {parseTag} from "@/business/utils/sdk-utils"; export default { name: "TestPlanFunctionalRelevance", @@ -88,9 +89,9 @@ export default { this.page.loading = false; getPageDate(response, this.page); let data = this.page.data; + parseTag(this.page.data); data.forEach(item => { item.checked = false; - item.tags = JSON.parse(item.tags); }); }); }, diff --git a/test-track/frontend/src/business/utils/sdk-utils.js b/test-track/frontend/src/business/utils/sdk-utils.js index 3123391c7b..2a17230c18 100644 --- a/test-track/frontend/src/business/utils/sdk-utils.js +++ b/test-track/frontend/src/business/utils/sdk-utils.js @@ -1,5 +1,5 @@ export {operationConfirm, removeGoBackListener, handleCtrlSEvent, byteToSize, resizeTextarea, - getTypeByFileName, strMapToObj, getUUID, windowPrint} from "metersphere-frontend/src/utils"; + getTypeByFileName, strMapToObj, getUUID, windowPrint, parseTag} from "metersphere-frontend/src/utils"; export {parseCustomFilesForList, getCustomFieldFilter, buildBatchParam} from "metersphere-frontend/src/utils/tableUtils"; export {sortCustomFields, parseCustomField, buildCustomFields} from "metersphere-frontend/src/utils/custom_field"; export {getCurrentProjectID, getCurrentWorkspaceId, getCurrentUser, setCurrentProjectID} from "metersphere-frontend/src/utils/token"; diff --git a/workstation/frontend/src/business/component/IssueTableList.vue b/workstation/frontend/src/business/component/IssueTableList.vue index 88099e83e8..e53cb82628 100644 --- a/workstation/frontend/src/business/component/IssueTableList.vue +++ b/workstation/frontend/src/business/component/IssueTableList.vue @@ -250,6 +250,9 @@ export default { }, workspaceId() { return getCurrentWorkspaceId(); + }, + isToDo() { + return !this.isFocus && !this.isCreation; } }, created() { @@ -262,8 +265,8 @@ export default { getIssuePartTemplateWithProject((template) => { this.initFields(template); this.page.result.loading = false; + this.getIssues(); }); - this.getIssues(); }); }, methods: { @@ -300,6 +303,9 @@ export default { item.filters = this.columns[item.id].filters; } } + if (this.isToDo && item.id === '状态') { + item.filters = item.filters.filter(i => i.value !== 'closed') + } }); this.fields = fields; @@ -350,17 +356,7 @@ export default { } } else { - if (this.page.condition.filters) { - this.page.condition.filters.status = ["new"]; - } else { - this.page.condition.filters = {status: ["new"]}; - } - this.page.condition.combine = { - creator: { - operator: "current user", - value: "current user", - } - } + this.addDefaultStatusFilter(); } this.page.condition.workspaceId = getCurrentWorkspaceId(); this.page.condition.orders = getLastTableSortField(this.tableHeaderKey); @@ -382,6 +378,34 @@ export default { }); } }, + addDefaultStatusFilter() { + this.page.condition.combine = { + creator: { + operator: "current user", + value: "current user", + } + } + if (this.isToDo) { + let statusFieldId = null; + this.issueTemplate.customFields.forEach(field => { + if (field.name === '状态') { + statusFieldId = field.id; + } + }); + if (statusFieldId) { + this.page.condition.combine.customs = [ + { + id: statusFieldId, + operator: 'not in', + value:[ + 'closed' + ], + type: 'select' + } + ]; + } + } + }, initCustomFieldValue() { if (this.fields.length <= 0) { return;