summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/boards/components/sidebar
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-06-21 13:39:09 +0100
committerFilipa Lacerda <filipa@gitlab.com>2018-06-21 13:39:09 +0100
commitdecd7d951b6de25c3b06ff84146ce16fd3588e70 (patch)
tree41d61ef3ec74d84803e7f72c30a148a732197e18 /app/assets/javascripts/boards/components/sidebar
parent06df012818a292a0c3f6e510acfc8f62cc384547 (diff)
downloadgitlab-ce-decd7d951b6de25c3b06ff84146ce16fd3588e70.tar.gz
Moves tabs.js component into a vue file
Diffstat (limited to 'app/assets/javascripts/boards/components/sidebar')
-rw-r--r--app/assets/javascripts/boards/components/sidebar/remove_issue.vue91
1 files changed, 45 insertions, 46 deletions
diff --git a/app/assets/javascripts/boards/components/sidebar/remove_issue.vue b/app/assets/javascripts/boards/components/sidebar/remove_issue.vue
index 4ccfe503ef4..806e038a95f 100644
--- a/app/assets/javascripts/boards/components/sidebar/remove_issue.vue
+++ b/app/assets/javascripts/boards/components/sidebar/remove_issue.vue
@@ -1,62 +1,61 @@
<script>
-import Flash from '../../../flash';
-import { __ } from '../../../locale';
+ import Vue from 'vue';
+ import Flash from '../../../flash';
+ import { __ } from '../../../locale';
-const Store = gl.issueBoards.BoardsStore;
+ const Store = gl.issueBoards.BoardsStore;
-export default {
- props: {
- issue: {
- type: Object,
- required: true,
+ export default {
+ props: {
+ issue: {
+ type: Object,
+ required: true,
+ },
+ list: {
+ type: Object,
+ required: true,
+ },
},
- list: {
- type: Object,
- required: true,
+ computed: {
+ updateUrl() {
+ return this.issue.path;
+ },
},
- },
- computed: {
- updateUrl() {
- return this.issue.path;
- },
- },
- methods: {
- removeIssue() {
- const issue = this.issue;
- const lists = issue.getLists();
- const listLabelIds = lists.map(list => list.label.id);
+ methods: {
+ removeIssue() {
+ const issue = this.issue;
+ const lists = issue.getLists();
+ const listLabelIds = lists.map(list => list.label.id);
- let labelIds = issue.labels
- .map(label => label.id)
- .filter(id => !listLabelIds.includes(id));
- if (labelIds.length === 0) {
- labelIds = [''];
- }
+ let labelIds = issue.labels.map(label => label.id).filter(id => !listLabelIds.includes(id));
+ if (labelIds.length === 0) {
+ labelIds = [''];
+ }
- const data = {
- issue: {
- label_ids: labelIds,
- },
- };
+ const data = {
+ issue: {
+ label_ids: labelIds,
+ },
+ };
- // Post the remove data
- Vue.http.patch(this.updateUrl, data).catch(() => {
- Flash(__('Failed to remove issue from board, please try again.'));
+ // Post the remove data
+ Vue.http.patch(this.updateUrl, data).catch(() => {
+ Flash(__('Failed to remove issue from board, please try again.'));
- lists.forEach((list) => {
- list.addIssue(issue);
+ lists.forEach(list => {
+ list.addIssue(issue);
+ });
});
- });
- // Remove from the frontend store
- lists.forEach((list) => {
- list.removeIssue(issue);
- });
+ // Remove from the frontend store
+ lists.forEach(list => {
+ list.removeIssue(issue);
+ });
- Store.detail.issue = {};
+ Store.detail.issue = {};
+ },
},
- },
-};
+ };
</script>
<template>
<div