Merge remote-tracking branch 'origin/v1.0' into v1.0

This commit is contained in:
Captain.B 2020-06-17 09:58:51 +08:00
commit 1e4db9b55f
9 changed files with 39 additions and 18 deletions

View File

@ -27,4 +27,5 @@ public interface ExtUserRoleMapper {
List<User> getBesideOrgMemberList(@Param("orgId") String orgId);
List<User> getTestManagerAndTestUserList(@Param("request") QueryMemberRequest request);
}

View File

@ -89,7 +89,12 @@
join role r on r.id = ur.role_id
where w.id = #{workspaceId} and ur.user_id = #{userId}
</select>
<select id="getTestManagerAndTestUserList" resultType="io.metersphere.base.domain.User">
SELECT distinct `user`.* FROM user_role INNER JOIN `user` ON user_role.user_id = `user`.id
WHERE user_role.source_id = #{request.workspaceId} And user_role.role_id in ('test_manager', 'test_user')
<if test="request.name != null">
AND `user`.name like CONCAT('%', #{request.name},'%')
</if>
order by user_role.update_time desc
</select>
</mapper>

View File

@ -274,4 +274,14 @@ public class UserController {
return userService.updateUserPassword(request);
}
/**
* 获取工作空间成员用户 不分页
*/
@PostMapping("/ws/member/tester/list")
@RequiresRoles(value = {RoleConstants.ORG_ADMIN, RoleConstants.TEST_MANAGER,
RoleConstants.TEST_USER, RoleConstants.TEST_VIEWER}, logical = Logical.OR)
public List<User> getTestManagerAndTestUserList(@RequestBody QueryMemberRequest request) {
return userService.getTestManagerAndTestUserList(request);
}
}

View File

@ -457,4 +457,7 @@ public class UserService {
return extUserMapper.getDefaultLanguage(key);
}
public List<User> getTestManagerAndTestUserList(QueryMemberRequest request) {
return extUserRoleMapper.getTestManagerAndTestUserList(request);
}
}

View File

@ -409,7 +409,7 @@
},
getMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/list/all', {workspaceId:workspaceId}, response => {
this.$post('/user/ws/member/tester/list', {workspaceId:workspaceId}, response => {
this.maintainerOptions = response.data;
});
},

View File

@ -188,7 +188,7 @@
},
setPrincipalOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/list/all', {workspaceId:workspaceId}, response => {
this.$post('/user/ws/member/tester/list', {workspaceId:workspaceId}, response => {
this.principalOptions = response.data;
});
},

View File

@ -30,24 +30,23 @@
show-overflow-tooltip>
<template v-slot:default="scope">
<span @click.stop="clickt = 'stop'">
<el-dropdown v-permission="['test_manager','test_user']" class="test-case-status" @command="statusChange">
<el-dropdown class="test-case-status" @command="statusChange">
<span class="el-dropdown-link">
<plan-status-table-item :value="scope.row.status"/>
</span>
<el-dropdown-menu slot="dropdown" chang>
<el-dropdown-item :command="{id: scope.row.id, status: 'Prepare'}">
<el-dropdown-item :disabled="!isTestManagerOrTestUser" :command="{id: scope.row.id, status: 'Prepare'}">
{{$t('test_track.plan.plan_status_prepare')}}
</el-dropdown-item>
<el-dropdown-item :command="{id: scope.row.id, status: 'Underway'}">
<el-dropdown-item :disabled="!isTestManagerOrTestUser" :command="{id: scope.row.id, status: 'Underway'}">
{{$t('test_track.plan.plan_status_running')}}
</el-dropdown-item>
<el-dropdown-item :command="{id: scope.row.id, status: 'Completed'}">
<el-dropdown-item :disabled="!isTestManagerOrTestUser" :command="{id: scope.row.id, status: 'Completed'}">
{{$t('test_track.plan.plan_status_completed')}}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</span>
<plan-status-table-item v-permission="['test_viewer']" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column
@ -115,7 +114,7 @@
import MsTableOperator from "../../../common/components/MsTableOperator";
import PlanStatusTableItem from "../../common/tableItems/plan/PlanStatusTableItem";
import PlanStageTableItem from "../../common/tableItems/plan/PlanStageTableItem";
import {_filter, _sort} from "../../../../../common/js/utils";
import {_filter, _sort, checkoutTestManagerOrTestUser} from "../../../../../common/js/utils";
import TestReportTemplateList from "../view/comonents/TestReportTemplateList";
import TestCaseReportView from "../view/comonents/report/TestCaseReportView";
import MsDeleteConfirm from "../../../common/components/MsDeleteConfirm";
@ -137,6 +136,7 @@
condition: {},
currentPage: 1,
pageSize: 10,
isTestManagerOrTestUser: false,
total: 0,
tableData: [],
statusFilters: [
@ -160,6 +160,7 @@
},
created() {
this.projectId = this.$route.params.projectId;
this.isTestManagerOrTestUser = checkoutTestManagerOrTestUser();
this.initTableData();
},
methods: {

View File

@ -39,7 +39,7 @@
methods: {
setMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/list/all', {workspaceId:workspaceId}, response => {
this.$post('/user/ws/member/tester/list', {workspaceId:workspaceId}, response => {
this.executorOptions = response.data;
});
},

View File

@ -89,27 +89,26 @@
:label="$t('test_track.plan_view.execute_result')">
<template v-slot:default="scope">
<span @click.stop="clickt = 'stop'">
<el-dropdown v-permission="['test_manager','test_user']" class="test-case-status" @command="statusChange" >
<el-dropdown class="test-case-status" @command="statusChange" >
<span class="el-dropdown-link">
<status-table-item :value="scope.row.status"/>
</span>
<el-dropdown-menu slot="dropdown" chang>
<el-dropdown-item :command="{id: scope.row.id, status: 'Pass'}">
<el-dropdown-item :disabled="!isTestManagerOrTestUser" :command="{id: scope.row.id, status: 'Pass'}">
{{$t('test_track.plan_view.pass')}}
</el-dropdown-item>
<el-dropdown-item :command="{id: scope.row.id, status: 'Failure'}">
<el-dropdown-item :disabled="!isTestManagerOrTestUser" :command="{id: scope.row.id, status: 'Failure'}">
{{$t('test_track.plan_view.failure')}}
</el-dropdown-item>
<el-dropdown-item :command="{id: scope.row.id, status: 'Blocking'}">
<el-dropdown-item :disabled="!isTestManagerOrTestUser" :command="{id: scope.row.id, status: 'Blocking'}">
{{$t('test_track.plan_view.blocking')}}
</el-dropdown-item>
<el-dropdown-item :command="{id: scope.row.id, status: 'Skip'}">
<el-dropdown-item :disabled="!isTestManagerOrTestUser" :command="{id: scope.row.id, status: 'Skip'}">
{{$t('test_track.plan_view.skip')}}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</span>
<status-table-item v-permission="['test_viewer']" :value="scope.row.status"/>
</template>
</el-table-column>
@ -199,6 +198,7 @@
selectIds: new Set(),
testPlan: {},
isReadOnly: false,
isTestManagerOrTestUser: false,
priorityFilters: [
{text: 'P0', value: 'P0'},
{text: 'P1', value: 'P1'},
@ -244,6 +244,7 @@
},
mounted() {
this.refreshTableAndPlan();
this.isTestManagerOrTestUser = checkoutTestManagerOrTestUser();
},
methods: {
initTableData() {