debian-mirror-gitlab/app/models/dashboard_group_milestone.rb

26 lines
765 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
# Dashboard Group Milestones are milestones that allow us to pull more info out for the UI that the Milestone object doesn't allow for
class DashboardGroupMilestone < GlobalMilestone
extend ::Gitlab::Utils::Override
attr_reader :group_name
def initialize(milestone)
2019-02-15 15:39:39 +05:30
super
2018-11-18 11:00:15 +05:30
@group_name = milestone.group.full_name
end
2019-03-02 22:35:43 +05:30
def self.build_collection(groups, params)
milestones = Milestone.of_groups(groups.select(:id))
2018-12-05 23:21:45 +05:30
.reorder_by_due_date_asc
.order_by_name_asc
2019-03-02 22:35:43 +05:30
milestones = milestones.search_title(params[:search_title]) if params[:search_title].present?
2019-10-12 21:52:04 +05:30
Milestone.filter_by_state(milestones, params[:state]).map { |m| new(m) }
2018-11-18 11:00:15 +05:30
end
2019-12-26 22:10:19 +05:30
def dashboard_milestone?
true
end
2018-11-18 11:00:15 +05:30
end