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