gitlab-org--gitlab-foss/app/assets/javascripts/boards/components/sidebar/remove_issue.js.es6
2017-02-03 17:02:44 +03:00

34 lines
752 B
JavaScript

/* global Vue */
(() => {
const Store = gl.issueBoards.BoardsStore;
window.gl = window.gl || {};
window.gl.issueBoards = window.gl.issueBoards || {};
gl.issueBoards.RemoveIssueBtn = Vue.extend({
props: [
'issue', 'list',
],
methods: {
removeIssue() {
const doneList = Store.findList('type', 'done', false);
Store.moveIssueToList(this.list, doneList, this.issue, 0);
Store.detail.issue = {};
},
},
template: `
<div
class="block list"
v-if="list.type !== 'done'">
<button
class="btn btn-default btn-block"
type="button"
@click="removeIssue">
Remove from board
</button>
</div>
`,
});
})();