2019-07-04 11:18:33 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module CycleAnalytics
|
2019-07-04 14:42:31 +00:00
|
|
|
class ProjectLevel
|
2019-07-16 09:38:19 +00:00
|
|
|
include LevelBase
|
2019-07-10 11:33:25 +00:00
|
|
|
attr_reader :project, :options
|
|
|
|
|
2019-07-08 08:26:02 +00:00
|
|
|
def initialize(project, options:)
|
2019-07-04 11:18:33 +00:00
|
|
|
@project = project
|
2019-07-04 14:42:31 +00:00
|
|
|
@options = options.merge(project: project)
|
2019-07-04 11:18:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def summary
|
2019-07-10 11:33:25 +00:00
|
|
|
@summary ||= ::Gitlab::CycleAnalytics::StageSummary.new(project,
|
|
|
|
from: options[:from],
|
2019-10-07 21:07:54 +00:00
|
|
|
to: options[:to],
|
2019-07-10 11:33:25 +00:00
|
|
|
current_user: options[:current_user]).data
|
2019-07-04 11:18:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def permissions(user:)
|
2019-07-10 11:33:25 +00:00
|
|
|
Gitlab::CycleAnalytics::Permissions.get(user: user, project: project)
|
2019-07-04 11:18:33 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|