Commit 1e8271b6 authored by Filipa Lacerda's avatar Filipa Lacerda

Adds new partial for graph icons.

Fix tests
parent 78757a0d
- 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}"
- graph_status_icon = "#{detailed_status.icon}_graph"
- if details_path
= link_to details_path, class: klass, data: { toggle: 'tooltip', title: "#{subject.name} - #{detailed_status}" } do
%span{ class: klass }= custom_icon(graph_status_icon)
.ci-status-text= subject.name
- else
%span{ class: klass }= custom_icon(graph_status_icon)
.ci-status-text= subject.name
= render "ci/status/graph_icon_with_name", subject: subject
- detailed_status = subject.detailed_status(current_user)
- if detailed_status.has_action?
= link_to detailed_status.action_path, method: detailed_status.action_method,
title: "#{subject.name}: #{detailed_status.action_title}", class: 'ci-action-icon-container' do
%i.ci-action-icon-wrapper
= icon(detailed_status.action_icon, class: detailed_status.action_class)
- 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(status_icon)
%span{ class: klass }= custom_icon(detailed_status.icon)
.ci-status-text= subject.name
- else
%span{ class: klass }= custom_icon(detailed_status.icon)
......
= render "ci/status/icon_with_name", subject: subject, graph: true
= render "ci/status/icon_with_name", subject: subject
- detailed_status = subject.detailed_status(current_user)
- if detailed_status.has_action?
......
......@@ -14,7 +14,7 @@
%li.build{ class: ("playable" if is_playable) }
.curve
.build-content
= render 'ci/status/icon_with_name_and_action', subject: status
= render 'ci/status/graph_icon_with_name_and_action', subject: status
- else
%li.build
.curve
......
......@@ -10,4 +10,4 @@
%ul
- subject.each do |status|
%li.dropdown-build
= render 'ci/status/icon_with_name_and_action', subject: status
= render 'ci/status/graph_icon_with_name_and_action', subject: status
......@@ -40,7 +40,7 @@ describe "Pipelines", feature: true, js: true do
context 'pipeline graph' do
it 'shows a running icon and a cancel action for the running build' do
page.within('.stage-column:first-child .build:first-child') do
page.within('.stage-column:nth-child(2) .build:first-child') do
expect(page).to have_selector('.ci-status-icon-running')
expect(page).to have_content('deploy')
expect(page).to have_selector('.ci-action-icon-container .fa-ban')
......@@ -56,7 +56,7 @@ describe "Pipelines", feature: true, js: true do
end
it 'shows the failed icon and a retry action for the failed build' do
page.within('.stage-column:nth-child(2) .build') do
page.within('.stage-column:first-child .build') do
expect(page).to have_selector('.ci-status-icon-failed')
expect(page).to have_content('test')
expect(page).to have_selector('.ci-action-icon-container .fa-refresh')
......@@ -64,7 +64,7 @@ describe "Pipelines", feature: true, js: true do
end
it 'shows the skipped icon and a play action for the manual build' do
page.within('.stage-column:first-child .build:nth-child(2)') do
page.within('.stage-column:nth-child(2) .build:nth-child(2)') do
expect(page).to have_selector('.ci-status-icon-skipped')
expect(page).to have_content('manual')
expect(page).to have_selector('.ci-action-icon-container .ci-play-icon')
......
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