Skip to content

Commit

Permalink
fix: account for all statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 committed Nov 1, 2023
1 parent d109018 commit 2444e03
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 15 deletions.
30 changes: 21 additions & 9 deletions src/scss/_graph.scss
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,18 @@
stroke-dasharray: 3 3;
}

.-selected {
stroke: var(--color-primary);
stroke-width: 5;
}

.-killed,
.-skipped {
stroke: var(--color-lavender);
stroke-dasharray: 2, 4;
stroke-linecap: round;
}

.-selected {
stroke: var(--color-primary);
stroke-width: 5;
}

rect {
stroke-width: 2;
}
Expand Down Expand Up @@ -228,7 +228,8 @@
}

&.-canceled,
&.-failure {
&.-failure,
&.-error {
stroke-dasharray: 4 3;

stroke: var(--color-red);
Expand Down Expand Up @@ -281,6 +282,10 @@
&.-skipped {
fill: var(--color-lavender);
}

&.-error {
fill: var(--color-red);
}
}

// icon content
Expand Down Expand Up @@ -312,6 +317,10 @@
&.-skipped {
fill: var(--color-coal-dark);
}

&.-error {
fill: var(--color-red);
}
}

.d3-build-graph-node-step-a {
Expand Down Expand Up @@ -358,7 +367,8 @@
&.-failure,
&.-canceled,
&.-killed,
&.-skipped {
&.-skipped,
&.-error {
stroke-width: 1;

stroke: var(--color-gray);
Expand Down Expand Up @@ -407,7 +417,8 @@
}

&.-canceled,
&.-failure {
&.-failure,
&.-error {
stroke: var(--color-red);
}

Expand All @@ -431,7 +442,8 @@
&.-failure,
&.-canceled,
&.-killed,
&.-skipped {
&.-skipped,
&.-error {
stroke: var(--color-coal-light);
}

Expand Down
22 changes: 16 additions & 6 deletions src/static/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,20 @@ function drawNodes(opts, buildGraphElement, nodeSelector, edges) {
stepIcon.append('path').attr('d', 'M8 8l12 12M20 8L8 20');
}

if (step.status === 'failure') {
stepIcon.append('path').attr('d', 'M8 8l12 12M20 8L8 20');
if (step.status === 'killed') {
stepIcon
.append('circle')
.attr('cx', '9')
.attr('cy', '14')
.attr('r', '2');
stepIcon
.append('circle')
.attr('cx', '19')
.attr('cy', '14')
.attr('r', '2');
}

if (step.status === 'killed') {
if (step.status === 'skipped') {
stepIcon
.append('circle')
.attr('cx', '9')
Expand All @@ -312,6 +321,10 @@ function drawNodes(opts, buildGraphElement, nodeSelector, edges) {
.attr('r', '2');
}

if (step.status === 'error') {
stepIcon.append('path').attr('d', 'M8 8l12 12M20 8L8 20');
}

// apply step connector to every step after the first
if (i > 0) {
const connectorPadding = { x: 5.5, y: -6 };
Expand Down Expand Up @@ -482,9 +495,6 @@ function getStepDataFromTitle(element) {
name: title[1],
status: title[2],
};
if (data.status === 'canceled' || data.status === 'skipped') {
data.status = 'failure';
}
}

return data;
Expand Down

0 comments on commit 2444e03

Please sign in to comment.