2020-10-06 18:08:49 +00:00
|
|
|
<script>
|
|
|
|
import { GlButton, GlTooltipDirective } from '@gitlab/ui';
|
2021-02-14 18:09:20 +00:00
|
|
|
import { mapState } from 'vuex';
|
2020-10-06 18:08:49 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'RemoveMemberButton',
|
|
|
|
components: { GlButton },
|
|
|
|
directives: {
|
|
|
|
GlTooltip: GlTooltipDirective,
|
|
|
|
},
|
2021-04-13 21:11:25 +00:00
|
|
|
inject: ['namespace'],
|
2020-10-06 18:08:49 +00:00
|
|
|
props: {
|
|
|
|
memberId: {
|
|
|
|
type: Number,
|
|
|
|
required: true,
|
|
|
|
},
|
2021-03-23 12:09:33 +00:00
|
|
|
memberType: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: null,
|
|
|
|
},
|
2020-10-06 18:08:49 +00:00
|
|
|
message: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
icon: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: 'remove',
|
|
|
|
},
|
|
|
|
isAccessRequest: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: false,
|
|
|
|
},
|
2021-04-05 18:09:15 +00:00
|
|
|
isInvite: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: false,
|
|
|
|
},
|
2021-04-15 09:09:03 +00:00
|
|
|
oncallSchedules: {
|
|
|
|
type: Object,
|
|
|
|
required: false,
|
|
|
|
default: () => {},
|
|
|
|
},
|
2020-10-06 18:08:49 +00:00
|
|
|
},
|
|
|
|
computed: {
|
2021-04-13 21:11:25 +00:00
|
|
|
...mapState({
|
|
|
|
memberPath(state) {
|
|
|
|
return state[this.namespace].memberPath;
|
|
|
|
},
|
|
|
|
}),
|
2020-10-06 18:08:49 +00:00
|
|
|
computedMemberPath() {
|
|
|
|
return this.memberPath.replace(':id', this.memberId);
|
|
|
|
},
|
2021-04-15 09:09:03 +00:00
|
|
|
stringifiedSchedules() {
|
|
|
|
return JSON.stringify(this.oncallSchedules);
|
|
|
|
},
|
2020-10-06 18:08:49 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<gl-button
|
|
|
|
v-gl-tooltip.hover
|
|
|
|
class="js-remove-member-button"
|
|
|
|
variant="danger"
|
|
|
|
:title="title"
|
|
|
|
:aria-label="title"
|
|
|
|
:icon="icon"
|
|
|
|
:data-member-path="computedMemberPath"
|
2021-03-23 12:09:33 +00:00
|
|
|
:data-member-type="memberType"
|
2020-10-06 18:08:49 +00:00
|
|
|
:data-is-access-request="isAccessRequest"
|
2021-04-05 18:09:15 +00:00
|
|
|
:data-is-invite="isInvite"
|
2020-10-06 18:08:49 +00:00
|
|
|
:data-message="message"
|
2021-04-15 09:09:03 +00:00
|
|
|
:data-oncall-schedules="stringifiedSchedules"
|
2020-10-06 18:08:49 +00:00
|
|
|
data-qa-selector="delete_member_button"
|
|
|
|
/>
|
|
|
|
</template>
|