BigW Consortium Gitlab

Commit c30a9013 by Phil Hughes

Changes names to lists

Fixed some bugs introduced when moving to es6
parent 8e041957
......@@ -17,7 +17,7 @@ $(function () {
service.all()
.then((resp) => {
resp.data.forEach((board) => {
BoardsStore.state.boards.push(board);
BoardsStore.state.lists.push(board);
});
});
}
......
......@@ -15,7 +15,7 @@
},
computed: {
isPreset: function () {
typeof this.board.id !== 'number';
return typeof this.board.id !== 'number';
}
},
ready: function () {
......
((w) => {
w.BoardsStore = {
state: {
boards: [],
lists: [],
done: {},
filters: {
author: {},
......@@ -10,18 +10,18 @@
}
},
removeBoard: (id) => {
BoardsStore.state.boards = _.reject(BoardsStore.state.boards, (board) => {
BoardsStore.state.lists = _.reject(BoardsStore.state.lists, (board) => {
return board.id === id;
});
},
moveBoard: (oldIndex, newIndex) => {
const boardFrom = _.find(BoardsStore.state.boards, (board) => {
const boardFrom = _.find(BoardsStore.state.lists, (board) => {
return board.index === oldIndex;
});
service.updateBoard(boardFrom.id, newIndex);
const boardTo = _.find(BoardsStore.state.boards, (board) => {
const boardTo = _.find(BoardsStore.state.lists, (board) => {
return board.index === newIndex;
});
......@@ -33,10 +33,10 @@
}
},
moveCardToBoard: (boardFromId, boardToId, issueId, toIndex) => {
const boardFrom = _.find(BoardsStore.state.boards, (board) => {
const boardFrom = _.find(BoardsStore.state.lists, (board) => {
return board.id === boardFromId;
});
const boardTo = _.find(BoardsStore.state.boards, (board) => {
const boardTo = _.find(BoardsStore.state.lists, (board) => {
return board.id === boardToId;
});
let issue = _.find(boardFrom.issues, (issue) => {
......@@ -53,7 +53,7 @@
});
// Add to new boards issues if it doesn't already exist
if (issueTo !== null) {
if (issueTo) {
issue = issueTo;
} else {
boardTo.issues.splice(toIndex, 0, issue);
......@@ -71,7 +71,7 @@
return label.title === boardTo.title;
});
if (foundLabel === null) {
if (!foundLabel) {
issue.labels.push(boardTo.label);
}
}
......@@ -79,7 +79,7 @@
},
removeIssueFromBoards: (issue, boards) => {
const boardLabels = _.map(boards, (board) => {
return board.label.title;
return board.title;
});
boards.issues = _.each(boards, (board) => {
......@@ -98,11 +98,11 @@
});
},
getBoardsForIssue: (issue) => {
_.filter(BoardsStore.state.boards, (board) => {
return _.filter(BoardsStore.state.lists, (board) => {
const foundIssue = _.find(board.issues, (boardIssue) => {
return issue.id === boardIssue.id;
});
return foundIssue !== null;
return foundIssue;
});
},
clearDone: () => {
......
%board{ "inline-template" => true, "v-cloak" => true, "v-for" => "board in state.boards | orderBy 'index'", ":board" => "board" }
%board{ "inline-template" => true, "v-cloak" => true, "v-for" => "board in state.lists | orderBy 'index'", ":board" => "board" }
.board{ ":class" => "{ 'is-draggable': !isPreset }" }
.board-inner
%header.board-inner-container.board-header{ ":class" => "{ 'has-border': board.label }", ":style" => "{ borderTopColor: board.label.backgroundColor }" }
......@@ -7,16 +7,12 @@
%span.pull-right
{{ board.issues.length }}
%board-delete{ "inline-template" => true, "v-if" => "!isPreset", ":board-id" => "board.id" }
%button.board-delete.has-tooltip.pull-right{ type: "button", title: "Delete board", data: { placement: "bottom" }, "@click" => "deleteBoard" }
%span.sr-only
Delete board
%button.board-delete.has-tooltip.pull-right{ type: "button", title: "Delete board", "aria-label" => "Delete board", data: { placement: "bottom" }, "@click" => "deleteBoard" }
= icon("trash")
.board-inner-container.board-search-container{ "v-if" => "board.search" }
%input.form-control{ type: "text", placeholder: "Search issues", "v-model" => "query" }
= icon("search", class: "board-search-icon", "v-show" => "!query")
%button.board-search-clear-btn{ type: "button", role: "button", "@click" => "clearSearch", "v-show" => "query" }
%span.sr-only
Clear search
%button.board-search-clear-btn{ type: "button", role: "button", "aria-label" => "Clear search", "@click" => "clearSearch", "v-show" => "query" }
= icon("times", class: "board-search-clear")
%board-list{ "inline-template" => true, ":board-id" => "board.id", ":issues" => "board.issues", ":disabled" => "#{current_user.nil?}", ":query" => "query", ":filters" => "filters" }
%ul.board-list{ "v-el:list" => true, ":data-board" => "boardId" }
......
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