-
Notifications
You must be signed in to change notification settings - Fork 212
[PROD RELEASE] - Bug fixes #7093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f9602b4
c71e7af
ebd9571
cc6f3b4
6306c80
030455f
9f432e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,15 +47,23 @@ export default function ChallengeDetailsView(props) { | |
metadata, | ||
events, | ||
track, | ||
phases, | ||
} = challenge; | ||
|
||
const getScoreCardByPhase = (phaseName) => { | ||
const phase = phases.find(item => item.name === phaseName); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
const scoreCardConstraint = phase && phase.constraints && phase.constraints.find(item => item.name === 'Scorecard'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider checking if |
||
return scoreCardConstraint ? scoreCardConstraint.value : ''; | ||
}; | ||
|
||
const roles = (userDetails || {}).roles || []; | ||
const { | ||
reviewScorecardId, | ||
screeningScorecardId, | ||
forumId, | ||
} = legacy; | ||
|
||
const reviewScorecardId = getScoreCardByPhase('Review'); | ||
const screeningScorecardId = getScoreCardByPhase('Screening'); | ||
|
||
let stockArtValue = ''; | ||
const allowStockArt = _.find(metadata, { name: 'allowStockArt' }); | ||
if (allowStockArt) { | ||
|
@@ -421,6 +429,7 @@ ChallengeDetailsView.propTypes = { | |
}), | ||
metadata: PT.array, | ||
events: PT.arrayOf(PT.string), | ||
phases: PT.arrayOf(PT.any), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||
}), | ||
challengesUrl: PT.string.isRequired, | ||
communitiesList: PT.arrayOf(PT.shape({ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding error handling or a default return value in
getScoreCardByPhase
in casephases
is undefined or does not contain the expected structure. This will prevent potential runtime errors.