Fixed blank state issue

Updated some parts based on feedback
This commit is contained in:
Phil Hughes 2016-08-15 09:41:06 +01:00
parent 5c7fd643a6
commit abb55af272
4 changed files with 18 additions and 10 deletions

View file

@ -31,9 +31,11 @@
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]; });
return queryData;
@ -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();
}
});

View file

@ -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();

View file

@ -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);

View file

@ -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();
}
});