2016-09-13 17:45:13 +05:30
|
|
|
(() => {
|
|
|
|
const Store = gl.issueBoards.BoardsStore;
|
|
|
|
|
|
|
|
window.gl = window.gl || {};
|
|
|
|
window.gl.issueBoards = window.gl.issueBoards || {};
|
|
|
|
|
|
|
|
gl.issueBoards.BoardBlankState = Vue.extend({
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
predefinedLabels: [
|
2016-11-03 12:29:30 +05:30
|
|
|
new ListLabel({ title: 'To Do', color: '#F0AD4E' }),
|
|
|
|
new ListLabel({ title: 'Doing', color: '#5CB85C' })
|
2016-09-13 17:45:13 +05:30
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
addDefaultLists () {
|
|
|
|
this.clearBlankState();
|
|
|
|
|
|
|
|
this.predefinedLabels.forEach((label, i) => {
|
|
|
|
Store.addList({
|
|
|
|
title: label.title,
|
|
|
|
position: i,
|
|
|
|
list_type: 'label',
|
|
|
|
label: {
|
|
|
|
title: label.title,
|
|
|
|
color: label.color
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
// Save the labels
|
|
|
|
gl.boardService.generateDefaultLists()
|
|
|
|
.then((resp) => {
|
|
|
|
resp.json().forEach((listObj) => {
|
|
|
|
const list = Store.findList('title', listObj.title);
|
|
|
|
|
|
|
|
list.id = listObj.id;
|
|
|
|
list.label.id = listObj.label.id;
|
|
|
|
list.getIssues();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
clearBlankState: Store.removeBlankState.bind(Store)
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})();
|