1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
(() => {
const Board = Vue.extend({
props: {
board: Object,
disabled: Boolean
},
data: function () {
return {
filters: BoardsStore.state.filters
};
},
watch: {
'query': function () {
if (this.board.canSearch()) {
this.board.getIssues(true);
}
},
'filters': {
handler: function () {
this.board.getIssues(true);
},
deep: true
}
},
methods: {
clearSearch: function () {
this.query = '';
},
getFilterData: function () {
const queryData = this.board.canSearch() ? { search: this.query } : {};
return _.extend(queryData, this.filters);
}
},
computed: {
isPreset: function () {
return this.board.type === 'backlog' || this.board.type === 'done' || this.board.type === 'blank';
}
},
ready: function () {
const options = _.extend({
disabled: this.disabled,
group: 'boards',
draggable: '.is-draggable',
handle: '.js-board-handle',
filter: '.board-delete',
onUpdate: function (e) {
BoardsStore.moveList(e.oldIndex, e.newIndex);
}
}, gl.boardSortableDefaultOptions);
Sortable.create(this.$el.parentNode, options);
}
});
Vue.component('board', Board)
})();
|