diff options
author | Kushal Pandya <kushal@gitlab.com> | 2018-01-10 12:55:41 +0530 |
---|---|---|
committer | Kushal Pandya <kushal@gitlab.com> | 2018-01-11 12:12:56 +0530 |
commit | 5082b8d83fc6b577d5b4052f90079a98353b0bcd (patch) | |
tree | 6d87643c73ab8d961df65c354e2f32a3619702f6 /app/assets/javascripts/groups | |
parent | b10ea6e386a025759aca5e9ef0d23931e77d1012 (diff) | |
download | gitlab-ce-5082b8d83fc6b577d5b4052f90079a98353b0bcd.tar.gz |
Move modal dialog to app root component
Diffstat (limited to 'app/assets/javascripts/groups')
-rw-r--r-- | app/assets/javascripts/groups/components/item_actions.vue | 86 |
1 files changed, 31 insertions, 55 deletions
diff --git a/app/assets/javascripts/groups/components/item_actions.vue b/app/assets/javascripts/groups/components/item_actions.vue index 1bde6ae5185..87065b3d6e3 100644 --- a/app/assets/javascripts/groups/components/item_actions.vue +++ b/app/assets/javascripts/groups/components/item_actions.vue @@ -1,56 +1,41 @@ <script> - import { s__ } from '~/locale'; - import tooltip from '~/vue_shared/directives/tooltip'; - import icon from '~/vue_shared/components/icon.vue'; - import modal from '~/vue_shared/components/modal.vue'; - import eventHub from '../event_hub'; - import { COMMON_STR } from '../constants'; +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, - modal, +export default { + components: { + icon, + }, + directives: { + tooltip, + }, + props: { + parentGroup: { + type: Object, + required: false, + default: () => ({}), }, - directives: { - tooltip, + group: { + type: Object, + required: true, }, - props: { - parentGroup: { - type: Object, - required: false, - default: () => ({}), - }, - group: { - type: Object, - required: true, - }, + }, + computed: { + leaveBtnTitle() { + return COMMON_STR.LEAVE_BTN_TITLE; }, - data() { - return { - modalStatus: false, - }; + editBtnTitle() { + return COMMON_STR.EDIT_BTN_TITLE; }, - computed: { - leaveBtnTitle() { - return COMMON_STR.LEAVE_BTN_TITLE; - }, - editBtnTitle() { - return COMMON_STR.EDIT_BTN_TITLE; - }, - leaveConfirmationMessage() { - return s__(`GroupsTree|Are you sure you want to leave the "${this.group.fullName}" group?`); - }, + }, + methods: { + onLeaveGroup() { + eventHub.$emit('showLeaveGroupModal', this.group, this.parentGroup); }, - methods: { - onLeaveGroup() { - this.modalStatus = true; - }, - leaveGroup() { - this.modalStatus = false; - eventHub.$emit('leaveGroup', this.group, this.parentGroup); - }, - }, - }; + }, +}; </script> <template> @@ -78,14 +63,5 @@ class="leave-group btn no-expand"> <icon name="leave"/> </a> - <modal - v-show="modalStatus" - :primary-button-label="__('Leave')" - kind="warning" - :title="__('Are you sure?')" - :text="__('Are you sure you want to leave this group?')" - :body="leaveConfirmationMessage" - @submit="leaveGroup" - /> </div> </template> |