@@ -15,6 +15,7 @@ import Json.Decode as Decode
1515import Json.Decode.Pipeline exposing (optional , required )
1616import Lib.UserHandle as UserHandle
1717import UI.DateTime as DateTime exposing (DateTime )
18+ import UnisonShare.Check as Check exposing (Check )
1819import UnisonShare.Contribution.ContributionRef as ContributionRef exposing (ContributionRef )
1920import UnisonShare.Contribution.ContributionStatus as ContributionStatus exposing (ContributionStatus )
2021import UnisonShare.Project.ProjectRef as ProjectRef exposing (ProjectRef )
@@ -51,7 +52,10 @@ type alias ContributionSummary =
5152
5253
5354type alias ContributionDetails =
54- Contribution { contributionStateToken : ContributionStateToken }
55+ Contribution
56+ { contributionStateToken : ContributionStateToken
57+ , latestCheckOnSourceBranch : Maybe Check
58+ }
5559
5660
5761
@@ -74,8 +78,8 @@ toSummary contrib =
7478 }
7579
7680
77- toDetails : ContributionStateToken -> ContributionSummary -> ContributionDetails
78- toDetails token contrib =
81+ toDetails : ContributionStateToken -> Maybe Check -> ContributionSummary -> ContributionDetails
82+ toDetails token check contrib =
7983 { ref = contrib. ref
8084 , author = contrib. author
8185 , sourceBranchRef = contrib. sourceBranchRef
@@ -88,6 +92,7 @@ toDetails token contrib =
8892 , title = contrib. title
8993 , description = contrib. description
9094 , contributionStateToken = token
95+ , latestCheckOnSourceBranch = check
9196 }
9297
9398
@@ -116,7 +121,7 @@ decodeDetails =
116121 , User . decodeSummary
117122 ]
118123
119- makeContributionDetails ref author sourceBranchRef targetBranchRef projectRef createdAt updatedAt status numComments title description contributionStateToken =
124+ makeContributionDetails ref author sourceBranchRef targetBranchRef projectRef createdAt updatedAt status numComments title description contributionStateToken check =
120125 { ref = ref
121126 , author = author
122127 , sourceBranchRef = sourceBranchRef
@@ -129,6 +134,7 @@ decodeDetails =
129134 , title = title
130135 , description = description
131136 , contributionStateToken = contributionStateToken
137+ , latestCheckOnSourceBranch = check
132138 }
133139 in
134140 Decode . succeed makeContributionDetails
@@ -145,6 +151,7 @@ decodeDetails =
145151 |> optional " description" ( Decode . map Just Decode . string) Nothing
146152 |> required " contributionStateToken"
147153 ( Decode . map ContributionStateToken Decode . string)
154+ |> optional " latestCheckOnSourceBranch" ( Decode . map Just Check . decode) Nothing
148155
149156
150157decodeSummary : Decode .Decoder ContributionSummary
0 commit comments