Module: CoreJobStateHelper

Defined in:
app/helpers/core_job_state_helper.rb

Overview

Helpful methods job states

Constant Summary collapse

JOB_STATE_COLORS =
{
  CommandJob::STATE_NEW => 'primary',
  CommandJob::STATE_WIP => 'secondary',
  CommandJob::STATE_RETRYING => 'warning',
  CommandJob::STATE_SUCCESS => 'success',
  CommandJob::STATE_FAIL => 'danger',
  CommandJob::STATE_CANCELLED => 'dark'
}.freeze

Instance Method Summary collapse

Instance Method Details

#job_state_badge(state) ⇒ Object



17
18
19
20
# File 'app/helpers/core_job_state_helper.rb', line 17

def job_state_badge(state)
  color = JOB_STATE_COLORS[state] || 'info'
  (:span, state.humanize, class: "badge rounded-pill bg-label-#{color}")
end