Commit 83b4ba28 authored by Phil Hughes's avatar Phil Hughes

Can move between lists

Currently a bug exists were moving into done does not remove from all
parent a3e52ef9
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
boardId: [Number, String], boardId: [Number, String],
filters: Object, filters: Object,
issues: Array, issues: Array,
query: String query: String,
loading: Boolean
}, },
data: () => { data: () => {
return { return {
......
class Issue { class Issue {
constructor (obj) { constructor (obj) {
this.id = obj.id; this.id = obj.iid;
this.title = obj.title; this.title = obj.title;
this.labels = []; this.labels = [];
......
...@@ -11,9 +11,11 @@ class List { ...@@ -11,9 +11,11 @@ class List {
} }
if (this.type !== 'blank') { if (this.type !== 'blank') {
this.loading = true;
service.getIssuesForList(this.id) service.getIssuesForList(this.id)
.then((resp) => { .then((resp) => {
const data = resp.json(); const data = resp.json();
this.loading = false;
data.forEach((issue) => { data.forEach((issue) => {
this.issues.push(new Issue(issue)); this.issues.push(new Issue(issue));
......
...@@ -4,6 +4,7 @@ class BoardService { ...@@ -4,6 +4,7 @@ class BoardService {
this.lists = Vue.resource(`${root}{/id}.json`, {}); this.lists = Vue.resource(`${root}{/id}.json`, {});
this.list = Vue.resource(`${root}/lists{/id}.json`, {}); this.list = Vue.resource(`${root}/lists{/id}.json`, {});
this.issue = Vue.resource(`${root}/issues{/id}.json`, {});
this.issues = Vue.resource(`${root}/lists{/id}/issues.json`, {}); this.issues = Vue.resource(`${root}/lists{/id}/issues.json`, {});
} }
...@@ -47,4 +48,13 @@ class BoardService { ...@@ -47,4 +48,13 @@ class BoardService {
return this.issues.get({ id }); return this.issues.get({ id });
} }
moveIssue (id, from, to) {
return this.issue.update({ id }, {
issue: {
from,
to
}
});
}
}; };
...@@ -118,6 +118,8 @@ ...@@ -118,6 +118,8 @@
list.removeIssue(issue); list.removeIssue(issue);
}); });
} }
service.moveIssue(issue.id, listFrom.id, listTo.id);
}, },
getListsForIssue: function (issue) { getListsForIssue: function (issue) {
return _.filter(this.state.lists, (list) => { return _.filter(this.state.lists, (list) => {
......
...@@ -188,6 +188,11 @@ ...@@ -188,6 +188,11 @@
overflow: scroll; overflow: scroll;
} }
.board-list-loading {
margin-top: 10px;
font-size: 26px;
}
.is-ghost { .is-ghost {
opacity: 0; opacity: 0;
} }
......
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
= icon("search", class: "board-search-icon", "v-show" => "!query") = icon("search", class: "board-search-icon", "v-show" => "!query")
%button.board-search-clear-btn{ type: "button", role: "button", "aria-label" => "Clear search", "@click" => "clearSearch", "v-show" => "query" } %button.board-search-clear-btn{ type: "button", role: "button", "aria-label" => "Clear search", "@click" => "clearSearch", "v-show" => "query" }
= icon("times", class: "board-search-clear") = icon("times", class: "board-search-clear")
%board-list{ "inline-template" => true, "v-if" => "board.id != 'blank'", ":board-id" => "board.id", ":issues" => "board.issues", ":disabled" => "#{current_user.nil?}", ":query" => "query", ":filters" => "filters" } %board-list{ "inline-template" => true, "v-if" => "board.id != 'blank'", ":board-id" => "board.id", ":issues" => "board.issues", ":disabled" => "#{current_user.nil?}", ":query" => "query", ":filters" => "filters", ":loading" => "board.loading" }
.board-list-loading.text-center{ "v-if" => "loading" }
= icon("spinner spin")
%ul.board-list{ "v-el:list" => true, ":data-board" => "boardId" } %ul.board-list{ "v-el:list" => true, ":data-board" => "boardId" }
= render "projects/boards/components/card" = render "projects/boards/components/card"
= render "projects/boards/components/blank_state" = render "projects/boards/components/blank_state"
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