diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /app/services/boards/issues/list_service.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/services/boards/issues/list_service.rb')
-rw-r--r-- | app/services/boards/issues/list_service.rb | 20 |
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 |