diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtWorkspaceMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtWorkspaceMapper.java index 50d993bc1f..8f60844e2b 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtWorkspaceMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtWorkspaceMapper.java @@ -9,8 +9,11 @@ import java.util.List; public interface ExtWorkspaceMapper { List getWorkspaceWithOrg(@Param("request") WorkspaceRequest request); + List getWorkspaceIdsByOrgId(@Param("orgId") String orgId); + List getWorkspaceIdsOrgId(@Param("orgId") String orgId); + String getOrganizationIdById(String resourceID); List findIdAndNameByOrganizationId(@Param("organizationId") String organizationId); diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtWorkspaceMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtWorkspaceMapper.xml index 1932780950..e184cac3dd 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtWorkspaceMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtWorkspaceMapper.xml @@ -10,11 +10,17 @@ AND w.name LIKE #{request.name,jdbcType=VARCHAR} - order by w.update_time desc + order by w.update_time desc + diff --git a/backend/src/main/java/io/metersphere/controller/WorkspaceController.java b/backend/src/main/java/io/metersphere/controller/WorkspaceController.java index 90626a38c5..de3cc147cf 100644 --- a/backend/src/main/java/io/metersphere/controller/WorkspaceController.java +++ b/backend/src/main/java/io/metersphere/controller/WorkspaceController.java @@ -100,6 +100,11 @@ public class WorkspaceController { return workspaceService.getWorkspaceListByOrgIdAndUserId(currentOrganizationId); } + @GetMapping("/list/orgworkspace/{orgId}") + public List getWorkspaceListByOrgId(@PathVariable String orgId) { + return workspaceService.getWorkspaceIdsByOrgId(orgId); + } + @PostMapping("/member/update") @MsAuditLog(module = "workspace_member", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#memberDTO)", content = "#msClass.getLogDetails(#memberDTO)", msClass = WorkspaceService.class) public void updateOrgMember(@RequestBody WorkspaceMemberDTO memberDTO) { diff --git a/backend/src/main/java/io/metersphere/service/WorkspaceService.java b/backend/src/main/java/io/metersphere/service/WorkspaceService.java index 8f64804efc..d6317c3847 100644 --- a/backend/src/main/java/io/metersphere/service/WorkspaceService.java +++ b/backend/src/main/java/io/metersphere/service/WorkspaceService.java @@ -221,6 +221,10 @@ public class WorkspaceService { return extWorkspaceMapper.getWorkspaceIdsByOrgId(orgId); } + public List getWorkspaceIdsByOrgId(String orgId) { + return extWorkspaceMapper.getWorkspaceIdsOrgId(orgId); + } + public void updateWorkspaceMember(WorkspaceMemberDTO memberDTO) { String workspaceId = memberDTO.getWorkspaceId(); String userId = memberDTO.getId(); diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java index 86449f343f..0b2eb9cb64 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java @@ -1,17 +1,18 @@ package io.metersphere.track.controller; +import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.base.domain.Project; import io.metersphere.base.domain.TestPlan; import io.metersphere.commons.constants.OperLogConstants; import io.metersphere.commons.constants.PermissionConstants; -import io.metersphere.commons.constants.RoleConstants; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.commons.utils.SessionUtils; import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.service.CheckPermissionService; +import io.metersphere.track.dto.ApiRunConfigDTO; import io.metersphere.track.dto.TestCaseReportMetricDTO; import io.metersphere.track.dto.TestPlanDTO; import io.metersphere.track.dto.TestPlanDTOWithMetric; @@ -22,9 +23,7 @@ import io.metersphere.track.request.testplan.TestplanRunRequest; import io.metersphere.track.request.testplancase.TestCaseRelevanceRequest; import io.metersphere.track.service.TestPlanProjectService; import io.metersphere.track.service.TestPlanService; -import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.apache.shiro.authz.annotation.RequiresRoles; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -156,7 +155,11 @@ public class TestPlanController { return PageUtils.setPageInfo(page, testPlanProjectService.getProjectByPlanId(request)); } @PostMapping("/testplan/jenkins") - public void runJenkins(@RequestBody TestplanRunRequest testplanRunRequest){ - testPlanService.run(testplanRunRequest.getTestPlanID(),testplanRunRequest.getProjectID(),testplanRunRequest.getUserId(),testplanRunRequest.getTriggerMode(),null); + public void runJenkins(@RequestBody TestplanRunRequest testplanRunRequest) { + ApiRunConfigDTO api = new ApiRunConfigDTO(); + api.setMode(testplanRunRequest.getMode()); + api.setResourcePoolId(testplanRunRequest.getResourcePoolId()); + String apiRunConfig = JSONObject.toJSONString(api); + testPlanService.run(testplanRunRequest.getTestPlanID(), testplanRunRequest.getProjectID(), testplanRunRequest.getUserId(), testplanRunRequest.getTriggerMode(), apiRunConfig); } } diff --git a/backend/src/main/java/io/metersphere/track/dto/ApiRunConfigDTO.java b/backend/src/main/java/io/metersphere/track/dto/ApiRunConfigDTO.java new file mode 100644 index 0000000000..71881187fb --- /dev/null +++ b/backend/src/main/java/io/metersphere/track/dto/ApiRunConfigDTO.java @@ -0,0 +1,12 @@ +package io.metersphere.track.dto; + +import lombok.Data; + +@Data +public class ApiRunConfigDTO { + private String mode; + private String reportType; + private String onSampleError; + private String runWithinResourcePool; + private String resourcePoolId; +} diff --git a/backend/src/main/java/io/metersphere/track/request/testplan/TestplanRunRequest.java b/backend/src/main/java/io/metersphere/track/request/testplan/TestplanRunRequest.java index 016c73e65f..1ee6f31dda 100644 --- a/backend/src/main/java/io/metersphere/track/request/testplan/TestplanRunRequest.java +++ b/backend/src/main/java/io/metersphere/track/request/testplan/TestplanRunRequest.java @@ -11,5 +11,10 @@ public class TestplanRunRequest { private String projectID; private String userId; private String triggerMode; + private String mode; + private String reportType; + private String onSampleError; + private String runWithinResourcePool; + private String resourcePoolId; } diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java index 0a188bbf37..4b84a32981 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -1004,7 +1004,12 @@ public class TestPlanService { Map apiTestCaseIdMap; Map performanceIdMap; if (StringUtils.isEmpty(apiRunConfig)) { - apiRunConfig = "{\"mode\":\"parallel\",\"reportType\":\"iddReport\",\"onSampleError\":true,\"runWithinResourcePool\":true,\"resourcePoolId\":\"29773f4f-55e4-4bce-ad3d-b531b4eb59c2\"}"; + apiRunConfig = + "{\"mode\":\"parallel\"," + + "\"reportType\":\"iddReport\"," + + "\"onSampleError\":true," + + "\"runWithinResourcePool\":true," + + "\"resourcePoolId\":\"29773f4f-55e4-4bce-ad3d-b531b4eb59c2\"}"; } planScenarioIdMap = new LinkedHashMap<>(); apiTestCaseIdMap = new LinkedHashMap<>(); diff --git a/frontend/src/business/components/common/components/table/MsTableHeaderSelectPopover.vue b/frontend/src/business/components/common/components/table/MsTableHeaderSelectPopover.vue index fcfca06105..c8ef7ad027 100644 --- a/frontend/src/business/components/common/components/table/MsTableHeaderSelectPopover.vue +++ b/frontend/src/business/components/common/components/table/MsTableHeaderSelectPopover.vue @@ -80,7 +80,7 @@ this.selectPageFontColor.color = "gray"; } else { - this.selectAllSimpleStyle.color = "gray"; + this.selectAllFontColor.color = "gray"; this.selectPageFontColor.color = "gray"; } this.$emit(even);