File tree Expand file tree Collapse file tree 1 file changed +22
-11
lines changed
src/apps/review/src/pages/active-review-assignements/ScorecardDetailsPage Expand file tree Collapse file tree 1 file changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -336,22 +336,33 @@ export const ScorecardDetailsPage: FC<Props> = (props: Props) => {
336336 [ myChallengeResources ] ,
337337 )
338338
339- const canEditScorecard = useMemo (
340- ( ) => Boolean (
339+ const canEditScorecard = useMemo ( ( ) => {
340+ const challengeStatus = ( challengeInfo ?. status ?? '' )
341+ . toString ( )
342+ . trim ( )
343+ . toUpperCase ( )
344+ const isChallengeClosed = challengeStatus . includes ( 'COMPLETED' )
345+ || challengeStatus . startsWith ( 'CANCELLED' )
346+
347+ if ( isChallengeClosed ) {
348+ return false
349+ }
350+
351+ return Boolean (
341352 reviewInfo ?. committed
342353 && ( hasChallengeAdminRole
343354 || hasTopcoderAdminRole
344355 || hasChallengeManagerRole
345356 || hasChallengeCopilotRole ) ,
346- ) ,
347- [
348- hasChallengeAdminRole ,
349- hasChallengeCopilotRole ,
350- hasChallengeManagerRole ,
351- hasTopcoderAdminRole ,
352- reviewInfo ?. committed ,
353- ] ,
354- )
357+ )
358+ } , [
359+ challengeInfo ?. status ,
360+ hasChallengeAdminRole ,
361+ hasChallengeCopilotRole ,
362+ hasChallengeManagerRole ,
363+ hasTopcoderAdminRole ,
364+ reviewInfo ?. committed ,
365+ ] )
355366
356367 // Redirect: if user is on a past-challenges route but the challenge is ACTIVE,
357368 // send them to the corresponding active-challenges route, preserving the rest of the path and query.
You can’t perform that action at this time.
0 commit comments