Commit 9806db32 authored by Phil Hughes's avatar Phil Hughes

Added loading icon so user knows when new page is loading

Added test for finding lists when limited to type
parent 31657f8d
......@@ -10,14 +10,13 @@
data () {
return {
scrollOffset: 250,
loadingMore: false,
filters: BoardsStore.state.filters
};
},
watch: {
filters: {
handler () {
this.loadingMore = false;
this.list.loadingMore = false;
this.$els.list.scrollTop = 0;
},
deep: true
......@@ -34,12 +33,12 @@
return this.$els.list.scrollTop + this.listHeight();
},
loadNextPage () {
this.loadingMore = true;
const getIssues = this.list.nextPage();
if (getIssues) {
this.list.loadingMore = true;
getIssues.then(() => {
this.loadingMore = false;
this.list.loadingMore = false;
});
}
},
......@@ -71,7 +70,7 @@
// Scroll event on list to load more
this.$els.list.onscroll = () => {
if ((this.scrollTop() > this.scrollHeight() - this.scrollOffset) && !this.loadingMore) {
if ((this.scrollTop() > this.scrollHeight() - this.scrollOffset) && !this.list.loadingMore) {
this.loadNextPage();
}
};
......
......@@ -7,6 +7,7 @@ class List {
this.filters = BoardsStore.state.filters;
this.page = 1;
this.loading = true;
this.loadingMore = false;
this.issues = [];
if (obj.label) {
......
......@@ -133,6 +133,11 @@
}
}
.board-header-loading-spinner {
margin-right: 10px;
color: $gray-darkest;
}
.board-inner-container {
border-bottom: 1px solid $border-color;
padding: $gl-padding;
......
......@@ -18,6 +18,7 @@
":list" => "list" }
%button.board-delete.has-tooltip.pull-right{ type: "button", title: "Delete list", "aria-label" => "Delete list", data: { placement: "bottom" }, "@click" => "deleteBoard" }
= icon("trash")
= icon("spinner spin", class: "board-header-loading-spinner pull-right", "v-show" => "list.loadingMore")
.board-inner-container.board-search-container{ "v-if" => "list.canSearch()" }
%input.form-control{ type: "text", placeholder: "Search issues", "v-model" => "query", "debounce" => "250" }
= icon("search", class: "board-search-icon", "v-show" => "!query")
......
......@@ -46,6 +46,18 @@
expect(list).toBeDefined();
});
it('finds list limited by type', () => {
BoardsStore.addList({
id: 1,
position: 0,
title: 'Test',
list_type: 'backlog'
});
const list = BoardsStore.findList('id', 1, 'backlog');
expect(list).toBeDefined();
});
it('gets issue when new list added', (done) => {
BoardsStore.addList(listObj);
const list = BoardsStore.findList('id', 1);
......
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