Module: Analytics::CycleAnalyticsHelper

Defined in:
app/helpers/analytics/cycle_analytics_helper.rb

Instance Method Summary collapse

Instance Method Details

#cycle_analytics_default_stage_configObject


5
6
7
8
9
# File 'app/helpers/analytics/cycle_analytics_helper.rb', line 5

def cycle_analytics_default_stage_config
  Gitlab::Analytics::CycleAnalytics::DefaultStages.all.map do |stage_params|
    Analytics::CycleAnalytics::StagePresenter.new(stage_params)
  end
end

#cycle_analytics_initial_data(project, group = nil) ⇒ Object


11
12
13
14
15
16
17
# File 'app/helpers/analytics/cycle_analytics_helper.rb', line 11

def cycle_analytics_initial_data(project, group = nil)
  base_data = { project_id: project.id, group_path: project.group&.path, request_path: project_cycle_analytics_path(project), full_path: project.full_path }
  svgs = { empty_state_svg_path: image_path("illustrations/analytics/cycle-analytics-empty-chart.svg"), no_data_svg_path: image_path("illustrations/analytics/cycle-analytics-empty-chart.svg"), no_access_svg_path: image_path("illustrations/analytics/no-access.svg") }
  api_paths = group.present? ? cycle_analytics_group_api_paths(group) : cycle_analytics_project_api_paths(project)

  base_data.merge(svgs, api_paths)
end