Commit 262da888 authored by Robert Speicher's avatar Robert Speicher

Merge branch '239861-create-pipeline-css-page-bundle' into 'master'

Move pipeline specific CSS to a page bundle file

See merge request gitlab-org/gitlab!43954
parents ba0277c5 2a8007e6
@mixin flat-connector-before($length: 44px) {
&::before {
content: '';
position: absolute;
top: 48%;
left: -$length;
border-top: 2px solid $border-color;
width: $length;
height: 1px;
}
}
@mixin build-content($border-radius: 30px) {
display: inline-block;
padding: 8px 10px 9px;
width: 100%;
border: 1px solid $border-color;
border-radius: $border-radius;
background-color: $white;
&:hover {
background-color: $gray-darker;
border: 1px solid $dropdown-toggle-active-border-color;
color: $gl-text-color;
}
}
@import 'mixins_and_variables_and_functions';
@import './pipeline_mixins';
/**
* Pipeline Page Bundle
*
* Styles used to render a single pipeline page.
*
* Includes its tabs:
*
* - [data-page='projects:pipelines:show']
* - [data-page='projects:pipelines:dag']
* - [data-page='projects:pipelines:builds']
* - [data-page='projects:pipelines:failures']
* - [data-page='projects:pipelines:tests']
* - ...
*/
.tab-pane {
.ci-table {
thead th {
border-top: 0;
}
}
}
.build-failures {
.build-state {
padding: 20px 2px;
.build-name {
font-weight: $gl-font-weight-normal;
}
.stage {
color: $gl-text-color-secondary;
font-weight: $gl-font-weight-normal;
vertical-align: middle;
}
}
.build-log {
border: 0;
line-height: initial;
}
.build-trace-row td {
border-top: 0;
border-bottom-width: 1px;
border-bottom-style: solid;
padding-top: 0;
}
.build-trace {
width: 100%;
text-align: left;
margin-top: $gl-padding;
}
.build-name {
width: 196px;
a {
font-weight: $gl-font-weight-bold;
color: $gl-text-color;
text-decoration: none;
&:focus,
&:hover {
text-decoration: underline;
}
}
}
.build-actions {
width: 70px;
text-align: right;
}
.build-stage {
width: 140px;
}
.ci-status-icon-failed {
padding: 10px 0 10px 12px;
width: 12px + 24px; // padding-left + svg width
}
.build-icon svg {
width: 24px;
height: 24px;
vertical-align: middle;
}
.build-state,
.build-trace-row {
> td:last-child {
padding-right: 0;
}
}
@include media-breakpoint-down(sm) {
td:empty {
display: none;
}
.ci-table {
margin-top: 2 * $gl-padding;
}
.build-trace-container {
padding-top: $gl-padding;
padding-bottom: $gl-padding;
}
.build-trace {
margin-bottom: 0;
margin-top: 0;
}
}
}
.pipeline-tab-content {
display: flex;
width: 100%;
min-height: $dropdown-max-height-lg;
background-color: $gray-light;
padding: $gl-padding 0;
overflow: auto;
}
// Pipeline graph, used at
// app/assets/javascripts/pipelines/components/graph/graph_component.vue
.pipeline-graph {
white-space: nowrap;
transition: max-height 0.3s, padding 0.3s;
.stage-column-list,
.builds-container > ul {
padding: 0;
}
a {
text-decoration: none;
color: $gl-text-color;
}
svg {
vertical-align: middle;
}
.stage-column {
display: inline-block;
vertical-align: top;
&.left-margin {
&:not(:first-child) {
margin-left: 44px;
.left-connector {
@include flat-connector-before;
}
}
}
&.no-margin {
margin: 0;
}
li {
list-style: none;
}
// when downstream pipelines are present, the last stage isn't the last column
&:last-child:not(.has-downstream) {
.build {
// Remove right connecting horizontal line from first build in last stage
&:first-child::after {
border: 0;
}
// Remove right curved connectors from all builds in last stage
&:not(:first-child)::after {
border: 0;
}
// Remove opposite curve
.curve::before {
display: none;
}
}
}
// when upstream pipelines are present, the first stage isn't the first column
&:first-child:not(.has-upstream) {
.build {
// Remove left curved connectors from all builds in first stage
&:not(:first-child)::before {
border: 0;
}
// Remove opposite curve
.curve::after {
display: none;
}
}
}
// Curve first child connecting lines in opposite direction
.curve {
display: none;
&::before,
&::after {
content: '';
width: 21px;
height: 25px;
position: absolute;
top: -31px;
border-top: 2px solid $border-color;
}
&::after {
left: -44px;
border-right: 2px solid $border-color;
border-radius: 0 20px;
}
&::before {
right: -44px;
border-left: 2px solid $border-color;
border-radius: 20px 0 0;
}
}
}
.stage-name {
margin: 0 0 15px 10px;
font-weight: $gl-font-weight-bold;
width: 176px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: 2.2em;
}
.build {
position: relative;
width: 186px;
margin-bottom: 10px;
white-space: normal;
.ci-job-dropdown-container {
// override dropdown.scss
.dropdown-menu li button {
padding: 0;
text-align: center;
}
}
// ensure .build-content has hover style when action-icon is hovered
.ci-job-dropdown-container:hover .build-content {
@extend .build-content:hover;
}
.ci-status-icon svg {
height: 24px;
width: 24px;
}
.dropdown-menu-toggle {
background-color: transparent;
border: 0;
padding: 0;
&:focus {
outline: none;
}
}
.build-content {
@include build-content();
}
a.build-content:hover,
button.build-content:hover {
background-color: $gray-darker;
border: 1px solid $dropdown-toggle-active-border-color;
}
// Connect first build in each stage with right horizontal line
&:first-child {
&::after {
content: '';
position: absolute;
top: 48%;
right: -48px;
border-top: 2px solid $border-color;
width: 48px;
height: 1px;
}
}
// Connect each build (except for first) with curved lines
&:not(:first-child) {
&::after,
&::before {
content: '';
top: -49px;
position: absolute;
border-bottom: 2px solid $border-color;
width: 25px;
height: 69px;
}
// Right connecting curves
&::after {
right: -25px;
border-right: 2px solid $border-color;
border-radius: 0 0 20px;
}
// Left connecting curves
&::before {
left: -25px;
border-left: 2px solid $border-color;
border-radius: 0 0 0 20px;
}
}
// Connect second build to first build with smaller curved line
&:nth-child(2) {
&::after,
&::before {
height: 29px;
top: -9px;
}
.curve {
display: block;
}
}
}
.ci-action-icon-container {
position: absolute;
right: 5px;
top: 50%;
transform: translateY(-50%);
// Action Icons in big pipeline-graph nodes
&.ci-action-icon-wrapper {
height: 30px;
width: 30px;
border-radius: 100%;
display: block;
padding: 0;
line-height: 0;
svg {
fill: $gl-text-color-secondary;
}
.spinner {
top: 2px;
}
&.play {
svg {
left: 1px;
top: 1px;
}
}
}
}
.stage-action svg {
left: 1px;
top: -2px;
}
}
// Triggers the dropdown in the big pipeline graph
.dropdown-counter-badge {
font-weight: 100;
font-size: 15px;
position: absolute;
right: 13px;
top: 8px;
}
@mixin flat-connector-before($length: 44px) {
&::before {
content: '';
position: absolute;
top: 48%;
left: -$length;
border-top: 2px solid $border-color;
width: $length;
height: 1px;
}
}
@mixin build-content($border-radius: 30px) {
display: inline-block;
padding: 8px 10px 9px;
width: 100%;
border: 1px solid $border-color;
border-radius: $border-radius;
background-color: $white;
&:hover {
background-color: $gray-darker;
border: 1px solid $dropdown-toggle-active-border-color;
color: $gl-text-color;
}
}
.pipelines {
.stage {
max-width: 90px;
......@@ -278,378 +251,6 @@
border-bottom: 0;
}
[data-page='projects:pipelines:show'] {
.tab-pane {
.ci-table {
thead th {
border-top: 0;
}
}
}
.build-failures {
.build-state {
padding: 20px 2px;
.build-name {
font-weight: $gl-font-weight-normal;
}
.stage {
color: $gl-text-color-secondary;
font-weight: $gl-font-weight-normal;
vertical-align: middle;
}
}
.build-log {
border: 0;
line-height: initial;
}
.build-trace-row td {
border-top: 0;
border-bottom-width: 1px;
border-bottom-style: solid;
padding-top: 0;
}
.build-trace {
width: 100%;
text-align: left;
margin-top: $gl-padding;
}
.build-name {
width: 196px;
a {
font-weight: $gl-font-weight-bold;
color: $gl-text-color;
text-decoration: none;
&:focus,
&:hover {
text-decoration: underline;
}
}
}
.build-actions {
width: 70px;
text-align: right;
}
.build-stage {
width: 140px;
}
.ci-status-icon-failed {
padding: 10px 0 10px 12px;
width: 12px + 24px; // padding-left + svg width
}
.build-icon svg {
width: 24px;
height: 24px;
vertical-align: middle;
}
.build-state,
.build-trace-row {
> td:last-child {
padding-right: 0;
}
}
@include media-breakpoint-down(sm) {
td:empty {
display: none;
}
.ci-table {
margin-top: 2 * $gl-padding;
}
.build-trace-container {
padding-top: $gl-padding;
padding-bottom: $gl-padding;
}
.build-trace {
margin-bottom: 0;
margin-top: 0;
}
}
}
.pipeline-tab-content {
display: flex;
width: 100%;
min-height: $dropdown-max-height-lg;
background-color: $gray-light;
padding: $gl-padding 0;
overflow: auto;
}
// Pipeline graph, used at
// app/assets/javascripts/pipelines/components/graph/graph_component.vue
.pipeline-graph {
white-space: nowrap;
transition: max-height 0.3s, padding 0.3s;
.stage-column-list,
.builds-container > ul {
padding: 0;
}
a {
text-decoration: none;
color: $gl-text-color;
}
svg {
vertical-align: middle;
}
.stage-column {
display: inline-block;
vertical-align: top;
&.left-margin {
&:not(:first-child) {
margin-left: 44px;
.left-connector {
@include flat-connector-before;
}
}
}
&.no-margin {
margin: 0;
}
li {
list-style: none;
}
// when downstream pipelines are present, the last stage isn't the last column
&:last-child:not(.has-downstream) {
.build {
// Remove right connecting horizontal line from first build in last stage
&:first-child::after {
border: 0;
}
// Remove right curved connectors from all builds in last stage
&:not(:first-child)::after {
border: 0;
}
// Remove opposite curve
.curve::before {
display: none;
}
}
}
// when upstream pipelines are present, the first stage isn't the first column
&:first-child:not(.has-upstream) {
.build {
// Remove left curved connectors from all builds in first stage
&:not(:first-child)::before {
border: 0;
}
// Remove opposite curve
.curve::after {
display: none;
}
}
}
// Curve first child connecting lines in opposite direction
.curve {
display: none;
&::before,
&::after {
content: '';
width: 21px;
height: 25px;
position: absolute;
top: -31px;
border-top: 2px solid $border-color;
}
&::after {
left: -44px;
border-right: 2px solid $border-color;
border-radius: 0 20px;
}
&::before {
right: -44px;
border-left: 2px solid $border-color;
border-radius: 20px 0 0;
}
}
}
.stage-name {
margin: 0 0 15px 10px;
font-weight: $gl-font-weight-bold;
width: 176px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: 2.2em;
}
.build {
position: relative;
width: 186px;
margin-bottom: 10px;
white-space: normal;
.ci-job-dropdown-container {
// override dropdown.scss
.dropdown-menu li button {
padding: 0;
text-align: center;
}
}
// ensure .build-content has hover style when action-icon is hovered
.ci-job-dropdown-container:hover .build-content {
@extend .build-content:hover;
}
.ci-status-icon svg {
height: 24px;
width: 24px;
}
.dropdown-menu-toggle {
background-color: transparent;
border: 0;
padding: 0;
&:focus {
outline: none;
}
}
.build-content {
@include build-content();
}
a.build-content:hover,
button.build-content:hover {
background-color: $gray-darker;
border: 1px solid $dropdown-toggle-active-border-color;
}
// Connect first build in each stage with right horizontal line
&:first-child {
&::after {
content: '';
position: absolute;
top: 48%;
right: -48px;
border-top: 2px solid $border-color;
width: 48px;
height: 1px;
}
}
// Connect each build (except for first) with curved lines
&:not(:first-child) {
&::after,
&::before {
content: '';
top: -49px;
position: absolute;
border-bottom: 2px solid $border-color;
width: 25px;
height: 69px;
}
// Right connecting curves
&::after {
right: -25px;
border-right: 2px solid $border-color;
border-radius: 0 0 20px;
}
// Left connecting curves
&::before {
left: -25px;
border-left: 2px solid $border-color;
border-radius: 0 0 0 20px;
}
}
// Connect second build to first build with smaller curved line
&:nth-child(2) {
&::after,
&::before {
height: 29px;
top: -9px;
}
.curve {
display: block;
}
}
}
.ci-action-icon-container {
position: absolute;
right: 5px;
top: 50%;
transform: translateY(-50%);
// Action Icons in big pipeline-graph nodes
&.ci-action-icon-wrapper {
height: 30px;
width: 30px;
border-radius: 100%;
display: block;
padding: 0;
line-height: 0;
svg {
fill: $gl-text-color-secondary;
}
.spinner {
top: 2px;
}
&.play {
svg {
left: 1px;
top: 1px;
}
}
}
}
.stage-action svg {
left: 1px;
top: -2px;
}
}
// Triggers the dropdown in the big pipeline graph
.dropdown-counter-badge {
font-weight: 100;
font-size: 15px;
position: absolute;
right: 13px;
top: 8px;
}
}
.ci-build-text,
.ci-status-text {
font-weight: 200;
......
......@@ -2,6 +2,7 @@
- breadcrumb_title "##{@pipeline.id}"
- page_title _('Pipeline')
- pipeline_has_errors = @pipeline.builds.empty? && @pipeline.yaml_errors.present?
- add_page_specific_style 'page_bundles/pipeline'
.js-pipeline-container{ data: { controller_action: "#{controller.action_name}" } }
#js-pipeline-header-vue.pipeline-header-container{ data: {full_path: @project.full_path, retry_path: retry_project_pipeline_path(@pipeline.project, @pipeline), cancel_path: cancel_project_pipeline_path(@pipeline.project, @pipeline), delete_path: project_pipeline_path(@pipeline.project, @pipeline), pipeline_iid: @pipeline.iid, pipeline_id: @pipeline.id} }
......
......@@ -192,6 +192,7 @@ module Gitlab
config.assets.precompile << "page_bundles/issues_list.css"
config.assets.precompile << "page_bundles/jira_connect.css"
config.assets.precompile << "page_bundles/milestone.css"
config.assets.precompile << "page_bundles/pipeline.css"
config.assets.precompile << "page_bundles/todos.css"
config.assets.precompile << "page_bundles/xterm.css"
config.assets.precompile << "lazy_bundles/cropper.css"
......
@import './page_bundles/pipeline_mixins';
.linked-pipeline-mini-list {
&.is-downstream {
margin-left: -4px;
......
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