2018-08-03 19:52:37 +00:00
|
|
|
# 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)
|
2018-12-20 11:14:33 +00:00
|
|
|
super
|
2018-08-03 19:52:37 +00:00
|
|
|
|
|
|
|
@group_name = milestone.group.full_name
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.build_collection(groups)
|
2018-09-17 16:35:39 +00:00
|
|
|
Milestone.of_groups(groups.select(:id))
|
|
|
|
.reorder_by_due_date_asc
|
|
|
|
.order_by_name_asc
|
|
|
|
.active
|
|
|
|
.map { |m| new(m) }
|
2018-08-03 19:52:37 +00:00
|
|
|
end
|
|
|
|
end
|