From f9602b40b0a9f0031d42a96795d7ba87e92da9d7 Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Wed, 7 May 2025 23:44:54 +0200 Subject: [PATCH 1/4] fix: showing wrong review scorecard link --- .../challenge-detail/Specification/index.jsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/shared/components/challenge-detail/Specification/index.jsx b/src/shared/components/challenge-detail/Specification/index.jsx index 40fc8e21b..76b3f790f 100644 --- a/src/shared/components/challenge-detail/Specification/index.jsx +++ b/src/shared/components/challenge-detail/Specification/index.jsx @@ -47,15 +47,23 @@ export default function ChallengeDetailsView(props) { metadata, events, track, + phases, } = challenge; + const getScoreCardByPhase = (phase) => { + const screeningPhase = phases.find(item => item.name === phase); + const scoreCardConstraint = screeningPhase.constraints.find(item => item.name === 'Scorecard'); + 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) { From c71e7afc6a59f9a6cfb98f66c048fed4dc99ae03 Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Wed, 7 May 2025 23:51:26 +0200 Subject: [PATCH 2/4] fix: showing wrong review scorecard link --- .../components/challenge-detail/Specification/index.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shared/components/challenge-detail/Specification/index.jsx b/src/shared/components/challenge-detail/Specification/index.jsx index 76b3f790f..4f854ae73 100644 --- a/src/shared/components/challenge-detail/Specification/index.jsx +++ b/src/shared/components/challenge-detail/Specification/index.jsx @@ -50,9 +50,9 @@ export default function ChallengeDetailsView(props) { phases, } = challenge; - const getScoreCardByPhase = (phase) => { - const screeningPhase = phases.find(item => item.name === phase); - const scoreCardConstraint = screeningPhase.constraints.find(item => item.name === 'Scorecard'); + const getScoreCardByPhase = (phaseName) => { + const phase = phases.find(item => item.name === phaseName); + const scoreCardConstraint = phase && phase.constraints.find(item => item.name === 'Scorecard'); return scoreCardConstraint ? scoreCardConstraint.value : ''; } From ebd957130e9e4610890a8a3adcecacc7533ef2df Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Wed, 7 May 2025 23:53:14 +0200 Subject: [PATCH 3/4] fix: showing wrong review scorecard link --- src/shared/components/challenge-detail/Specification/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/components/challenge-detail/Specification/index.jsx b/src/shared/components/challenge-detail/Specification/index.jsx index 4f854ae73..ebf8e772a 100644 --- a/src/shared/components/challenge-detail/Specification/index.jsx +++ b/src/shared/components/challenge-detail/Specification/index.jsx @@ -52,7 +52,7 @@ export default function ChallengeDetailsView(props) { const getScoreCardByPhase = (phaseName) => { const phase = phases.find(item => item.name === phaseName); - const scoreCardConstraint = phase && phase.constraints.find(item => item.name === 'Scorecard'); + const scoreCardConstraint = phase && phase.constraints && phase.constraints.find(item => item.name === 'Scorecard'); return scoreCardConstraint ? scoreCardConstraint.value : ''; } From cc6f3b46ae64e38379f372b0f3ff01abcfcd726c Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Thu, 8 May 2025 00:05:15 +0200 Subject: [PATCH 4/4] fix: lint --- src/shared/components/challenge-detail/Specification/index.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/components/challenge-detail/Specification/index.jsx b/src/shared/components/challenge-detail/Specification/index.jsx index ebf8e772a..d6319fd68 100644 --- a/src/shared/components/challenge-detail/Specification/index.jsx +++ b/src/shared/components/challenge-detail/Specification/index.jsx @@ -54,7 +54,7 @@ export default function ChallengeDetailsView(props) { const phase = phases.find(item => item.name === phaseName); const scoreCardConstraint = phase && phase.constraints && phase.constraints.find(item => item.name === 'Scorecard'); return scoreCardConstraint ? scoreCardConstraint.value : ''; - } + }; const roles = (userDetails || {}).roles || []; const { @@ -429,6 +429,7 @@ ChallengeDetailsView.propTypes = { }), metadata: PT.array, events: PT.arrayOf(PT.string), + phases: PT.arrayOf(PT.any), }), challengesUrl: PT.string.isRequired, communitiesList: PT.arrayOf(PT.shape({