Skip to content

Commit

Permalink
feat: canceled and error styles
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 committed Nov 2, 2023
1 parent ab772b6 commit 2a4086f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/elm/Pages/Build/Graph/View.elm
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ view model msgs org repo buildNumber =
[ buildVizLegendNode [ Svg.Attributes.class "-failure" ]
, text "- failed"
]
, li []
[ buildVizLegendNode [ Svg.Attributes.class "-canceled" ]
, text "- canceled"
]
, li []
[ buildVizLegendNode [ Svg.Attributes.class "-killed" ]
, text "- skipped"
Expand Down
22 changes: 18 additions & 4 deletions src/scss/_graph.scss
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@
stroke-dasharray: 3 3;
}

.-canceled {
stroke: var(--color-cyan-dark);
stroke-dasharray: 3 3;
}

.-killed,
.-skipped {
stroke: var(--color-lavender);
Expand Down Expand Up @@ -227,14 +232,19 @@
stroke: var(--color-green);
}

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

stroke: var(--color-red);
}

&.-canceled {
stroke-dasharray: 4 3;

stroke: var(--color-cyan-dark);
}

&.-killed,
&.-skipped {
stroke-dasharray: 5;
Expand Down Expand Up @@ -275,7 +285,7 @@
}

&.-canceled {
fill: var(--color-red);
fill: var(--color-cyan-dark);
}

&.-killed,
Expand Down Expand Up @@ -310,7 +320,7 @@
}

&.-canceled {
fill: var(--color-red);
fill: var(--color-cyan-dark);
}

&.-killed,
Expand All @@ -320,6 +330,7 @@

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

Expand Down Expand Up @@ -416,12 +427,15 @@
stroke: var(--color-green);
}

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

&.-canceled {
stroke: var(--color-cyan-dark);
}

&.-killed,
&.-skipped {
stroke: var(--color-lavender);
Expand Down
5 changes: 3 additions & 2 deletions src/static/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ function drawNodes(opts, buildGraphElement, nodeSelector, edges) {
}

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

if (step.status === 'killed') {
Expand Down Expand Up @@ -326,7 +326,8 @@ function drawNodes(opts, buildGraphElement, nodeSelector, edges) {
}

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

// apply step connector to every step after the first
Expand Down

0 comments on commit 2a4086f

Please sign in to comment.