Skip to content

Commit 35e60aa

Browse files
committed
fix for issue #4435
1 parent 9f583e4 commit 35e60aa

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ SideBar.defaultProps = {
348348
environment: '',
349349
codeRepo: '',
350350
isMM: false,
351-
metadata: [],
351+
metadata: {},
352352
reviewScorecardId: '',
353353
screeningScorecardId: '',
354354
};
@@ -370,7 +370,7 @@ SideBar.propTypes = {
370370
environment: PT.string,
371371
codeRepo: PT.string,
372372
isMM: PT.bool,
373-
metadata: PT.arrayOf(PT.shape()),
373+
metadata: PT.shape(),
374374
reviewScorecardId: PT.string,
375375
screeningScorecardId: PT.string,
376376
};

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ ChallengeDetailsView.defaultProps = {
436436
finalSubmissionGuidelines: '',
437437
environment: '',
438438
codeRepo: '',
439-
metadata: [],
439+
metadata: {},
440440
reviewScorecardId: '',
441441
screeningScorecardId: '',
442442
},
@@ -467,7 +467,7 @@ ChallengeDetailsView.propTypes = {
467467
userDetails: PT.shape({
468468
roles: PT.arrayOf(PT.string).isRequired,
469469
}),
470-
metadata: PT.arrayOf(PT.shape()),
470+
metadata: PT.shape(),
471471
}),
472472
challengesUrl: PT.string.isRequired,
473473
communitiesList: PT.arrayOf(PT.shape({

src/shared/containers/challenge-detail/index.jsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class ChallengeDetailPageContainer extends React.Component {
191191
&& !challenge.fetchedWithAuth)
192192

193193
) {
194-
loadChallengeDetails(auth, challengeId);
194+
loadChallengeDetails(auth, challengeId, this.props.history);
195195
}
196196

197197
if (!allCountries.length) {
@@ -841,12 +841,19 @@ const mapDispatchToProps = (dispatch) => {
841841
dispatch(lookupActions.getReviewTypesInit());
842842
dispatch(lookupActions.getReviewTypesDone(tokenV3));
843843
},
844-
loadChallengeDetails: (tokens, challengeId) => {
844+
loadChallengeDetails: (tokens, challengeId, history) => {
845845
const a = actions.challenge;
846846
dispatch(a.getDetailsInit(challengeId));
847847
dispatch(a.getDetailsDone(challengeId, tokens.tokenV3, tokens.tokenV2))
848848
.then((res) => {
849849
const ch = res.payload;
850+
console.log(`found challenge details: ${JSON.stringify(ch)}`);
851+
if (ch.isLegacyChallenge) {
852+
console.log(`redirecting to /challenges/${ch.id}`);
853+
console.log(`history ${JSON.stringify(history)}`);
854+
// history.push(`/challenges/${ch.id}`);
855+
// history.pushState({}, null, `/challenges/${ch.id}`);
856+
}
850857
if (ch.track === 'DESIGN') {
851858
const p = ch.allPhases || ch.phases || []
852859
.filter(x => x.name === 'Checkpoint Review');

0 commit comments

Comments
 (0)