Commit 0ed0ad5d authored by Alfredo Sumaran's avatar Alfredo Sumaran

Merge branch '23273-retry-build-btn' into 'master'

Resolve "Improve build "Retry" button on Build Page"

* On desktop, adds retry button on build page header
* On mobile, adds retry button in sidebar

![Screen_Shot_2016-10-28_at_1.35.07_PM](/uploads/2f9f87a9fc3e85c9aafc8c3d7a231639/Screen_Shot_2016-10-28_at_1.35.07_PM.png)
![Screen_Shot_2016-10-26_at_1.01.44_PM](/uploads/d02ce3a422a505b14ab357f695de8bba/Screen_Shot_2016-10-26_at_1.01.44_PM.png)

Closes #23273

See merge request !7126
parents e2e3f196 19b36862
...@@ -104,6 +104,7 @@ Please view this file on the master branch, on stable branches it's out of date. ...@@ -104,6 +104,7 @@ Please view this file on the master branch, on stable branches it's out of date.
- API: Fix project deploy keys 400 and 500 errors when adding an existing key. !6784 (Joshua Welsh) - API: Fix project deploy keys 400 and 500 errors when adding an existing key. !6784 (Joshua Welsh)
- Replace jquery.cookie plugin with js.cookie !7085 - Replace jquery.cookie plugin with js.cookie !7085
- Use MergeRequestsClosingIssues cache data on Issue#closed_by_merge_requests method - Use MergeRequestsClosingIssues cache data on Issue#closed_by_merge_requests method
- Add `Retry build` button in build page header on desktop
- Fix Sign in page 'Forgot your password?' link overlaps on medium-large screens - Fix Sign in page 'Forgot your password?' link overlaps on medium-large screens
- Show full status link on MR & commit pipelines - Show full status link on MR & commit pipelines
- Fix documents and comments on Build API `scope` - Fix documents and comments on Build API `scope`
......
...@@ -52,10 +52,25 @@ ...@@ -52,10 +52,25 @@
.build-header { .build-header {
position: relative; position: relative;
padding-right: 40px; padding: 0;
display: flex;
min-height: 58px;
align-items: center;
@media (min-width: $screen-sm-min) { .btn-inverted {
padding-right: 0; @include btn-outline($white-light, $blue-normal, $blue-normal, $blue-light, $white-light, $blue-light);
}
@media (max-width: $screen-sm-max) {
padding-right: 40px;
.btn-inverted {
display: none;
}
}
.header-content {
flex: 1;
} }
a { a {
...@@ -137,10 +152,15 @@ ...@@ -137,10 +152,15 @@
.retry-link { .retry-link {
color: $gl-link-color; color: $gl-link-color;
display: none;
&:hover { &:hover {
text-decoration: underline; text-decoration: underline;
} }
@media (max-width: $screen-sm-max) {
display: block;
}
} }
.stage-item { .stage-item {
......
.content-block.build-header .content-block.build-header
= ci_status_with_icon(@build.status) .header-content
Build = ci_status_with_icon(@build.status)
%strong ##{@build.id} Build
for commit %strong ##{@build.id}
= link_to ci_status_path(@build.pipeline) do for commit
%strong= @build.pipeline.short_sha = link_to ci_status_path(@build.pipeline) do
from %strong= @build.pipeline.short_sha
= link_to namespace_project_commits_path(@project.namespace, @project, @build.ref) do from
%code = link_to namespace_project_commits_path(@project.namespace, @project, @build.ref) do
= @build.ref %code
- if @build.user = @build.ref
= render "user" - if @build.user
= time_ago_with_tooltip(@build.created_at) = render "user"
= time_ago_with_tooltip(@build.created_at)
- if can?(current_user, :update_build, @build) && @build.retryable?
= link_to "Retry build", retry_namespace_project_build_path(@project.namespace, @project, @build), class: 'btn btn-inverted pull-right', method: :post
%button.btn.btn-default.pull-right.visible-xs-block.visible-sm-block.build-gutter-toggle.js-sidebar-build-toggle{ role: "button", type: "button" } %button.btn.btn-default.pull-right.visible-xs-block.visible-sm-block.build-gutter-toggle.js-sidebar-build-toggle{ role: "button", type: "button" }
= icon('angle-double-left') = icon('angle-double-left')
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
.title .title
Build details Build details
- if can?(current_user, :update_build, @build) && @build.retryable? - if can?(current_user, :update_build, @build) && @build.retryable?
= link_to "Retry", retry_namespace_project_build_path(@project.namespace, @project, @build), class: 'pull-right retry-link', method: :post = link_to "Retry build", retry_namespace_project_build_path(@project.namespace, @project, @build), class: 'pull-right retry-link', method: :post
- if @build.merge_request - if @build.merge_request
%p.build-detail-row %p.build-detail-row
%span.build-light-text Merge Request: %span.build-light-text Merge Request:
......
...@@ -216,7 +216,9 @@ describe "Builds" do ...@@ -216,7 +216,9 @@ describe "Builds" do
@build.run! @build.run!
visit namespace_project_build_path(@project.namespace, @project, @build) visit namespace_project_build_path(@project.namespace, @project, @build)
click_link 'Cancel' click_link 'Cancel'
click_link 'Retry' page.within('.build-header') do
click_link 'Retry build'
end
end end
it 'shows the right status and buttons' do it 'shows the right status and buttons' do
......
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