Commit abb55af2 authored by Phil Hughes's avatar Phil Hughes

Fixed blank state issue

Updated some parts based on feedback
parent 5c7fd643
......@@ -31,8 +31,10 @@
this.query = '';
},
getFilterData () {
if (!this.list.canSearch()) return 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]; });
......@@ -41,7 +43,7 @@
},
computed: {
isPreset () {
return this.list.type === 'backlog' || this.list.type === 'done' || this.list.type === 'blank';
return ['backlog', 'done', 'blank'].indexOf(this.list.type) > -1;
}
},
ready () {
......@@ -59,7 +61,10 @@
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 @@
BoardsStore.addList({
title: label.title,
position: i,
type: 'label',
list_type: 'label',
label: {
title: label.title,
color: label.color
......@@ -37,6 +37,7 @@
for (let i = 0, dataLength = data.length; i < dataLength; i++) {
const listObj = data[i],
list = BoardsStore.findList('title', listObj.title);
list.id = listObj.id;
list.label.id = listObj.label.id;
list.getIssues();
......
......@@ -7,10 +7,10 @@
disabled: Boolean
},
methods: {
filterByLabel (label, $event) {
filterByLabel (label, e) {
let labelToggleText = label.title;
const labelIndex = BoardsStore.state.filters['label_name'].indexOf(label.title);
$($event.target).tooltip('hide');
$(e.target).tooltip('hide');
if (labelIndex === -1) {
BoardsStore.state.filters['label_name'].push(label.title);
......
......@@ -44,8 +44,7 @@
},
},
ready () {
const list = this.list,
options = gl.getBoardSortableDefaultOptions({
const options = gl.getBoardSortableDefaultOptions({
group: 'issues',
sort: false,
disabled: this.disabled,
......@@ -66,7 +65,7 @@
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
this.$els.list.onscroll = () => {
......@@ -74,6 +73,9 @@
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