debian-mirror-gitlab/app/services/boards/issues/list_service.rb

54 lines
1 KiB
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2016-09-13 17:45:13 +05:30
module Boards
module Issues
2021-03-08 18:12:59 +05:30
class ListService < Boards::BaseItemsListService
2018-11-18 11:00:15 +05:30
include Gitlab::Utils::StrongMemoize
2020-03-13 15:44:24 +05:30
def self.valid_params
IssuesFinder.valid_params
end
2016-09-13 17:45:13 +05:30
private
2021-03-08 18:12:59 +05:30
def ordered_items
items.order_by_position_and_priority(with_cte: params[:search].present?)
2018-11-18 11:00:15 +05:30
end
2021-03-08 18:12:59 +05:30
def finder
IssuesFinder.new(current_user, filter_params)
2018-11-08 19:23:39 +05:30
end
2016-11-03 12:29:30 +05:30
def board
2018-03-17 18:26:18 +05:30
@board ||= parent.boards.find(params[:board_id])
2016-11-03 12:29:30 +05:30
end
2016-09-13 17:45:13 +05:30
def filter_params
2018-05-09 12:01:36 +05:30
set_scope
2018-12-05 23:21:45 +05:30
set_non_archived
2021-01-03 14:25:43 +05:30
set_issue_types
2016-09-13 17:45:13 +05:30
2021-03-08 18:12:59 +05:30
super
2016-09-13 17:45:13 +05:30
end
2018-05-09 12:01:36 +05:30
def set_scope
params[:include_subgroups] = board.group_board?
end
2018-12-05 23:21:45 +05:30
def set_non_archived
params[:non_archived] = parent.is_a?(Group)
end
2021-01-03 14:25:43 +05:30
def set_issue_types
params[:issue_types] = Issue::TYPES_FOR_LIST
end
2021-03-08 18:12:59 +05:30
def item_model
Issue
2020-03-13 15:44:24 +05:30
end
2016-09-13 17:45:13 +05:30
end
end
end
2019-12-04 20:38:33 +05:30
Boards::Issues::ListService.prepend_if_ee('EE::Boards::Issues::ListService')