测试跟踪-只读用户

This commit is contained in:
chenjianxing 2020-05-22 19:56:09 +08:00
parent 21d7beb82f
commit f9ff75fe36
10 changed files with 21 additions and 34 deletions

View File

@ -54,7 +54,6 @@ public class ProjectController {
}
@PostMapping("/list/{goPage}/{pageSize}")
@RequiresRoles(RoleConstants.TEST_MANAGER)
public Pager<List<ProjectDTO>> getProjectList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ProjectRequest request) {
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);

View File

@ -27,7 +27,7 @@ public class UserRoleController {
}
@GetMapping("/list/ws/{workspaceId}/{userId}")
@RequiresRoles(value = {RoleConstants.ADMIN, RoleConstants.ORG_ADMIN}, logical = Logical.OR)
@RequiresRoles(value = {RoleConstants.ADMIN, RoleConstants.ORG_ADMIN, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
public List<Role> getWorkspaceMemberRoles(@PathVariable String workspaceId, @PathVariable String userId) {
return userRoleService.getWorkspaceMemberRoles(workspaceId, userId);
}

View File

@ -1,5 +1,5 @@
<template>
<el-button @click="exec()" plain :type="type" :icon="icon" :size="size">
<el-button v-permission="['test_manager', 'test_user']" @click="exec()" plain :type="type" :icon="icon" :size="size">
{{content}}
</el-button>
</template>

View File

@ -1,5 +1,6 @@
<template>
<ms-tip-button @click="exec"
<ms-tip-button v-permission="['test_manager', 'test_user']"
@click="exec"
@clickStop="clickStop"
:type="type"
:tip="tip"

View File

@ -23,7 +23,7 @@
</el-menu-item>
</el-submenu>
<el-submenu index="3" v-permission="['test_manager','test_user','test_viewer']" v-if="isCurrentWorkspaceUser">
<el-submenu index="3" v-permission="['test_manager']" v-if="isCurrentWorkspaceUser">
<template v-slot:title>
<font-awesome-icon class="icon workspace" :icon="['far', 'list-alt']" size="lg"/>
<span>{{$t('commons.workspace')}}</span>

View File

@ -14,7 +14,7 @@
@refresh="refresh"
:tree-nodes="treeNodes"
:type="'edit'"
:draggable="true"
:draggable="nodeTreeDraggable"
:select-node.sync="selectNode"
@refreshTable="refreshTable"
:current-project="currentProject"
@ -54,13 +54,14 @@
import NodeTree from '../common/NodeTree';
import TestCaseEdit from './components/TestCaseEdit';
import {CURRENT_PROJECT} from '../../../../common/js/constants';
import {CURRENT_PROJECT, ROLE_TEST_MANAGER, ROLE_TEST_USER} from '../../../../common/js/constants';
import TestCaseList from "./components/TestCaseList";
import SelectMenu from "../common/SelectMenu";
import TestCaseMove from "./components/TestCaseMove";
import MsContainer from "../../common/components/MsContainer";
import MsAsideContainer from "../../common/components/MsAsideContainer";
import MsMainContainer from "../../common/components/MsMainContainer";
import {hasRoles} from "../../../../common/js/utils";
export default {
name: "TestCase",
@ -81,6 +82,7 @@
selectParentNodes: [],
testCaseReadOnly: true,
selectNode: {},
nodeTreeDraggable: true,
}
},
mounted() {
@ -213,6 +215,9 @@
this.refresh();
},
getNodeTree() {
if (!hasRoles(ROLE_TEST_USER, ROLE_TEST_MANAGER)) {
this.nodeTreeDraggable = false;
}
if (this.currentProject) {
this.result = this.$get("/case/node/list/" + this.currentProject.id, response => {
this.treeNodes = response.data;

View File

@ -17,7 +17,6 @@
action=""
:on-exceed="handleExceed"
:beforeUpload="UploadValidate"
:on-success="handleSuccess"
:on-error="handleError"
:show-file-list="false"
:http-request="upload"
@ -82,18 +81,6 @@
this.errList = [];
return true;
},
handleSuccess(response) {
// let res = response.data;
// if (res.success) {
// this.$success(this.$t('test_track.case.import.success'));
// this.dialogVisible = false;
// this.$emit("refresh");
// } else {
// this.errList = res.errList;
// }
// this.fileList = [];
},
handleError(err, file, fileList) {
this.isLoading = false;
this.$error(err.message);
@ -106,8 +93,6 @@
this.dialogVisible = true;
},
downloadTemplate() {
// this.$get('/test/case/export/template');
// fileDownload('/test/case/export/template', {});
this.$fileDownload('/test/case/export/template');
},
upload(file) {

View File

@ -2,7 +2,7 @@
<div v-loading="result.loading">
<el-input :placeholder="$t('test_track.module.search')" v-model="filterText" size="small">
<template v-if="type == 'edit'" v-slot:append>
<el-button icon="el-icon-folder-add" @click="openEditNodeDialog('add')"></el-button>
<el-button v-permission="['test_manager', 'test_user']" icon="el-icon-folder-add" @click="openEditNodeDialog('add')"></el-button>
</template>
</el-input>
@ -24,7 +24,7 @@
<span class="node-title">{{node.label}}</span>
<span v-if="type == 'edit'" class="node-operate child">
<span v-if="type == 'edit'" class="node-operate child" v-permission="['test_manager', 'test_user']">
<el-tooltip
class="item"
effect="dark"

View File

@ -8,18 +8,16 @@
<el-menu-item :index="'/track/home'">
{{ $t("i18n.home") }}
</el-menu-item>
<el-submenu v-if="isCurrentWorkspaceUser"
index="3" popper-class="submenu" v-permission="['test_manager']" >
<el-submenu v-if="isCurrentWorkspaceUser" index="3" popper-class="submenu">
<template v-slot:title>{{$t('commons.project')}}</template>
<ms-recent-list :options="projectRecent"/>
<el-divider/>
<ms-show-all :index="'/track/project/all'"/>
<ms-create-button :index="'/track/project/create'" :title="$t('project.create')"/>
<ms-create-button v-permission="['test_manager', 'test_user']" :index="'/track/project/create'" :title="$t('project.create')"/>
</el-submenu>
<el-submenu v-if="isCurrentWorkspaceUser"
index="6" popper-class="submenu" v-permission="['test_manager', 'test_user']">
index="6" popper-class="submenu">
<template v-slot:title>{{$t('test_track.case.test_case')}}</template>
<ms-recent-list :options="caseRecent"/>
<el-divider/>
@ -27,14 +25,13 @@
<el-menu-item :index="testCaseEditPath" class="blank_item"></el-menu-item>
</el-submenu>
<el-submenu v-if="isCurrentWorkspaceUser"
index="7" popper-class="submenu" v-permission="['test_manager', 'test_user', 'test_viewer']">
<el-submenu v-if="isCurrentWorkspaceUser" index="7" popper-class="submenu">
<template v-slot:title>{{$t('test_track.plan.test_plan')}}</template>
<ms-recent-list :options="planRecent"/>
<el-divider/>
<ms-show-all :index="'/track/plan/all'"/>
<el-menu-item :index="testPlanViewPath" class="blank_item"></el-menu-item>
<ms-create-button :index="'/track/plan/create'" :title="$t('test_track.plan.create_plan')"/>
<ms-create-button v-permission="['test_manager', 'test_user']" :index="'/track/plan/create'" :title="$t('test_track.plan.create_plan')"/>
</el-submenu>
</el-menu>
</el-col>

View File

@ -19,8 +19,8 @@
</div>
</el-col>
<el-col :span="12" class="head-right">
<el-button plain size="mini" @click="handleSave">{{$t('commons.save')}}</el-button>
<el-button plain size="mini" @click="handleEdit">{{$t('test_track.plan_view.edit_component')}}</el-button>
<el-button v-permission="['test_manager', 'test_user']" plain size="mini" @click="handleSave">{{$t('commons.save')}}</el-button>
<el-button v-permission="['test_manager', 'test_user']" plain size="mini" @click="handleEdit">{{$t('test_track.plan_view.edit_component')}}</el-button>
</el-col>
</el-row>