summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-06-28 10:40:13 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-06-28 10:40:13 +0000
commit4596ab5b6b2cb7a2f78babe62268bb66b6fd2449 (patch)
treeec746d85d1f37531abf43797079fffa751e3b42e
parentf7a9e7138f04b54ed769d3f86a6aece08f442ce7 (diff)
parent9aa832285c10f627a67b5f49870d694b27fc37c2 (diff)
downloadgitlab-ce-4596ab5b6b2cb7a2f78babe62268bb66b6fd2449.tar.gz
Merge branch 'issue-boards-closed-list-all' into 'master'
Fixed issue boards closed list not listing all issues Closes #33850 See merge request !12271
-rw-r--r--app/services/boards/issues/list_service.rb12
-rw-r--r--changelogs/unreleased/issue-boards-closed-list-all.yml4
-rw-r--r--spec/services/boards/issues/list_service_spec.rb2
3 files changed, 15 insertions, 3 deletions
diff --git a/app/services/boards/issues/list_service.rb b/app/services/boards/issues/list_service.rb
index 418fa9afd6e..a1d67cbc244 100644
--- a/app/services/boards/issues/list_service.rb
+++ b/app/services/boards/issues/list_service.rb
@@ -3,7 +3,7 @@ module Boards
class ListService < BaseService
def execute
issues = IssuesFinder.new(current_user, filter_params).execute
- issues = without_board_labels(issues) unless movable_list?
+ issues = without_board_labels(issues) unless movable_list? || closed_list?
issues = with_list_label(issues) if movable_list?
issues.order_by_position_and_priority
end
@@ -21,7 +21,15 @@ module Boards
end
def movable_list?
- @movable_list ||= list.present? && list.movable?
+ return @movable_list if defined?(@movable_list)
+
+ @movable_list = list.present? && list.movable?
+ end
+
+ def closed_list?
+ return @closed_list if defined?(@closed_list)
+
+ @closed_list = list.present? && list.closed?
end
def filter_params
diff --git a/changelogs/unreleased/issue-boards-closed-list-all.yml b/changelogs/unreleased/issue-boards-closed-list-all.yml
new file mode 100644
index 00000000000..7643864150d
--- /dev/null
+++ b/changelogs/unreleased/issue-boards-closed-list-all.yml
@@ -0,0 +1,4 @@
+---
+title: Fixed issue boards closed list not showing all closed issues
+merge_request:
+author:
diff --git a/spec/services/boards/issues/list_service_spec.rb b/spec/services/boards/issues/list_service_spec.rb
index a1e220c2322..a66cc2cd6e9 100644
--- a/spec/services/boards/issues/list_service_spec.rb
+++ b/spec/services/boards/issues/list_service_spec.rb
@@ -67,7 +67,7 @@ describe Boards::Issues::ListService, services: true do
issues = described_class.new(project, user, params).execute
- expect(issues).to eq [closed_issue4, closed_issue2, closed_issue3, closed_issue1]
+ expect(issues).to eq [closed_issue4, closed_issue2, closed_issue5, closed_issue3, closed_issue1]
end
it 'returns opened issues that have label list applied when listing issues from a label list' do