Commit b64cf840 authored by Filipa Lacerda's avatar Filipa Lacerda

Renders new icons for the pipeline graph

parent 94792273
...@@ -25,32 +25,11 @@ module CiStatusHelper ...@@ -25,32 +25,11 @@ 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 =
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 = icon_name =
case status case status
when 'success' when 'success'
...@@ -72,7 +51,6 @@ module CiStatusHelper ...@@ -72,7 +51,6 @@ module CiStatusHelper
else else
'icon_status_canceled' 'icon_status_canceled'
end 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