Skip to content

Commit

Permalink
feat: improve build summary (#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
JayCeeJr authored Oct 2, 2021
1 parent d6a18ff commit 1d1d63d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/elm/Pages/Build/History.elm
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,31 @@ recentBuildTooltip now timezone build =
[ span [ class "number" ] [ text <| String.fromInt build.number ]
, em [] [ text build.event ]
]
, buildInfo build
, viewTooltipField "started:" <| Util.humanReadableWithDefault timezone build.started
, viewTooltipField "finished:" <| Util.humanReadableWithDefault timezone build.finished
, viewTooltipField "duration:" <| Util.formatRunTime now build.started build.finished
, viewTooltipField "worker:" build.host
, viewTooltipField "author:" build.author
, viewTooltipField "commit:" <| Util.trimCommitHash build.commit
, viewTooltipField "branch:" build.branch
]
]


buildInfo : Build -> Html msg
buildInfo build =
case build.event of
"pull_request" ->
viewTooltipField "PR" ("#" ++ Util.getNameFromRef build.ref ++ " " ++ build.message)

"tag" ->
viewTooltipField "Tag" (Util.getNameFromRef build.ref)

_ ->
viewTooltipField "" ""


{-| viewTooltipField : takes build field key and value, renders field in the tooltip
-}
viewTooltipField : String -> String -> Html msg
Expand Down

0 comments on commit 1d1d63d

Please sign in to comment.