diff options
author | Phil Hughes <me@iamphill.com> | 2016-08-19 17:19:20 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-08-31 09:30:37 +0100 |
commit | 4f341ed85b5fb37250799ec13948bbe88074d376 (patch) | |
tree | e2f8cf0dbd87da9ccd73a4e2a7ce18353bf3a158 /app | |
parent | 246bb231c377e2b8a6696811a200d6ac8072cebe (diff) | |
download | gitlab-ce-4f341ed85b5fb37250799ec13948bbe88074d376.tar.gz |
Changed frontend to use issue count from backend
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/boards/models/list.js.es6 | 6 | ||||
-rw-r--r-- | app/views/projects/boards/components/_board.html.haml | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/app/assets/javascripts/boards/models/list.js.es6 b/app/assets/javascripts/boards/models/list.js.es6 index 816fa49516c..296a033071e 100644 --- a/app/assets/javascripts/boards/models/list.js.es6 +++ b/app/assets/javascripts/boards/models/list.js.es6 @@ -11,6 +11,7 @@ class List { this.loading = true; this.loadingMore = false; this.issues = []; + this.issuesSize = 0; if (obj.label) { this.label = new ListLabel(obj.label); @@ -76,12 +77,13 @@ class List { .then((resp) => { const data = resp.json(); this.loading = false; + this.issuesSize = data.size; if (emptyIssues) { this.issues = []; } - this.createIssues(data); + this.createIssues(data.issues); }); } @@ -99,6 +101,7 @@ class List { } if (listFrom) { + this.issuesSize++; gl.boardService.moveIssue(issue.id, listFrom.id, this.id); } } @@ -112,6 +115,7 @@ class List { const matchesRemove = removeIssue.id === issue.id; if (matchesRemove) { + this.issuesSize--; issue.removeLabel(this.label); } diff --git a/app/views/projects/boards/components/_board.html.haml b/app/views/projects/boards/components/_board.html.haml index 6b4bfe0c354..069f8b805bc 100644 --- a/app/views/projects/boards/components/_board.html.haml +++ b/app/views/projects/boards/components/_board.html.haml @@ -13,7 +13,7 @@ %h3.board-title.js-board-handle{ ":class" => "{ 'user-can-drag': (!disabled && !list.preset) }" } {{ list.title }} %span.pull-right{ "v-if" => "list.type !== 'blank'" } - {{ list.issues.length }} + {{ list.issuesSize }} - if can?(current_user, :admin_list, @project) %board-delete{ "inline-template" => true, ":list" => "list", |