debian-mirror-gitlab/app/assets/javascripts/members/components/table/member_actions.vue

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.6 KiB
Vue
Raw Normal View History

2021-01-03 14:25:43 +05:30
<script>
2022-08-27 11:52:29 +05:30
import { MEMBER_TYPES, EE_ACTION_BUTTONS } from 'ee_else_ce/members/constants';
2021-03-11 19:13:27 +05:30
import AccessRequestActionButtons from '../action_buttons/access_request_action_buttons.vue';
2021-01-03 14:25:43 +05:30
import GroupActionButtons from '../action_buttons/group_action_buttons.vue';
import InviteActionButtons from '../action_buttons/invite_action_buttons.vue';
2023-03-17 16:20:25 +05:30
import UserActionDropdown from '../action_dropdowns/user_action_dropdown.vue';
2021-01-03 14:25:43 +05:30
export default {
2023-04-23 21:23:45 +05:30
name: 'MemberActions',
2021-01-03 14:25:43 +05:30
components: {
2023-03-17 16:20:25 +05:30
UserActionDropdown,
2021-01-03 14:25:43 +05:30
GroupActionButtons,
InviteActionButtons,
AccessRequestActionButtons,
2022-08-27 11:52:29 +05:30
BannedActionButtons: () =>
import('ee_component/members/components/action_buttons/banned_action_buttons.vue'),
2021-01-03 14:25:43 +05:30
},
props: {
member: {
type: Object,
required: true,
},
memberType: {
type: String,
required: true,
},
permissions: {
type: Object,
required: true,
},
isCurrentUser: {
type: Boolean,
required: true,
},
},
computed: {
actionButtonComponent() {
const dictionary = {
2023-03-17 16:20:25 +05:30
[MEMBER_TYPES.user]: 'user-action-dropdown',
2021-01-03 14:25:43 +05:30
[MEMBER_TYPES.group]: 'group-action-buttons',
[MEMBER_TYPES.invite]: 'invite-action-buttons',
[MEMBER_TYPES.accessRequest]: 'access-request-action-buttons',
2022-08-27 11:52:29 +05:30
...EE_ACTION_BUTTONS,
2021-01-03 14:25:43 +05:30
};
return dictionary[this.memberType];
},
},
};
</script>
<template>
<component
:is="actionButtonComponent"
v-if="actionButtonComponent"
:member="member"
:permissions="permissions"
:is-current-user="isCurrentUser"
/>
</template>