Skip to content
Snippets Groups Projects
Commit b64cf840 authored by Filipa Lacerda's avatar Filipa Lacerda
Browse files

Renders new icons for the pipeline graph

parent 94792273
No related branches found
No related tags found
No related merge requests found
Showing
with 25 additions and 46 deletions
Loading
Loading
@@ -25,54 +25,32 @@ module CiStatusHelper
status.humanize
end
 
def ci_icon_for_status(status, graph: nil)
def ci_icon_for_status(status)
if detailed_status?(status)
return custom_icon(status.icon)
end
 
if graph
icon_name =
case status
when 'success'
'icon_graph_job_success'
when 'success_with_warnings'
'icon_graph_job_warning'
when 'failed'
'icon_graph_job_failed'
when 'pending'
'icon_graph_job_pending'
when 'running'
'icon_graph_job_running'
when 'created'
'icon_graph_job_created'
when 'skipped'
'icon_graph_job_skipped'
else
'icon_graph_job_canceled'
end
else
icon_name =
case status
when 'success'
'icon_status_success'
when 'success_with_warnings'
'icon_status_warning'
when 'failed'
'icon_status_failed'
when 'pending'
'icon_status_pending'
when 'running'
'icon_status_running'
when 'play'
'icon_play'
when 'created'
'icon_status_created'
when 'skipped'
'icon_status_skipped'
else
'icon_status_canceled'
end
end
icon_name =
case status
when 'success'
'icon_status_success'
when 'success_with_warnings'
'icon_status_warning'
when 'failed'
'icon_status_failed'
when 'pending'
'icon_status_pending'
when 'running'
'icon_status_running'
when 'play'
'icon_play'
when 'created'
'icon_status_created'
when 'skipped'
'icon_status_skipped'
else
'icon_status_canceled'
end
 
custom_icon(icon_name)
end
Loading
Loading
- detailed_status = subject.detailed_status(current_user)
- details_path = detailed_status.details_path if detailed_status.has_details?
- klass = "ci-status-icon ci-status-icon-#{detailed_status}"
- status_icon = graph ? "#{detailed_status.icon}_graph" : detailed_status.icon
 
- if details_path
= link_to details_path, class: klass, data: { toggle: 'tooltip', title: "#{subject.name} - #{detailed_status}" } do
%span{ class: klass }= custom_icon(detailed_status.icon)
%span{ class: klass }= custom_icon(status_icon)
.ci-status-text= subject.name
- else
%span{ class: klass }= custom_icon(detailed_status.icon)
Loading
Loading
= render "ci/status/icon_with_name", subject: subject
= render "ci/status/icon_with_name", subject: subject, graph: true
 
- detailed_status = subject.detailed_status(current_user)
- if detailed_status.has_action?
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment