2016-07-28 11:33:04 +00:00
|
|
|
//= require vue
|
|
|
|
//= require vue-resource
|
|
|
|
//= require Sortable
|
2016-08-01 13:18:30 +00:00
|
|
|
//= require_tree ./models
|
2016-07-28 11:33:04 +00:00
|
|
|
//= require_tree ./stores
|
|
|
|
//= require_tree ./services
|
2016-08-05 15:30:14 +00:00
|
|
|
//= require_tree ./mixins
|
2016-07-28 11:33:04 +00:00
|
|
|
//= require_tree ./components
|
|
|
|
|
|
|
|
$(function () {
|
2016-08-05 13:00:06 +00:00
|
|
|
if (!window.gl) {
|
|
|
|
window.gl = {};
|
|
|
|
}
|
|
|
|
gl.boardService = new BoardService($('#board-app').data('endpoint'));
|
2016-07-28 11:33:04 +00:00
|
|
|
|
2016-08-05 13:00:06 +00:00
|
|
|
if (gl.IssueBoardsApp) {
|
|
|
|
gl.IssueBoardsApp.$destroy(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
gl.IssueBoardsApp = new Vue({
|
2016-07-28 11:33:04 +00:00
|
|
|
el: '#board-app',
|
2016-08-08 08:45:13 +00:00
|
|
|
props: {
|
|
|
|
disabled: Boolean
|
|
|
|
},
|
2016-07-28 11:33:04 +00:00
|
|
|
data: {
|
|
|
|
state: BoardsStore.state
|
|
|
|
},
|
2016-08-05 17:39:49 +00:00
|
|
|
init: function () {
|
|
|
|
BoardsStore.create();
|
|
|
|
},
|
2016-07-28 11:33:04 +00:00
|
|
|
ready: function () {
|
2016-08-08 08:45:13 +00:00
|
|
|
BoardsStore.disabled = this.disabled;
|
2016-08-05 13:00:06 +00:00
|
|
|
gl.boardService.all()
|
2016-07-28 11:33:04 +00:00
|
|
|
.then((resp) => {
|
2016-08-02 08:58:09 +00:00
|
|
|
const boards = resp.json();
|
|
|
|
|
|
|
|
boards.forEach((board) => {
|
2016-08-08 13:30:38 +00:00
|
|
|
const list = BoardsStore.addList(board);
|
2016-08-04 15:16:50 +00:00
|
|
|
|
|
|
|
if (list.type === 'done') {
|
|
|
|
list.position = 9999999;
|
2016-08-05 16:01:34 +00:00
|
|
|
} else if (list.type === 'backlog') {
|
|
|
|
list.position = -1;
|
2016-08-04 15:16:50 +00:00
|
|
|
}
|
2016-07-28 11:33:04 +00:00
|
|
|
});
|
2016-08-04 15:16:50 +00:00
|
|
|
|
|
|
|
BoardsStore.addBlankState();
|
2016-07-28 11:33:04 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|