diff --git a/backend/src/main/java/io/metersphere/controller/ProjectController.java b/backend/src/main/java/io/metersphere/controller/ProjectController.java index 6079093b9f..fa25f25be4 100644 --- a/backend/src/main/java/io/metersphere/controller/ProjectController.java +++ b/backend/src/main/java/io/metersphere/controller/ProjectController.java @@ -23,6 +23,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; @@ -145,4 +146,9 @@ public class ProjectController { public void updateMember(@RequestBody WorkspaceMemberDTO memberDTO) { projectService.updateMember(memberDTO); } + + @GetMapping("/getOwnerProjectIds") + public Collection getOwnerProjectIds() { + return checkPermissionService.getUserRelatedProjectIds(); + } } diff --git a/backend/src/main/java/io/metersphere/service/CheckPermissionService.java b/backend/src/main/java/io/metersphere/service/CheckPermissionService.java index 599be37c4f..68d7b0cb31 100644 --- a/backend/src/main/java/io/metersphere/service/CheckPermissionService.java +++ b/backend/src/main/java/io/metersphere/service/CheckPermissionService.java @@ -39,7 +39,7 @@ public class CheckPermissionService { } } - private Set getUserRelatedProjectIds() { + public Set getUserRelatedProjectIds() { List groupIds = Objects.requireNonNull(SessionUtils.getUser()).getGroups() .stream() .filter(g -> StringUtils.equals(g.getType(), UserGroupType.PROJECT)) diff --git a/frontend/src/business/components/api/automation/report/ApiReportDetail.vue b/frontend/src/business/components/api/automation/report/ApiReportDetail.vue index ec80eb4a03..43d6152799 100644 --- a/frontend/src/business/components/api/automation/report/ApiReportDetail.vue +++ b/frontend/src/business/components/api/automation/report/ApiReportDetail.vue @@ -126,7 +126,7 @@ export default { //运行场景中如果连续将1个场景引入多次,会出现运行结果合并的情况。 //为了解决这种问题,在转hashTree的时候给场景放了个新ID,前台加载解析的时候也要做处理 let scenarioId = ""; - if (item.scenario !== null) { + if (item.scenario) { let scenarioArr = JSON.parse(item.scenario); if (scenarioArr.length > 1) { let scenarioIdArr = scenarioArr[0].split("_"); @@ -160,7 +160,7 @@ export default { if (i === nodeArray.length - 2) { idIsPath = false; let childId = ""; - if (children[j].value != null && children[j].value.scenario !== null) { + if (children[j].value && children[j].value.scenario) { let scenarioArr = JSON.parse(children[j].value.scenario); if (scenarioArr.length > 1) { let childArr = scenarioArr[0].split("_"); diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index 05f5d1d526..49d5cfee18 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -136,6 +136,7 @@ @@ -317,6 +318,7 @@ export default { data() { return { enableContinues: false, + showConfigButtonWithOutPermission:false, props: { label: "label", children: "hashTree" diff --git a/frontend/src/business/components/api/automation/scenario/EnvPopover.vue b/frontend/src/business/components/api/automation/scenario/EnvPopover.vue index ad77d9f763..704bca75b7 100644 --- a/frontend/src/business/components/api/automation/scenario/EnvPopover.vue +++ b/frontend/src/business/components/api/automation/scenario/EnvPopover.vue @@ -7,6 +7,7 @@ @show="showPopover" trigger="click"> {{ $t('api_test.definition.request.run_env') }} @@ -25,6 +26,12 @@ export default { envMap: Map, projectIds: Set, projectList: Array, + showConfigButtonWithOutPermission:{ + type: Boolean, + default() { + return true; + } + }, isReadOnly: { type: Boolean, default() { diff --git a/frontend/src/business/components/api/automation/scenario/EnvSelect.vue b/frontend/src/business/components/api/automation/scenario/EnvSelect.vue index 3216af147d..b3ea7098a4 100644 --- a/frontend/src/business/components/api/automation/scenario/EnvSelect.vue +++ b/frontend/src/business/components/api/automation/scenario/EnvSelect.vue @@ -5,12 +5,12 @@ - {{ $t('api_test.environment.environment_config') }}