Commit b64cf840 authored by Filipa Lacerda's avatar Filipa Lacerda

Renders new icons for the pipeline graph

parent 94792273
...@@ -25,54 +25,32 @@ module CiStatusHelper ...@@ -25,54 +25,32 @@ module CiStatusHelper
status.humanize status.humanize
end end
def ci_icon_for_status(status, graph: nil) def ci_icon_for_status(status)
if detailed_status?(status) if detailed_status?(status)
return custom_icon(status.icon) return custom_icon(status.icon)
end end
if graph icon_name =
icon_name = case status
case status when 'success'
when 'success' 'icon_status_success'
'icon_graph_job_success' when 'success_with_warnings'
when 'success_with_warnings' 'icon_status_warning'
'icon_graph_job_warning' when 'failed'
when 'failed' 'icon_status_failed'
'icon_graph_job_failed' when 'pending'
when 'pending' 'icon_status_pending'
'icon_graph_job_pending' when 'running'
when 'running' 'icon_status_running'
'icon_graph_job_running' when 'play'
when 'created' 'icon_play'
'icon_graph_job_created' when 'created'
when 'skipped' 'icon_status_created'
'icon_graph_job_skipped' when 'skipped'
else 'icon_status_skipped'
'icon_graph_job_canceled' else
end 'icon_status_canceled'
else 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
end
custom_icon(icon_name) custom_icon(icon_name)
end end
......
- detailed_status = subject.detailed_status(current_user) - detailed_status = subject.detailed_status(current_user)
- details_path = detailed_status.details_path if detailed_status.has_details? - details_path = detailed_status.details_path if detailed_status.has_details?
- klass = "ci-status-icon ci-status-icon-#{detailed_status}" - klass = "ci-status-icon ci-status-icon-#{detailed_status}"
- status_icon = graph ? "#{detailed_status.icon}_graph" : detailed_status.icon
- if details_path - if details_path
= link_to details_path, class: klass, data: { toggle: 'tooltip', title: "#{subject.name} - #{detailed_status}" } do = 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 .ci-status-text= subject.name
- else - else
%span{ class: klass }= custom_icon(detailed_status.icon) %span{ class: klass }= custom_icon(detailed_status.icon)
......
= 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) - detailed_status = subject.detailed_status(current_user)
- if detailed_status.has_action? - if detailed_status.has_action?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment