Skip to content

Commit

Permalink
fix: replace purgecss overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 committed Oct 24, 2023
1 parent 81d51e3 commit d9abf9c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 54 deletions.
72 changes: 18 additions & 54 deletions src/elm/Pages/Build/Graph/View.elm
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,11 @@ import Visualization.DOT
-- VIEW


{-| view : renders build graph using graphviz and d3
{-| view : renders the elm build graph root. the graph root is selected by d3 and filled with graphviz content.
-}
view : PartialModel a -> Msgs msg -> Org -> Repo -> BuildNumber -> Html msg
view model msgs org repo buildNumber =
let
container =
div
[ class "elm-build-graph-container"
]

legend =
ul [ class "elm-build-graph-legend" ]
[ li []
Expand Down Expand Up @@ -164,55 +159,24 @@ view model msgs org repo buildNumber =
]
]
in
[ actions
, div [ class "elm-build-graph-window" ]
[ legend
, case model.repo.build.graph.graph of
RemoteData.Success _ ->
-- dont render anything when the build graph draw command has been dispatched
text ""
div [ class "elm-build-graph-container" ]
[ actions
, div [ class "elm-build-graph-window" ]
[ legend
, case model.repo.build.graph.graph of
RemoteData.Success _ ->
-- dont render anything when the build graph draw command has been dispatched
text ""

RemoteData.Failure _ ->
-- todo: make this cuter
text "Error loading build graph... Please try again"
RemoteData.Failure _ ->
-- todo: make this cuter
text "Error loading build graph... Please try again"

_ ->
Util.largeLoader
, Svg.svg
[ Svg.Attributes.class "elm-build-graph-root"
_ ->
Util.largeLoader
, Svg.svg
[ Svg.Attributes.class "elm-build-graph-root"
]
[]
]
[]
]
]
-- these elements are purely to keep dynamic css classes from getting scrubbed
++ classIgnores
|> container



-- this is purely to appease the css purge gods


classIgnores : List (Html msg)
classIgnores =
[ span
[ style "display" "none"
, class "d3-build-graph-node-outline-rect"
, class "d3-build-graph-node-step-a"
, class "d3-build-graph-node-step-a-underline"
, class "d3-build-graph-step-connector"
, class "d3-build-graph-edge-path"
, class "elm-build-graph-legend-item"
, class "-pending"
, class "-running"
, class "-success"
, class "-failure"
, class "-killed"
, class "-canceled"
, class "-skipped"
, class "-hover"
, class "-focus"
, class "-filtered"
]
[]
]
2 changes: 2 additions & 0 deletions src/scss/_graph.scss
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
// end: classes controlled by Elm

// start: classes controlled by d3
/*! purgecss start ignore */
.d3-build-graph-node-outline-rect {
fill: none;
stroke-width: 1.8;
Expand Down Expand Up @@ -288,3 +289,4 @@
}

// end: classes controlled by d3
/*! purgecss end ignore */

0 comments on commit d9abf9c

Please sign in to comment.