Commit 49e24165 authored by Sarah Groff Hennigh-Palermo's avatar Sarah Groff Hennigh-Palermo

Merge branch 'fc-fix-stage-background-for-1-stage-graph' into 'master'

Fix CI config graph with only one stage

See merge request gitlab-org/gitlab!45286
parents 4e69d621 cd3062a1
...@@ -97,6 +97,19 @@ export default { ...@@ -97,6 +97,19 @@ export default {
this.reportFailure(DRAW_FAILURE); this.reportFailure(DRAW_FAILURE);
} }
}, },
getStageBackgroundClass(index) {
const { length } = this.pipelineData.stages;
if (length === 1) {
return 'stage-rounded';
} else if (index === 0) {
return 'stage-left-rounded';
} else if (index === length - 1) {
return 'stage-right-rounded';
}
return '';
},
highlightNeeds(uniqueJobId) { highlightNeeds(uniqueJobId) {
// The first time we hover, we create the object where // The first time we hover, we create the object where
// we store all the data to properly highlight the needs. // we store all the data to properly highlight the needs.
...@@ -177,10 +190,7 @@ export default { ...@@ -177,10 +190,7 @@ export default {
> >
<div <div
class="gl-display-flex gl-align-items-center gl-bg-white gl-w-full gl-px-8 gl-py-4 gl-mb-5" class="gl-display-flex gl-align-items-center gl-bg-white gl-w-full gl-px-8 gl-py-4 gl-mb-5"
:class="{ :class="getStageBackgroundClass(index)"
'stage-left-rounded': index === 0,
'stage-right-rounded': index === pipelineData.stages.length - 1,
}"
> >
<stage-pill :stage-name="stage.name" :is-empty="stage.groups.length === 0" /> <stage-pill :stage-name="stage.name" :is-empty="stage.groups.length === 0" />
</div> </div>
......
...@@ -130,6 +130,10 @@ ...@@ -130,6 +130,10 @@
width: 8rem; width: 8rem;
} }
.stage-rounded {
border-radius: 2rem;
}
.stage-left-rounded { .stage-left-rounded {
border-radius: 2rem 0 0 2rem; border-radius: 2rem 0 0 2rem;
} }
......
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