Parse app status score as int
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
1df298fa25
commit
33ddb9e390
|
@ -33,7 +33,7 @@ type alias App =
|
|||
, repository : Maybe String
|
||||
, versions : Maybe (List String)
|
||||
, icon : Maybe String
|
||||
, status : String
|
||||
, status : Int
|
||||
, slug : String
|
||||
, website : Maybe String
|
||||
}
|
||||
|
@ -102,13 +102,13 @@ body model =
|
|||
appScore : App -> Int
|
||||
appScore app =
|
||||
case app.status of
|
||||
"1" ->
|
||||
1 ->
|
||||
1
|
||||
"2" ->
|
||||
2 ->
|
||||
2
|
||||
"3" ->
|
||||
3 ->
|
||||
3
|
||||
"4" ->
|
||||
4 ->
|
||||
4
|
||||
_ ->
|
||||
5
|
||||
|
@ -118,25 +118,19 @@ viewStatusBadge app =
|
|||
let
|
||||
status_class =
|
||||
case app.status of
|
||||
"1" ->
|
||||
1 ->
|
||||
"badge-success"
|
||||
"2" ->
|
||||
2 ->
|
||||
"badge-info"
|
||||
"3" ->
|
||||
3 ->
|
||||
"badge-warning"
|
||||
"4" ->
|
||||
4 ->
|
||||
"badge-danger"
|
||||
_ ->
|
||||
"badge-dark"
|
||||
status_score =
|
||||
case app.status of
|
||||
"" ->
|
||||
"?"
|
||||
score ->
|
||||
score
|
||||
in
|
||||
span [ class ("card-link badge " ++ status_class) ]
|
||||
[ text ("Score: " ++ status_score) ]
|
||||
[ text ("Score: " ++ String.fromInt app.status) ]
|
||||
|
||||
viewApp : App -> Html Msg
|
||||
viewApp app =
|
||||
|
@ -228,8 +222,8 @@ loadApps =
|
|||
|
||||
featuresDecoder =
|
||||
(Decode.oneOf
|
||||
[ Decode.at [ "status" ] Decode.string
|
||||
, Decode.succeed ""
|
||||
[ Decode.at [ "status" ] Decode.int
|
||||
, Decode.succeed 5
|
||||
]
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue