Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/boards/issues/list_service.rb')
-rw-r--r--app/services/boards/issues/list_service.rb20
1 files changed, 18 insertions, 2 deletions
diff --git a/app/services/boards/issues/list_service.rb b/app/services/boards/issues/list_service.rb
index e08509b84db..140420a32bd 100644
--- a/app/services/boards/issues/list_service.rb
+++ b/app/services/boards/issues/list_service.rb
@@ -45,6 +45,12 @@ module Boards
# rubocop: enable CodeReuse/ActiveRecord
def filter(issues)
+ # when grouping board issues by epics (used in board swimlanes)
+ # we need to get all issues in the board
+ # TODO: ignore hidden columns -
+ # https://gitlab.com/gitlab-org/gitlab/-/issues/233870
+ return issues if params[:all_lists]
+
issues = without_board_labels(issues) unless list&.movable? || list&.closed?
issues = with_list_label(issues) if list&.label?
issues
@@ -55,9 +61,17 @@ module Boards
end
def list
- return @list if defined?(@list)
+ return unless params.key?(:id)
+
+ strong_memoize(:list) do
+ id = params[:id]
- @list = board.lists.find(params[:id]) if params.key?(:id)
+ if board.lists.loaded?
+ board.lists.find { |l| l.id == id }
+ else
+ board.lists.find(id)
+ end
+ end
end
def filter_params
@@ -79,6 +93,8 @@ module Boards
end
def set_state
+ return if params[:all_lists]
+
params[:state] = list && list.closed? ? 'closed' : 'opened'
end