From f3f81c3cd28bbb6c3bd89f9bf3f5c599eab20230 Mon Sep 17 00:00:00 2001 From: George Tsiolis Date: Mon, 5 Mar 2018 19:15:31 +0200 Subject: Move WorkInProgress vue component --- .../components/states/mr_widget_wip.js | 67 ------------------- .../components/states/work_in_progress.vue | 76 ++++++++++++++++++++++ .../vue_merge_request_widget/dependencies.js | 2 +- .../vue_merge_request_widget/mr_widget_options.js | 4 +- 4 files changed, 79 insertions(+), 70 deletions(-) delete mode 100644 app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_wip.js create mode 100644 app/assets/javascripts/vue_merge_request_widget/components/states/work_in_progress.vue (limited to 'app/assets/javascripts/vue_merge_request_widget') diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_wip.js b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_wip.js deleted file mode 100644 index 44e1a616a19..00000000000 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_wip.js +++ /dev/null @@ -1,67 +0,0 @@ -import $ from 'jquery'; -import statusIcon from '../mr_widget_status_icon.vue'; -import tooltip from '../../../vue_shared/directives/tooltip'; -import eventHub from '../../event_hub'; - -export default { - name: 'MRWidgetWIP', - props: { - mr: { type: Object, required: true }, - service: { type: Object, required: true }, - }, - directives: { - tooltip, - }, - data() { - return { - isMakingRequest: false, - }; - }, - components: { - statusIcon, - }, - methods: { - removeWIP() { - this.isMakingRequest = true; - this.service.removeWIP() - .then(res => res.data) - .then((data) => { - eventHub.$emit('UpdateWidgetData', data); - new window.Flash('The merge request can now be merged.', 'notice'); // eslint-disable-line - $('.merge-request .detail-page-description .title').text(this.mr.title); - }) - .catch(() => { - this.isMakingRequest = false; - new window.Flash('Something went wrong. Please try again.'); // eslint-disable-line - }); - }, - }, - template: ` -
- -
- - This is a Work in Progress - - - -