From d9abf9ca0bf822bc13f56657a51d78b8edfb5761 Mon Sep 17 00:00:00 2001 From: davidvader Date: Tue, 24 Oct 2023 16:49:49 -0500 Subject: [PATCH] fix: replace purgecss overrides --- src/elm/Pages/Build/Graph/View.elm | 72 ++++++++---------------------- src/scss/_graph.scss | 2 + 2 files changed, 20 insertions(+), 54 deletions(-) diff --git a/src/elm/Pages/Build/Graph/View.elm b/src/elm/Pages/Build/Graph/View.elm index ae27ea4a5..1bdecc35d 100644 --- a/src/elm/Pages/Build/Graph/View.elm +++ b/src/elm/Pages/Build/Graph/View.elm @@ -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 [] @@ -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" ] - [] - ] diff --git a/src/scss/_graph.scss b/src/scss/_graph.scss index 290ae41e3..1735aa9e3 100644 --- a/src/scss/_graph.scss +++ b/src/scss/_graph.scss @@ -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; @@ -288,3 +289,4 @@ } // end: classes controlled by d3 +/*! purgecss end ignore */ \ No newline at end of file