summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-08-17 11:36:43 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-08-17 11:36:43 +0100
commitae5ec7918a7d6c13f0b4a6b1fd5a168646b39327 (patch)
tree5de28498eb1f3ded875368b91d3035700eb558c6
parent1cd9b3b8a0b1024d043b9344869aceeadb9c84f1 (diff)
parentb631985ad7a8a85d1350425e6d1cf1cb90c93b5f (diff)
downloadgitlab-ce-ae5ec7918a7d6c13f0b4a6b1fd5a168646b39327.tar.gz
Merge branch '18141-pipeline-graph' of gitlab.com:gitlab-org/gitlab-ce into 18141-pipeline-graph
# Conflicts: # app/assets/stylesheets/pages/pipelines.scss # app/views/projects/commit/_pipeline.html.haml
-rw-r--r--app/assets/javascripts/pipeline.js.es610
-rw-r--r--app/assets/stylesheets/pages/pipelines.scss47
-rw-r--r--app/views/projects/commit/_pipeline.html.haml41
3 files changed, 75 insertions, 23 deletions
diff --git a/app/assets/javascripts/pipeline.js.es6 b/app/assets/javascripts/pipeline.js.es6
new file mode 100644
index 00000000000..7054199ac89
--- /dev/null
+++ b/app/assets/javascripts/pipeline.js.es6
@@ -0,0 +1,10 @@
+function toggleGraph() {
+ $('.pipeline-graph, .toggle-pipeline-btn').toggleClass('graph-collapsed');
+
+ const $btnText = $('.toggle-pipeline-btn .btn-text');
+ const graphCollapsed = $('.pipeline-graph').hasClass('graph-collapsed');
+
+ graphCollapsed ? $btnText.text('Expand') : $btnText.text('Hide')
+}
+
+$(document).on('click', '.toggle-pipeline-btn', toggleGraph);
diff --git a/app/assets/stylesheets/pages/pipelines.scss b/app/assets/stylesheets/pages/pipelines.scss
index ad256e2a728..ce9e3e95d3d 100644
--- a/app/assets/stylesheets/pages/pipelines.scss
+++ b/app/assets/stylesheets/pages/pipelines.scss
@@ -232,10 +232,35 @@
// Pipeline visualization
+.toggle-pipeline-btn {
+ background-color: $gray-dark;
+
+ .caret {
+ border-top: none;
+ border-bottom: 4px solid;
+ }
+
+ &.graph-collapsed {
+ background-color: $white-light;
+
+ .caret {
+ border-bottom: none;
+ border-top: 4px solid;
+ }
+ }
+}
+
.pipeline-graph {
width: 100%;
overflow: auto;
white-space: nowrap;
+ max-height: 500px;
+ transition: max-height 0.3s, padding 0.3s;
+
+ &.graph-collapsed {
+ max-height: 0;
+ padding: 0 16px;
+ }
}
.pipeline-visualization {
@@ -278,6 +303,10 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
+
+ a {
+ color: $layout-link-gray;
+ }
}
svg {
@@ -315,7 +344,6 @@
right: -20px;
border-right: 2px solid $border-color;
border-radius: 0 0 50px;
- -webkit-border-radius: 0 0 50px;
}
// Left connecting curves
@@ -323,7 +351,6 @@
left: -20px;
border-left: 2px solid $border-color;
border-radius: 0 0 0 50px;
- -webkit-border-radius: 0 0 0 50px;
}
}
@@ -333,11 +360,6 @@
height: 45px;
top: -26px;
}
- &::after {
- // border-left: 2px solid $border-color;
- border-top-right-radius: -50px;
- -webkit-border-top-right-radius: -50px;
- }
}
}
@@ -369,3 +391,14 @@
}
}
}
+
+.pipeline-actions {
+ border-bottom: none;
+}
+
+.toggle-pipeline-btn {
+
+ .fa {
+ color: $dropdown-header-color;
+ }
+}
diff --git a/app/views/projects/commit/_pipeline.html.haml b/app/views/projects/commit/_pipeline.html.haml
index 7a7f61e9705..44250860020 100644
--- a/app/views/projects/commit/_pipeline.html.haml
+++ b/app/views/projects/commit/_pipeline.html.haml
@@ -1,20 +1,9 @@
-.row-content-block.build-content.middle-block.pipeline-graph
- .pipeline-visualization
- %ul.stage-column-list
- - stages = pipeline.stages_with_latest_statuses
- - stages.each do |stage, statuses|
- %li.stage-column
- .stage-name
- %a{name: stage}
- - if stage
- = stage.titleize
- .builds-container
- %ul
- - statuses.each do |status|
- = render "projects/#{status.to_partial_path}_pipeline", subject: status
-
-.row-content-block.build-content.middle-block.pipeline-graph
+.row-content-block.build-content.middle-block.pipeline-actions
.pull-right
+ .btn.btn-grouped.btn-white.toggle-pipeline-btn
+ %span.btn-text Hide
+ %span pipeline graph
+ %span.caret
- if can?(current_user, :update_pipeline, pipeline.project)
- if pipeline.builds.latest.failed.any?(&:retryable?)
= link_to "Retry failed", retry_namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id), class: 'btn btn-grouped btn-primary', method: :post
@@ -38,6 +27,26 @@
in
= time_interval_in_words pipeline.duration
+.row-content-block.build-content.middle-block.pipeline-graph
+ .pipeline-visualization
+ %ul.stage-column-list
+ - pipeline.statuses.stages.each do |stage|
+ - statuses = pipeline.statuses.where(stage: stage)
+ - status = statuses.latest.status
+ %li.stage-column
+ .stage-name
+ %a{name: stage}
+ - if stage
+ = stage.titleize
+ .builds-container
+ %ul
+ - statuses.each do |build|
+ %li.build
+ .build-content
+ %span{class: "ci-status-link ci-status-icon-#{status}"}
+ = ci_icon_for_status(status)
+ = link_to build.name, namespace_project_build_url(build.project.namespace, build.project, build)
+
- if pipeline.yaml_errors.present?
.bs-callout.bs-callout-danger
%h4 Found errors in your .gitlab-ci.yml: