@@ -51,13 +51,19 @@ interface Props {
5151 selectedTab : string
5252 isLoadingSubmission : boolean
5353 screening : Screening [ ]
54+ screeningMinimumPassingScore : number | null | undefined
5455 submissions : BackendSubmission [ ]
5556 checkpoint : Screening [ ]
57+ checkpointScreeningMinimumPassingScore : number | null | undefined
5658 checkpointReview : Screening [ ]
59+ checkpointReviewMinimumPassingScore : number | null | undefined
5760 review : SubmissionInfo [ ]
61+ reviewMinimumPassingScore : number | null | undefined
5862 submitterReviews : SubmissionInfo [ ]
5963 approvalReviews : SubmissionInfo [ ]
64+ approvalMinimumPassingScore : number | null | undefined
6065 postMortemReviews : SubmissionInfo [ ]
66+ postMortemMinimumPassingScore : number | null | undefined
6167 mappingReviewAppeal : MappingReviewAppeal // from review id to appeal info
6268 isActiveChallenge : boolean
6369 selectedPhaseId ?: string
@@ -80,11 +86,13 @@ const SUBMISSION_TAB_KEYS = new Set([
8086 normalizeType ( 'topgear submission' ) ,
8187] )
8288
89+ const CHECKPOINT_REVIEW_KEY = normalizeType ( 'checkpoint review' )
90+ const CHECKPOINT_SCREENING_KEY = normalizeType ( 'checkpoint screening' )
8391const CHECKPOINT_TAB_KEYS = new Set ( [
8492 normalizeType ( 'checkpoint' ) ,
8593 normalizeType ( 'checkpoint submission' ) ,
86- normalizeType ( 'checkpoint screening' ) ,
87- normalizeType ( 'checkpoint review' ) ,
94+ CHECKPOINT_SCREENING_KEY ,
95+ CHECKPOINT_REVIEW_KEY ,
8896] )
8997
9098interface BuildScreeningRowsParams {
@@ -98,19 +106,22 @@ const buildScreeningRows = ({
98106 actionChallengeRole,
99107 currentMemberId,
100108} : BuildScreeningRowsParams ) : Screening [ ] => {
101- const filteredScreening = actionChallengeRole === SUBMITTER && currentMemberId
102- ? screening . filter ( entry => entry . memberId === currentMemberId )
103- : screening
109+ if ( actionChallengeRole === SUBMITTER && currentMemberId ) {
110+ const mySubmissions = screening . filter ( entry => entry . memberId === currentMemberId )
104111
105- return hasIsLatestFlag ( filteredScreening )
106- ? filteredScreening . filter ( submission => submission . isLatest === true )
107- : filteredScreening
112+ return hasIsLatestFlag ( mySubmissions )
113+ ? mySubmissions . filter ( submission => submission . isLatest === true )
114+ : mySubmissions
115+ }
116+
117+ return screening
108118}
109119
110120interface SubmissionTabParams {
111121 selectedTabNormalized : string
112122 submissions : BackendSubmission [ ]
113123 screeningRows : Screening [ ]
124+ screeningMinimumPassingScore : number | null | undefined
114125 isLoadingSubmission : boolean
115126 isDownloadingSubmission : useDownloadSubmissionProps [ 'isLoading' ]
116127 downloadSubmission : useDownloadSubmissionProps [ 'downloadSubmission' ]
@@ -121,6 +132,7 @@ const renderSubmissionTab = ({
121132 selectedTabNormalized,
122133 submissions,
123134 screeningRows,
135+ screeningMinimumPassingScore,
124136 isLoadingSubmission,
125137 isDownloadingSubmission,
126138 downloadSubmission,
@@ -154,6 +166,7 @@ const renderSubmissionTab = ({
154166 return (
155167 < TabContentScreening
156168 screening = { screeningRows }
169+ screeningMinimumPassingScore = { screeningMinimumPassingScore }
157170 isLoadingScreening = { isLoadingSubmission }
158171 isDownloading = { isDownloadingSubmission }
159172 downloadSubmission = { downloadSubmission }
@@ -326,21 +339,30 @@ export const ChallengeDetailsContent: FC<Props> = (props: Props) => {
326339 isActiveChallenge : props . isActiveChallenge ,
327340 isDownloadingSubmission,
328341 isLoadingSubmission : props . isLoadingSubmission ,
342+ screeningMinimumPassingScore : props . screeningMinimumPassingScore ,
329343 screeningRows,
330344 selectedTabNormalized,
331345 submissions : props . submissions ,
332346 } )
333347 }
334348
335349 if ( CHECKPOINT_TAB_KEYS . has ( selectedTabNormalized ) ) {
350+ const checkpointMode : 'submission' | 'screening' | 'review' = selectedTabNormalized
351+ . startsWith ( CHECKPOINT_REVIEW_KEY )
352+ ? 'review'
353+ : selectedTabNormalized . startsWith ( CHECKPOINT_SCREENING_KEY )
354+ ? 'screening'
355+ : 'submission'
336356 return (
337357 < TabContentCheckpoint
338358 checkpoint = { props . checkpoint }
339359 checkpointReview = { props . checkpointReview }
360+ checkpointScreeningMinimumPassingScore = { props . checkpointScreeningMinimumPassingScore }
361+ checkpointReviewMinimumPassingScore = { props . checkpointReviewMinimumPassingScore }
340362 isLoading = { props . isLoadingSubmission }
341363 isDownloading = { isDownloadingSubmission }
342364 downloadSubmission = { downloadSubmission }
343- selectedTab = { props . selectedTab }
365+ mode = { checkpointMode }
344366 />
345367 )
346368 }
@@ -361,6 +383,7 @@ export const ChallengeDetailsContent: FC<Props> = (props: Props) => {
361383 < TabContentApproval
362384 reviews = { props . approvalReviews }
363385 submitterReviews = { props . submitterReviews }
386+ approvalMinimumPassingScore = { props . approvalMinimumPassingScore }
364387 isLoadingReview = { props . isLoadingSubmission }
365388 isDownloading = { isDownloadingSubmission }
366389 downloadSubmission = { downloadSubmission }
@@ -374,6 +397,7 @@ export const ChallengeDetailsContent: FC<Props> = (props: Props) => {
374397 < TabContentIterativeReview
375398 reviews = { postMortemReviewRows }
376399 submitterReviews = { postMortemSubmitterReviews }
400+ postMortemMinimumPassingScore = { props . postMortemMinimumPassingScore }
377401 isLoadingReview = { props . isLoadingSubmission }
378402 isDownloading = { isDownloadingSubmission }
379403 downloadSubmission = { downloadSubmission }
@@ -388,6 +412,7 @@ export const ChallengeDetailsContent: FC<Props> = (props: Props) => {
388412 < TabContentIterativeReview
389413 reviews = { props . review }
390414 submitterReviews = { props . submitterReviews }
415+ postMortemMinimumPassingScore = { props . postMortemMinimumPassingScore }
391416 isLoadingReview = { props . isLoadingSubmission }
392417 isDownloading = { isDownloadingSubmission }
393418 downloadSubmission = { downloadSubmission }
@@ -402,6 +427,7 @@ export const ChallengeDetailsContent: FC<Props> = (props: Props) => {
402427 selectedTab = { props . selectedTab }
403428 reviews = { reviewTabReviews }
404429 submitterReviews = { reviewTabSubmitterReviews }
430+ reviewMinimumPassingScore = { props . reviewMinimumPassingScore }
405431 isLoadingReview = { props . isLoadingSubmission }
406432 isDownloading = { isDownloadingSubmission }
407433 downloadSubmission = { downloadSubmission }
0 commit comments