Commit abb55af2 authored by Phil Hughes's avatar Phil Hughes

Fixed blank state issue

Updated some parts based on feedback
parent 5c7fd643
...@@ -31,9 +31,11 @@ ...@@ -31,9 +31,11 @@
this.query = ''; this.query = '';
}, },
getFilterData () { getFilterData () {
if (!this.list.canSearch()) return this.filters;
const filters = this.filters; const filters = this.filters;
let queryData = this.list.canSearch() ? { search: this.query } : {}; let queryData = { search: this.query };
Object.keys(filters).forEach((key) => { queryData[key] = filters[key]; }); Object.keys(filters).forEach((key) => { queryData[key] = filters[key]; });
return queryData; return queryData;
...@@ -41,7 +43,7 @@ ...@@ -41,7 +43,7 @@
}, },
computed: { computed: {
isPreset () { isPreset () {
return this.list.type === 'backlog' || this.list.type === 'done' || this.list.type === 'blank'; return ['backlog', 'done', 'blank'].indexOf(this.list.type) > -1;
} }
}, },
ready () { ready () {
...@@ -59,7 +61,10 @@ ...@@ -59,7 +61,10 @@
options.handle = '.js-board-drag-handle'; options.handle = '.js-board-drag-handle';
} }
Sortable.create(this.$el.parentNode, options); this.sortable = Sortable.create(this.$el.parentNode, options);
},
beforeDestroy () {
this.sortable.destroy();
} }
}); });
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
BoardsStore.addList({ BoardsStore.addList({
title: label.title, title: label.title,
position: i, position: i,
type: 'label', list_type: 'label',
label: { label: {
title: label.title, title: label.title,
color: label.color color: label.color
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
for (let i = 0, dataLength = data.length; i < dataLength; i++) { for (let i = 0, dataLength = data.length; i < dataLength; i++) {
const listObj = data[i], const listObj = data[i],
list = BoardsStore.findList('title', listObj.title); list = BoardsStore.findList('title', listObj.title);
list.id = listObj.id; list.id = listObj.id;
list.label.id = listObj.label.id; list.label.id = listObj.label.id;
list.getIssues(); list.getIssues();
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
disabled: Boolean disabled: Boolean
}, },
methods: { methods: {
filterByLabel (label, $event) { filterByLabel (label, e) {
let labelToggleText = label.title; let labelToggleText = label.title;
const labelIndex = BoardsStore.state.filters['label_name'].indexOf(label.title); const labelIndex = BoardsStore.state.filters['label_name'].indexOf(label.title);
$($event.target).tooltip('hide'); $(e.target).tooltip('hide');
if (labelIndex === -1) { if (labelIndex === -1) {
BoardsStore.state.filters['label_name'].push(label.title); BoardsStore.state.filters['label_name'].push(label.title);
......
...@@ -44,8 +44,7 @@ ...@@ -44,8 +44,7 @@
}, },
}, },
ready () { ready () {
const list = this.list, const options = gl.getBoardSortableDefaultOptions({
options = gl.getBoardSortableDefaultOptions({
group: 'issues', group: 'issues',
sort: false, sort: false,
disabled: this.disabled, disabled: this.disabled,
...@@ -66,7 +65,7 @@ ...@@ -66,7 +65,7 @@
options.handle = '.js-card-drag-handle'; options.handle = '.js-card-drag-handle';
} }
Sortable.create(this.$els.list, options); this.sortable = Sortable.create(this.$els.list, options);
// Scroll event on list to load more // Scroll event on list to load more
this.$els.list.onscroll = () => { this.$els.list.onscroll = () => {
...@@ -74,6 +73,9 @@ ...@@ -74,6 +73,9 @@
this.loadNextPage(); this.loadNextPage();
} }
}; };
},
beforeDestroy () {
this.sortable.destroy();
} }
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment