import statusIcon from '../mr_widget_status_icon'; 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.json()) .then((res) => { eventHub.$emit('UpdateWidgetData', res); 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: `
`, };