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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-19 03:11:06 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-19 03:11:06 +0300
commit6f5b1492ab0eb74f7594a97d94c10199708c7fd3 (patch)
treec49ac391b0b957d5e7f279c1afa47f6852bf8758 /app/services/boards/lists
parent7131f9028de0f70aff1cb22b80944ce46249345c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/boards/lists')
-rw-r--r--app/services/boards/lists/list_service.rb21
1 files changed, 20 insertions, 1 deletions
diff --git a/app/services/boards/lists/list_service.rb b/app/services/boards/lists/list_service.rb
index e4c789c4597..3c296cde51e 100644
--- a/app/services/boards/lists/list_service.rb
+++ b/app/services/boards/lists/list_service.rb
@@ -9,7 +9,26 @@ module Boards
end
lists = board.lists.preload_associated_models
- params[:list_id].present? ? lists.where(id: params[:list_id]) : lists # rubocop: disable CodeReuse/ActiveRecord
+
+ return lists.id_in(params[:list_id]) if params[:list_id].present?
+
+ list_types = unavailable_list_types_for(board)
+ lists.without_types(list_types)
+ end
+
+ private
+
+ def unavailable_list_types_for(board)
+ hidden_lists_for(board)
+ end
+
+ def hidden_lists_for(board)
+ hidden = []
+
+ hidden << ::List.list_types[:backlog] if board.hide_backlog_list
+ hidden << ::List.list_types[:closed] if board.hide_closed_list
+
+ hidden
end
end
end