From a923a5b55e59442d6d84bdfc0f8e5424c674c99a Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 25 Dec 2020 11:17:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B2=A1=E9=80=89=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ProjectController.java | 17 ++++++----- backend/src/main/java/io/metersphere/xpack | 2 +- .../api/automation/ApiAutomation.vue | 5 ++++ .../automation/scenario/ApiScenarioList.vue | 28 ++++++++++--------- .../automation/scenario/ApiScenarioModule.vue | 4 +++ .../scenario/testplan/TestPlanList.vue | 5 ++++ .../api/definition/ApiDefinition.vue | 8 ++++++ .../components/list/ApiCaseSimpleList.vue | 10 ++++--- .../definition/components/list/ApiList.vue | 10 ++++--- .../components/module/ApiModuleHeader.vue | 13 +++++++++ .../report/PerformanceTestReport.vue | 5 +++- .../performance/test/PerformanceTestList.vue | 18 ++++++++---- .../components/track/case/TestCase.vue | 6 +++- .../track/case/components/TestCaseList.vue | 8 ++++++ .../home/components/RelatedTestPlanList.vue | 6 +++- .../track/home/components/ReviewList.vue | 4 +++ .../home/components/TestCaseSideList.vue | 4 +++ .../components/track/plan/TestPlan.vue | 5 ++++ .../track/plan/components/TestPlanList.vue | 8 ++++++ .../track/review/TestCaseReview.vue | 5 ++++ .../review/components/TestCaseReviewList.vue | 15 +++++++++- frontend/src/business/components/xpack | 2 +- frontend/src/i18n/zh-CN.js | 1 + 23 files changed, 149 insertions(+), 40 deletions(-) diff --git a/backend/src/main/java/io/metersphere/controller/ProjectController.java b/backend/src/main/java/io/metersphere/controller/ProjectController.java index edf0d20024..42df9e91b6 100644 --- a/backend/src/main/java/io/metersphere/controller/ProjectController.java +++ b/backend/src/main/java/io/metersphere/controller/ProjectController.java @@ -16,6 +16,7 @@ import org.apache.shiro.authz.annotation.RequiresRoles; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; @RestController @@ -28,18 +29,20 @@ public class ProjectController { @GetMapping("/listAll") public List listAll() { - String currentWorkspaceId = SessionUtils.getCurrentWorkspaceId(); - ProjectRequest request = new ProjectRequest(); - request.setWorkspaceId(currentWorkspaceId); - return projectService.getProjectList(request); +// String currentWorkspaceId = SessionUtils.getCurrentWorkspaceId(); +// ProjectRequest request = new ProjectRequest(); +// request.setWorkspaceId(currentWorkspaceId); +// return projectService.getProjectList(request); + return new ArrayList<>(); } /*jenkins项目列表*/ @GetMapping("/listAll/{workspaceId}") public List jlistAll(@PathVariable String workspaceId) { - ProjectRequest request = new ProjectRequest(); - request.setWorkspaceId(workspaceId); - return projectService.getProjectList(request); +// ProjectRequest request = new ProjectRequest(); +// request.setWorkspaceId(workspaceId); +// return projectService.getProjectList(request); + return new ArrayList<>(); } @GetMapping("/recent/{count}") diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index 79343a2763..9f4a9bbf46 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit 79343a2763b014355f91fc21b2356a95ae437973 +Subproject commit 9f4a9bbf46fc1333dbcccea21f83e27e3ec10b1f diff --git a/frontend/src/business/components/api/automation/ApiAutomation.vue b/frontend/src/business/components/api/automation/ApiAutomation.vue index f294010f61..0f34f0d18c 100644 --- a/frontend/src/business/components/api/automation/ApiAutomation.vue +++ b/frontend/src/business/components/api/automation/ApiAutomation.vue @@ -51,6 +51,7 @@ import {getUUID} from "@/common/js/utils"; import MsApiScenarioModule from "@/business/components/api/automation/scenario/ApiScenarioModule"; import MsEditApiScenario from "./scenario/EditApiScenario"; + import {getCurrentProjectID} from "../../../../common/js/utils"; export default { name: "ApiAutomation", @@ -70,6 +71,10 @@ watch: {}, methods: { addTab(tab) { + if (!getCurrentProjectID()) { + this.$warning(this.$t('commons.check_project_tip')); + return; + } if (tab.name === 'add') { let label = this.$t('api_test.automation.add_scenario'); let name = getUUID().substring(0, 8); diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue index f8b2f0ca09..4895a301aa 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue @@ -160,10 +160,9 @@ }, methods: { search() { - this.loading = true; + this.condition.filters = ["Prepare", "Underway", "Completed"]; this.condition.moduleIds = this.selectNodeIds; - if (this.trashEnable) { this.condition.filters = ["Trash"]; this.condition.moduleIds = []; @@ -174,17 +173,20 @@ } this.selection = []; let url = "/api/automation/list/" + this.currentPage + "/" + this.pageSize; - this.$post(url, this.condition, response => { - let data = response.data; - this.total = data.itemCount; - this.tableData = data.listObject; - this.tableData.forEach(item => { - if (item.tags && item.tags.length > 0) { - item.tags = JSON.parse(item.tags); - } - }) - this.loading = false; - }); + if (this.condition.projectId) { + this.loading = true; + this.$post(url, this.condition, response => { + let data = response.data; + this.total = data.itemCount; + this.tableData = data.listObject; + this.tableData.forEach(item => { + if (item.tags && item.tags.length > 0) { + item.tags = JSON.parse(item.tags); + } + }); + this.loading = false; + }); + } }, handleCommand(cmd) { let table = this.$refs.scenarioTable; diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue index a4569c516c..becb0bc7aa 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue @@ -182,6 +182,10 @@ this.$emit("refreshTable"); }, addScenario() { + if (!getCurrentProjectID()) { + this.$warning(this.$t('commons.check_project_tip')); + return; + } this.$refs.basisScenario.open(this.currentModule); }, enableTrash() { diff --git a/frontend/src/business/components/api/automation/scenario/testplan/TestPlanList.vue b/frontend/src/business/components/api/automation/scenario/testplan/TestPlanList.vue index 1799650db1..e40e4411e1 100644 --- a/frontend/src/business/components/api/automation/scenario/testplan/TestPlanList.vue +++ b/frontend/src/business/components/api/automation/scenario/testplan/TestPlanList.vue @@ -149,6 +149,7 @@ import MsDeleteConfirm from "../../../../common/components/MsDeleteConfirm"; import {TEST_PLAN_CONFIGS} from "../../../../common/components/search/search-components"; import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEvent"; + import {getCurrentProjectID} from "../../../../../../common/js/utils"; export default { name: "TestPlanList", @@ -217,6 +218,10 @@ if (this.selectNodeIds && this.selectNodeIds.length > 0) { this.condition.nodeIds = this.selectNodeIds; } + if (!getCurrentProjectID()) { + this.$warning(this.$t('commons.check_project_tip')); + return; + } this.result = this.$post(this.buildPagePath(this.queryPath), this.condition, response => { let data = response.data; this.total = data.itemCount; diff --git a/frontend/src/business/components/api/definition/ApiDefinition.vue b/frontend/src/business/components/api/definition/ApiDefinition.vue index 84794df602..da3e1a0522 100644 --- a/frontend/src/business/components/api/definition/ApiDefinition.vue +++ b/frontend/src/business/components/api/definition/ApiDefinition.vue @@ -180,6 +180,10 @@ } }, handleTabAdd(e) { + if (!getCurrentProjectID()) { + this.$warning(this.$t('commons.check_project_tip')); + return; + } let api = { status: "Underway", method: "GET", userId: getCurrentUser().id, url: "", protocol: this.currentProtocol, environmentId: "" @@ -211,6 +215,10 @@ this.refresh(); }, handleTabsEdit(targetName, action, api) { + if (!getCurrentProjectID()) { + this.$warning(this.$t('commons.check_project_tip')); + return; + } if (targetName === undefined || targetName === null) { targetName = this.$t('api_test.definition.request.title'); } diff --git a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue index bd464773cf..f5cda27366 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue @@ -244,10 +244,12 @@ if (this.currentProtocol != null) { this.condition.protocol = this.currentProtocol; } - this.result = this.$post(this.getListUrl() + this.currentPage + "/" + this.pageSize, this.condition, response => { - this.total = response.data.itemCount; - this.tableData = response.data.listObject; - }); + if (this.condition.projectId) { + this.result = this.$post(this.getListUrl() + this.currentPage + "/" + this.pageSize, this.condition, response => { + this.total = response.data.itemCount; + this.tableData = response.data.listObject; + }); + } }, buildCondition(condition) { if (this.isPlanModel) { diff --git a/frontend/src/business/components/api/definition/components/list/ApiList.vue b/frontend/src/business/components/api/definition/components/list/ApiList.vue index d48521877f..9021c64e91 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiList.vue @@ -224,10 +224,12 @@ if (this.currentProtocol != null) { this.condition.protocol = this.currentProtocol; } - this.result = this.$post("/api/definition/list/" + this.currentPage + "/" + this.pageSize, this.condition, response => { - this.total = response.data.itemCount; - this.tableData = response.data.listObject; - }); + if (this.condition.projectId) { + this.result = this.$post("/api/definition/list/" + this.currentPage + "/" + this.pageSize, this.condition, response => { + this.total = response.data.itemCount; + this.tableData = response.data.listObject; + }); + } }, getMaintainerOptions() { let workspaceId = localStorage.getItem(WORKSPACE_ID); diff --git a/frontend/src/business/components/api/definition/components/module/ApiModuleHeader.vue b/frontend/src/business/components/api/definition/components/module/ApiModuleHeader.vue index ae018299fd..c799cefb4c 100644 --- a/frontend/src/business/components/api/definition/components/module/ApiModuleHeader.vue +++ b/frontend/src/business/components/api/definition/components/module/ApiModuleHeader.vue @@ -42,6 +42,7 @@ import {OPTIONS} from "../../model/JsonData"; import MsAddBasisApi from "../basis/AddBasisApi"; import ApiImport from "../import/ApiImport"; import ModuleTrashButton from "./ModuleTrashButton"; +import {getCurrentProjectID} from "../../../../../../common/js/utils"; export default { name: "ApiModuleHeader", @@ -83,14 +84,26 @@ export default { case "add-module": break; case "import": + if (!getCurrentProjectID()) { + this.$warning(this.$t('commons.check_project_tip')); + return; + } this.$refs.apiImport.open(this.currentModule); break; default: + if (!getCurrentProjectID()) { + this.$warning(this.$t('commons.check_project_tip')); + return; + } this.$emit('exportAPI'); break; } }, addApi() { + if (!getCurrentProjectID()) { + this.$warning(this.$t('commons.check_project_tip')); + return; + } this.$refs.basisApi.open(this.currentModule); }, saveAsEdit(data) { diff --git a/frontend/src/business/components/performance/report/PerformanceTestReport.vue b/frontend/src/business/components/performance/report/PerformanceTestReport.vue index 281c85daca..dd6b86af07 100644 --- a/frontend/src/business/components/performance/report/PerformanceTestReport.vue +++ b/frontend/src/business/components/performance/report/PerformanceTestReport.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 {_filter, _sort} from "../../../../common/js/utils"; +import {_filter, _sort, 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"; @@ -163,6 +163,9 @@ export default { if (this.testId !== 'all') { this.condition.testId = this.testId; } + if (!getCurrentProjectID()) { + return; + } this.result = this.$post(this.buildPagePath(this.queryPath), this.condition, response => { let data = response.data; this.total = data.itemCount; diff --git a/frontend/src/business/components/performance/test/PerformanceTestList.vue b/frontend/src/business/components/performance/test/PerformanceTestList.vue index 3dc73cfb2f..f122881d18 100644 --- a/frontend/src/business/components/performance/test/PerformanceTestList.vue +++ b/frontend/src/business/components/performance/test/PerformanceTestList.vue @@ -84,6 +84,7 @@ import {_filter, _sort} from "@/common/js/utils"; import MsTableHeader from "../../common/components/MsTableHeader"; import {TEST_CONFIGS} from "../../common/components/search/search-components"; import {LIST_CHANGE, PerformanceEvent} from "@/business/components/common/head/ListEvent"; +import {getCurrentProjectID} from "../../../../common/js/utils"; export default { components: { @@ -148,12 +149,13 @@ export default { if (this.projectId !== 'all') { this.condition.projectId = this.projectId; } - - this.result = this.$post(this.buildPagePath(this.queryPath), this.condition, response => { - let data = response.data; - this.total = data.itemCount; - this.tableData = data.listObject; - }); + if (this.condition.projectId) { + this.result = this.$post(this.buildPagePath(this.queryPath), this.condition, response => { + let data = response.data; + this.total = data.itemCount; + this.tableData = data.listObject; + }); + } }, search(combine) { this.initTableData(combine); @@ -211,6 +213,10 @@ export default { }) }, create() { + if (!getCurrentProjectID()) { + this.$warning(this.$t('commons.check_project_tip')); + return; + } this.$router.push('/performance/test/create'); } } diff --git a/frontend/src/business/components/track/case/TestCase.vue b/frontend/src/business/components/track/case/TestCase.vue index 4ff0576e9e..f2384ccaa3 100644 --- a/frontend/src/business/components/track/case/TestCase.vue +++ b/frontend/src/business/components/track/case/TestCase.vue @@ -51,7 +51,7 @@ import TestCaseMove from "./components/TestCaseMove"; import MsContainer from "../../common/components/MsContainer"; import MsAsideContainer from "../../common/components/MsAsideContainer"; import MsMainContainer from "../../common/components/MsMainContainer"; -import {checkoutTestManagerOrTestUser, hasRoles} from "../../../../common/js/utils"; +import {checkoutTestManagerOrTestUser, getCurrentProjectID, hasRoles} from "../../../../common/js/utils"; import BatchMove from "./components/BatchMove"; import TestCaseNodeTree from "../common/TestCaseNodeTree"; @@ -94,6 +94,10 @@ export default { this.testCaseReadOnly = true; } let caseId = this.$route.params.caseId; + if (!getCurrentProjectID()) { + this.$warning(this.$t('commons.check_project_tip')); + return; + } this.openRecentTestCaseEditDialog(caseId); this.$router.push('/track/case/all'); } diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index c55742624d..a271d230e1 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -404,9 +404,17 @@ export default { } }, importTestCase() { + if (!getCurrentProjectID()) { + this.$warning(this.$t('commons.check_project_tip')); + return; + } this.$refs.testCaseImport.open(); }, exportTestCase() { + if (!getCurrentProjectID()) { + this.$warning(this.$t('commons.check_project_tip')); + return; + } let ids = Array.from(this.selectRows).map(row => row.id); let config = { url: '/test/case/export/testcase', diff --git a/frontend/src/business/components/track/home/components/RelatedTestPlanList.vue b/frontend/src/business/components/track/home/components/RelatedTestPlanList.vue index 900f57868e..39e0e55d17 100644 --- a/frontend/src/business/components/track/home/components/RelatedTestPlanList.vue +++ b/frontend/src/business/components/track/home/components/RelatedTestPlanList.vue @@ -74,6 +74,7 @@ import PlanStatusTableItem from "../../common/tableItems/plan/PlanStatusTableItem"; import PlanStageTableItem from "../../common/tableItems/plan/PlanStageTableItem"; import MsTableOperator from "../../../common/components/MsTableOperator"; + import {getCurrentProjectID} from "../../../../../common/js/utils"; export default { name: "RelatedTestPlanList", components: {MsTableOperator, PlanStageTableItem, PlanStatusTableItem, HomeBaseComponent}, @@ -88,7 +89,10 @@ }, methods: { initTableData() { - this.result = this.$post('/test/plan/list/all/relate', this.condition, response => { + if (!getCurrentProjectID()) { + return; + } + this.result = this.$post('/test/plan/list/all/relate', {}, response => { this.tableData = response.data; for (let i = 0; i < this.tableData.length; i++) { let path = "/test/plan/project/name/" + this.tableData[i].id; diff --git a/frontend/src/business/components/track/home/components/ReviewList.vue b/frontend/src/business/components/track/home/components/ReviewList.vue index c4256b9ccf..066c1073d0 100644 --- a/frontend/src/business/components/track/home/components/ReviewList.vue +++ b/frontend/src/business/components/track/home/components/ReviewList.vue @@ -69,6 +69,7 @@ import PlanStageTableItem from "../../common/tableItems/plan/PlanStageTableItem" import PlanStatusTableItem from "../../common/tableItems/plan/PlanStatusTableItem"; import HomeBaseComponent from "./HomeBaseComponent"; import MsTableButton from "../../../common/components/MsTableButton"; +import {getCurrentProjectID} from "../../../../../common/js/utils"; export default { name: "ReviewList", @@ -93,6 +94,9 @@ export default { if (!type) { type = 'reviewer' } + if (!getCurrentProjectID()) { + return; + } this.result = this.$get('/test/case/review/list/all/relate/' + type, response => { this.tableData = response.data; for (let i = 0; i < this.tableData.length; i++) { diff --git a/frontend/src/business/components/track/home/components/TestCaseSideList.vue b/frontend/src/business/components/track/home/components/TestCaseSideList.vue index 26f3a97663..4ff16f16f8 100644 --- a/frontend/src/business/components/track/home/components/TestCaseSideList.vue +++ b/frontend/src/business/components/track/home/components/TestCaseSideList.vue @@ -61,6 +61,7 @@ import StatusTableItem from "../../common/tableItems/planview/StatusTableItem"; import TypeTableItem from "../../common/tableItems/planview/TypeTableItem"; import PriorityTableItem from "../../common/tableItems/planview/PriorityTableItem"; + import {getCurrentProjectID} from "../../../../../common/js/utils"; export default { name: "TestCaseSideList", components: {PriorityTableItem, TypeTableItem, StatusTableItem, HomeBaseComponent}, @@ -80,6 +81,9 @@ }, methods: { initTableData() { + if (!getCurrentProjectID()) { + return; + } this.result = this.$post('/test/plan/case/recent/10', {}, response => { this.tableData = response.data; }); diff --git a/frontend/src/business/components/track/plan/TestPlan.vue b/frontend/src/business/components/track/plan/TestPlan.vue index 37c77c7d97..a1594962fd 100644 --- a/frontend/src/business/components/track/plan/TestPlan.vue +++ b/frontend/src/business/components/track/plan/TestPlan.vue @@ -19,6 +19,7 @@ import TestPlanEdit from './components/TestPlanEdit'; import MsContainer from "../../common/components/MsContainer"; import MsMainContainer from "../../common/components/MsMainContainer"; + import {getCurrentProjectID} from "../../../../common/js/utils"; export default { name: "TestPlan", @@ -36,6 +37,10 @@ watch: { '$route'(to, from) { if (to.path.indexOf("/track/plan/create") >= 0){ + if (!getCurrentProjectID()) { + this.$warning(this.$t('commons.check_project_tip')); + return; + } this.openTestPlanEditDialog(); this.$router.push('/track/plan/all'); } diff --git a/frontend/src/business/components/track/plan/components/TestPlanList.vue b/frontend/src/business/components/track/plan/components/TestPlanList.vue index 66763e9b36..fca2538ddc 100644 --- a/frontend/src/business/components/track/plan/components/TestPlanList.vue +++ b/frontend/src/business/components/track/plan/components/TestPlanList.vue @@ -159,6 +159,7 @@ import TestCaseReportView from "../view/comonents/report/TestCaseReportView"; import MsDeleteConfirm from "../../../common/components/MsDeleteConfirm"; import {TEST_PLAN_CONFIGS} from "../../../common/components/search/search-components"; import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEvent"; +import {getCurrentProjectID} from "../../../../../common/js/utils"; export default { name: "TestPlanList", @@ -216,6 +217,9 @@ export default { if (this.selectNodeIds && this.selectNodeIds.length > 0) { this.condition.nodeIds = this.selectNodeIds; } + if (!getCurrentProjectID()) { + return; + } this.result = this.$post(this.buildPagePath(this.queryPath), this.condition, response => { let data = response.data; this.total = data.itemCount; @@ -236,6 +240,10 @@ export default { return path + "/" + this.currentPage + "/" + this.pageSize; }, testPlanCreate() { + if (!getCurrentProjectID()) { + this.$warning(this.$t('commons.check_project_tip')); + return; + } this.$emit('openTestPlanEditDialog'); }, handleEdit(testPlan) { diff --git a/frontend/src/business/components/track/review/TestCaseReview.vue b/frontend/src/business/components/track/review/TestCaseReview.vue index 80f9c5df92..a69630973b 100644 --- a/frontend/src/business/components/track/review/TestCaseReview.vue +++ b/frontend/src/business/components/track/review/TestCaseReview.vue @@ -18,6 +18,7 @@ import TestCaseReviewList from "./components/TestCaseReviewList"; import TestCaseReviewEdit from "./components/TestCaseReviewEdit"; import MsMainContainer from "../../common/components/MsMainContainer"; import MsContainer from "../../common/components/MsContainer"; +import {getCurrentProjectID} from "../../../../common/js/utils"; export default { name: "TestCaseReview", @@ -41,6 +42,10 @@ export default { watch: { '$route'(to) { if (to.path.indexOf("/track/review/create") >= 0){ + if (!getCurrentProjectID()) { + this.$warning(this.$t('commons.check_project_tip')); + return; + } this.openCaseReviewEditDialog(); this.$router.push('/track/review/all'); } diff --git a/frontend/src/business/components/track/review/components/TestCaseReviewList.vue b/frontend/src/business/components/track/review/components/TestCaseReviewList.vue index e3a6da7cf6..8f22d7b012 100644 --- a/frontend/src/business/components/track/review/components/TestCaseReviewList.vue +++ b/frontend/src/business/components/track/review/components/TestCaseReviewList.vue @@ -87,7 +87,13 @@ import MsDialogFooter from "../../../common/components/MsDialogFooter"; import MsTableHeader from "../../../common/components/MsTableHeader"; import MsCreateBox from "../../../settings/CreateBox"; import MsTablePagination from "../../../common/pagination/TablePagination"; -import {_filter, _sort, checkoutTestManagerOrTestUser, getCurrentWorkspaceId} from "../../../../../common/js/utils"; +import { + _filter, + _sort, + checkoutTestManagerOrTestUser, + getCurrentProjectID, + getCurrentWorkspaceId +} from "../../../../../common/js/utils"; import PlanStatusTableItem from "../../common/tableItems/plan/PlanStatusTableItem"; export default { @@ -133,6 +139,9 @@ export default { initTableData() { let lastWorkspaceId = getCurrentWorkspaceId(); this.condition.workspaceId = lastWorkspaceId; + if (!getCurrentProjectID()) { + return; + } this.result = this.$post("/test/case/review/list/" + this.currentPage + "/" + this.pageSize, this.condition, response => { let data = response.data; this.total = data.itemCount; @@ -160,6 +169,10 @@ export default { this.$router.push('/track/review/view/' + row.id); }, testCaseReviewCreate() { + if (!getCurrentProjectID()) { + this.$warning(this.$t('commons.check_project_tip')); + return; + } this.$emit('openCaseReviewEditDialog'); }, handleEdit(caseReview) { diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index 8cda5c873c..010ad7a5f0 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit 8cda5c873cd9985c97adb34efacf507167fa4182 +Subproject commit 010ad7a5f072a5e9d368c756a2473bbd20781433 diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 7ba40156c0..fe8111bed4 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -126,6 +126,7 @@ export default { modifier: '修改人', validate: "校验", batch_add: "批量添加", + check_project_tip: "请先创建或选择项目", date: { select_date: '选择日期', start_date: '开始日期',