Commit c8b2aa8d authored by Grzegorz Bizon's avatar Grzegorz Bizon

Simplify ci status helper with detailed status

parent 40a11807
......@@ -36,30 +36,30 @@ module CiStatusHelper
end
def ci_icon_for_status(status)
if detailed_status?(status)
return custom_icon(status.icon)
end
icon_name =
if detailed_status?(status)
status.icon
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
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
'icon_status_canceled'
end
custom_icon(icon_name)
......
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