Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface Props {
className?: string
challengeInfo: ChallengeInfo
reviewProgress: number
reviewInProgress: boolean
variant?: 'active' | 'past'
}

Expand Down Expand Up @@ -112,6 +113,7 @@ export const ChallengePhaseInfo: FC<Props> = (props: Props) => {
const uiItems = useMemo(() => {
const data = props.challengeInfo
const variant = props.variant ?? 'active'
const reviewInProgress = props.reviewInProgress

const items: any[] = []

Expand Down Expand Up @@ -172,18 +174,21 @@ export const ChallengePhaseInfo: FC<Props> = (props: Props) => {
value: data.timeLeft || '-',
})

items.push({
title: 'Review Progress',
type: PROGRESS_TYPE,
value: props.reviewProgress,
})
if (!reviewInProgress) {
items.push({
title: 'Review Progress',
type: PROGRESS_TYPE,
value: props.reviewProgress,
})
}
}

return items
}, [
myChallengeRoles,
props.challengeInfo,
props.reviewProgress,
props.reviewInProgress,
props.variant,
hasPayment,
paymentAmount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,8 @@ export const TableReviewAppeals: FC<Props> = (props: Props) => {
label: 'Review Score',
renderer: (data: SubmissionRow) => {
const scoreDisplay = data.aggregated?.averageFinalScoreDisplay
if (!scoreDisplay) {
const isReviewInProgress = data.review?.status === 'IN_PROGRESS'
if (!scoreDisplay || isReviewInProgress) {
return (
<span className={styles.statusBadgePending}>
Pending Review
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,8 @@ export const ChallengeDetailsPage: FC<Props> = (props: Props) => {
() => location.pathname.includes(`/${pastReviewAssignmentsRouteId}/`),
[location.pathname],
)
const latestReview = review.find(r => r.isLatest)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a null check for review before calling find to prevent potential runtime errors if review is undefined.

const reviewInProgress = latestReview?.review?.status === 'IN_PROGRESS'
const currentUserResource = useMemo<BackendResource | undefined>(() => myResources
.find(resource => typeof resource.phaseChangeNotifications === 'boolean')
?? myResources[0], [myResources])
Expand Down Expand Up @@ -1565,6 +1567,7 @@ export const ChallengeDetailsPage: FC<Props> = (props: Props) => {
<ChallengePhaseInfo
challengeInfo={challengeInfo}
reviewProgress={reviewProgress}
reviewInProgress={reviewInProgress}
variant={isPastReviewDetail ? 'past' : 'active'}
/>
)}
Expand Down