Skip to content

Commit 6306c80

Browse files
authored
Merge pull request #7091 from topcoder-platform/pm-1192
fix(PM-1192): showing wrong review scorecard link
2 parents 02fb0cf + cc6f3b4 commit 6306c80

File tree

1 file changed

+11
-2
lines changed
  • src/shared/components/challenge-detail/Specification

1 file changed

+11
-2
lines changed

src/shared/components/challenge-detail/Specification/index.jsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,23 @@ export default function ChallengeDetailsView(props) {
4747
metadata,
4848
events,
4949
track,
50+
phases,
5051
} = challenge;
5152

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+
5259
const roles = (userDetails || {}).roles || [];
5360
const {
54-
reviewScorecardId,
55-
screeningScorecardId,
5661
forumId,
5762
} = legacy;
5863

64+
const reviewScorecardId = getScoreCardByPhase('Review');
65+
const screeningScorecardId = getScoreCardByPhase('Screening');
66+
5967
let stockArtValue = '';
6068
const allowStockArt = _.find(metadata, { name: 'allowStockArt' });
6169
if (allowStockArt) {
@@ -421,6 +429,7 @@ ChallengeDetailsView.propTypes = {
421429
}),
422430
metadata: PT.array,
423431
events: PT.arrayOf(PT.string),
432+
phases: PT.arrayOf(PT.any),
424433
}),
425434
challengesUrl: PT.string.isRequired,
426435
communitiesList: PT.arrayOf(PT.shape({

0 commit comments

Comments
 (0)