debian-mirror-gitlab/app/assets/javascripts/groups/components/item_actions.vue

75 lines
1.6 KiB
Vue
Raw Normal View History

2018-03-17 18:26:18 +05:30
<script>
import tooltip from '~/vue_shared/directives/tooltip';
import icon from '~/vue_shared/components/icon.vue';
import eventHub from '../event_hub';
import { COMMON_STR } from '../constants';
export default {
components: {
icon,
},
directives: {
tooltip,
},
props: {
parentGroup: {
type: Object,
required: false,
default: () => ({}),
},
group: {
type: Object,
required: true,
},
2018-11-20 20:47:30 +05:30
action: {
type: String,
required: false,
default: '',
},
2018-03-17 18:26:18 +05:30
},
computed: {
leaveBtnTitle() {
return COMMON_STR.LEAVE_BTN_TITLE;
},
editBtnTitle() {
return COMMON_STR.EDIT_BTN_TITLE;
},
},
methods: {
onLeaveGroup() {
2018-11-20 20:47:30 +05:30
eventHub.$emit(`${this.action}showLeaveGroupModal`, this.group, this.parentGroup);
2018-03-17 18:26:18 +05:30
},
},
};
</script>
<template>
2019-09-30 21:07:59 +05:30
<div class="controls d-flex justify-content-end">
2018-03-17 18:26:18 +05:30
<a
2019-09-30 21:07:59 +05:30
v-if="group.canLeave"
2018-12-05 23:21:45 +05:30
v-tooltip
2019-09-30 21:07:59 +05:30
:href="group.leavePath"
:title="leaveBtnTitle"
:aria-label="leaveBtnTitle"
2018-03-17 18:26:18 +05:30
data-container="body"
data-placement="bottom"
2020-06-23 00:09:42 +05:30
class="leave-group btn btn-xs no-expand gl-text-gray-700 gl-ml-5"
2019-09-30 21:07:59 +05:30
@click.prevent="onLeaveGroup"
2019-02-15 15:39:39 +05:30
>
2019-12-21 20:55:43 +05:30
<icon name="leave" class="position-top-0" />
2018-03-17 18:26:18 +05:30
</a>
<a
2019-09-30 21:07:59 +05:30
v-if="group.canEdit"
2018-12-05 23:21:45 +05:30
v-tooltip
2019-09-30 21:07:59 +05:30
:href="group.editPath"
:title="editBtnTitle"
:aria-label="editBtnTitle"
2018-03-17 18:26:18 +05:30
data-container="body"
data-placement="bottom"
2020-06-23 00:09:42 +05:30
class="edit-group btn btn-xs no-expand gl-text-gray-700 gl-ml-5"
2019-02-15 15:39:39 +05:30
>
2020-04-08 14:13:33 +05:30
<icon name="settings" class="position-top-0 align-middle" />
2018-03-17 18:26:18 +05:30
</a>
</div>
</template>