File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
src/shared/components/challenge-detail/Specification Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -47,15 +47,23 @@ export default function ChallengeDetailsView(props) {
47
47
metadata,
48
48
events,
49
49
track,
50
+ phases,
50
51
} = challenge ;
51
52
53
+ const getScoreCardByPhase = ( phaseName ) => {
54
+ const phase = phases . find ( item => item . name === phaseName ) ;
55
+ const scoreCardConstraint = phase && phase . constraints && phase . constraints . find ( item => item . name === 'Scorecard' ) ;
56
+ return scoreCardConstraint ? scoreCardConstraint . value : '' ;
57
+ } ;
58
+
52
59
const roles = ( userDetails || { } ) . roles || [ ] ;
53
60
const {
54
- reviewScorecardId,
55
- screeningScorecardId,
56
61
forumId,
57
62
} = legacy ;
58
63
64
+ const reviewScorecardId = getScoreCardByPhase ( 'Review' ) ;
65
+ const screeningScorecardId = getScoreCardByPhase ( 'Screening' ) ;
66
+
59
67
let stockArtValue = '' ;
60
68
const allowStockArt = _ . find ( metadata , { name : 'allowStockArt' } ) ;
61
69
if ( allowStockArt ) {
@@ -421,6 +429,7 @@ ChallengeDetailsView.propTypes = {
421
429
} ) ,
422
430
metadata : PT . array ,
423
431
events : PT . arrayOf ( PT . string ) ,
432
+ phases : PT . arrayOf ( PT . any ) ,
424
433
} ) ,
425
434
challengesUrl : PT . string . isRequired ,
426
435
communitiesList : PT . arrayOf ( PT . shape ( {
You can’t perform that action at this time.
0 commit comments