Module: Ci::JobsHelper

Defined in:
app/helpers/ci/jobs_helper.rb

Instance Method Summary collapse

Instance Method Details

#job_statusesObject



21
22
23
24
25
# File 'app/helpers/ci/jobs_helper.rb', line 21

def job_statuses
  statuses = Ci::HasStatus::AVAILABLE_STATUSES

  statuses.index_with(&:upcase)
end

#jobs_data(project, build) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/helpers/ci/jobs_helper.rb', line 5

def jobs_data(project, build)
  {
    "endpoint" => project_job_path(project, build, format: :json),
    "project_path" => project.full_path,
    "artifact_help_url" => help_page_path('user/gitlab_com/index.md', anchor: 'gitlab-cicd'),
    "deployment_help_url" => help_page_path('user/project/clusters/deploy_to_cluster.md', anchor: 'troubleshooting'),
    "runner_settings_url" => project_runners_path(build.project, anchor: 'js-runners-settings'),
    "page_path" => project_job_path(project, build),
    "build_status" => build.status,
    "build_stage" => build.stage_name,
    "log_state" => '',
    "build_options" => javascript_build_options,
    "retry_outdated_job_docs_url" => help_page_path('ci/pipelines/settings', anchor: 'retry-outdated-jobs')
  }
end