diff --git a/__tests__/shared/components/ChallengeTile/__mocks__/design.json b/__tests__/shared/components/ChallengeTile/__mocks__/design.json index 538ff8b88d..9bf42f544c 100644 --- a/__tests__/shared/components/ChallengeTile/__mocks__/design.json +++ b/__tests__/shared/components/ChallengeTile/__mocks__/design.json @@ -15,13 +15,13 @@ "technologies": "", "status": "COMPLETED", "legacy": { - "track": "DESIGN" + "track": "DESIGN", + "forumId": 599349 }, "subTrack": "LOGO_DESIGN", "name": "Sunshot - MapMySolar - SunGiver - Brand Concept Logo Design Challenge", "reviewType": "INTERNAL", "id": 30051608, - "forumId": 599349, "numOfSubmissions": 22, "numOfRegistrants": 31, "registrationStartDate": "2015-10-01T22:21:07.491Z", @@ -320,13 +320,13 @@ "technologies": "", "status": "COMPLETED", "legacy": { - "track": "DESIGN" + "track": "DESIGN", + "forumId": 598066 }, "subTrack": "LOGO_DESIGN", "name": "2016 Topcoder Open Logo Design Challenge", "reviewType": "INTERNAL", "id": 30051059, - "forumId": 598066, "numOfSubmissions": 57, "numOfRegistrants": 111, "registrationStartDate": "2015-08-10T13:00:01.576Z", @@ -532,13 +532,13 @@ "technologies": "", "status": "COMPLETED", "legacy": { - "track": "DESIGN" + "track": "DESIGN", + "forumId": 596557 }, "subTrack": "LOGO_DESIGN", "name": "ACME Logos Design Challenge", "reviewType": "INTERNAL", "id": 30050375, - "forumId": 596557, "numOfSubmissions": 15, "numOfRegistrants": 55, "registrationStartDate": "2015-06-01T19:00:33.351Z", diff --git a/__tests__/shared/components/ChallengeTile/__mocks__/develop.json b/__tests__/shared/components/ChallengeTile/__mocks__/develop.json index 5daebcad84..ec6b731307 100644 --- a/__tests__/shared/components/ChallengeTile/__mocks__/develop.json +++ b/__tests__/shared/components/ChallengeTile/__mocks__/develop.json @@ -22,13 +22,13 @@ "technologies": "CSS, HTML, JavaScript", "status": "COMPLETED", "legacy": { - "track": "DEVELOP" + "track": "DEVELOP", + "forumId": 39153 }, "subTrack": "FIRST_2_FINISH", "name": "$100 Eaton PX 2.0 Petting Zoo - MDC Web Enhancement F2F Challenge", "reviewType": "INTERNAL", "id": 30060905, - "forumId": 39153, "numOfSubmissions": 3, "numOfRegistrants": 8, "registrationStartDate": "2017-12-02T09:01:23.251Z", @@ -165,13 +165,13 @@ "technologies": "ReactJS", "status": "COMPLETED", "legacy": { - "track": "DEVELOP" + "track": "DEVELOP", + "forumId": 39151 }, "subTrack": "FIRST_2_FINISH", "name": "$100 Eaton PX 2.0 Petting Zoo - ReactJS Enhancement F2F Challenge", "reviewType": "INTERNAL", "id": 30060903, - "forumId": 39151, "numOfSubmissions": 2, "numOfRegistrants": 6, "registrationStartDate": "2017-12-02T09:01:21.329Z", @@ -323,13 +323,13 @@ "technologies": "Angular 2+, Express, JSON, Node.js", "status": "COMPLETED", "legacy": { - "track": "DEVELOP" + "track": "DEVELOP", + "forumId": 38951 }, "subTrack": "FIRST_2_FINISH", "name": "$500 BG800 Online Course Mock Rest API F2F Challenge", "reviewType": "INTERNAL", "id": 30060687, - "forumId": 38951, "numOfSubmissions": 14, "numOfRegistrants": 18, "registrationStartDate": "2017-11-24T13:27:44.751Z", @@ -631,13 +631,13 @@ "technologies": "JavaScript, ReactJS", "status": "COMPLETED", "legacy": { - "track": "DEVELOP" + "track": "DEVELOP", + "forumId": 38702 }, "subTrack": "FIRST_2_FINISH", "name": "John Hancock - Giving Tuesday - General image handling", "reviewType": "INTERNAL", "id": 30060425, - "forumId": 38702, "numOfSubmissions": 3, "numOfRegistrants": 17, "registrationStartDate": "2017-11-11T02:02:21.127Z", diff --git a/__tests__/shared/components/ProfilePage/Stats/SubTrackChallengeView/GalleryModal/__mocks__/challenge.json b/__tests__/shared/components/ProfilePage/Stats/SubTrackChallengeView/GalleryModal/__mocks__/challenge.json index 75463280e1..9721622011 100644 --- a/__tests__/shared/components/ProfilePage/Stats/SubTrackChallengeView/GalleryModal/__mocks__/challenge.json +++ b/__tests__/shared/components/ProfilePage/Stats/SubTrackChallengeView/GalleryModal/__mocks__/challenge.json @@ -83,7 +83,9 @@ "name": "2016 Topcoder Open Logo Design Challenge", "reviewType": "INTERNAL", "id": 30051059, - "forumId": 598066, + "legacy": { + "forumId": 598066 + }, "numOfSubmissions": 57, "numOfRegistrants": 111, "registrationStartDate": "2015-08-10T13:00:01.576Z", diff --git a/__tests__/shared/components/ProfilePage/Stats/SubTrackChallengeView/__mocks__/develop.json b/__tests__/shared/components/ProfilePage/Stats/SubTrackChallengeView/__mocks__/develop.json index 97eaa96ac3..bde784385f 100644 --- a/__tests__/shared/components/ProfilePage/Stats/SubTrackChallengeView/__mocks__/develop.json +++ b/__tests__/shared/components/ProfilePage/Stats/SubTrackChallengeView/__mocks__/develop.json @@ -35,7 +35,9 @@ "name": "$100 Eaton PX 2.0 Petting Zoo - MDC Web Enhancement F2F Challenge", "reviewType": "INTERNAL", "id": 30060905, - "forumId": 39153, + "legacy": { + "forumId": 39153 + }, "numOfSubmissions": 3, "numOfRegistrants": 8, "registrationStartDate": "2017-12-02T09:01:23.251Z", @@ -189,7 +191,9 @@ "name": "$100 Eaton PX 2.0 Petting Zoo - ReactJS Enhancement F2F Challenge", "reviewType": "INTERNAL", "id": 30060903, - "forumId": 39151, + "legacy": { + "forumId": 38951 + }, "numOfSubmissions": 2, "numOfRegistrants": 6, "registrationStartDate": "2017-12-02T09:01:21.329Z", @@ -385,7 +389,9 @@ "name": "$500 BG800 Online Course Mock Rest API F2F Challenge", "reviewType": "INTERNAL", "id": 30060687, - "forumId": 38951, + "legacy": { + "forumId": 38951 + }, "numOfSubmissions": 14, "numOfRegistrants": 18, "registrationStartDate": "2017-11-24T13:27:44.751Z", @@ -713,7 +719,9 @@ "name": "John Hancock - Giving Tuesday - General image handling", "reviewType": "INTERNAL", "id": 30060425, - "forumId": 38702, + "legacy": { + "forumId": 38702 + }, "numOfSubmissions": 3, "numOfRegistrants": 17, "registrationStartDate": "2017-11-11T02:02:21.127Z", diff --git a/__tests__/shared/components/ProfilePage/Stats/SubTrackChallengeView/__snapshots__/index.jsx.snap b/__tests__/shared/components/ProfilePage/Stats/SubTrackChallengeView/__snapshots__/index.jsx.snap index d03ee36943..a753995d16 100644 --- a/__tests__/shared/components/ProfilePage/Stats/SubTrackChallengeView/__snapshots__/index.jsx.snap +++ b/__tests__/shared/components/ProfilePage/Stats/SubTrackChallengeView/__snapshots__/index.jsx.snap @@ -107,12 +107,14 @@ exports[`SubtrackChallengeView matches shallow snapshot 1`] = ` "projectId": 30060905, }, ], - "forumId": 39153, "groupIds": null, "handle": "thomaskranitsas", "id": 30060905, "isPrivate": false, "isTask": false, + "legacy": Object { + "forumId": 39153, + }, "name": "$100 Eaton PX 2.0 Petting Zoo - MDC Web Enhancement F2F Challenge", "numOfRegistrants": 8, "numOfSubmissions": 3, @@ -285,12 +287,14 @@ exports[`SubtrackChallengeView matches shallow snapshot 1`] = ` "projectId": 30060903, }, ], - "forumId": 39151, "groupIds": null, "handle": "thomaskranitsas", "id": 30060903, "isPrivate": false, "isTask": false, + "legacy": Object { + "forumId": 38951, + }, "name": "$100 Eaton PX 2.0 Petting Zoo - ReactJS Enhancement F2F Challenge", "numOfRegistrants": 6, "numOfSubmissions": 2, @@ -633,12 +637,14 @@ exports[`SubtrackChallengeView matches shallow snapshot 1`] = ` "projectId": 30060687, }, ], - "forumId": 38951, "groupIds": null, "handle": "thomaskranitsas", "id": 30060687, "isPrivate": false, "isTask": false, + "legacy": Object { + "forumId": 38951, + }, "name": "$500 BG800 Online Course Mock Rest API F2F Challenge", "numOfRegistrants": 18, "numOfSubmissions": 14, @@ -867,12 +873,14 @@ exports[`SubtrackChallengeView matches shallow snapshot 1`] = ` "projectId": 30060425, }, ], - "forumId": 38702, "groupIds": null, "handle": "thomaskranitsas", "id": 30060425, "isPrivate": false, "isTask": false, + "legacy": Object { + "forumId": 38702, + }, "name": "John Hancock - Giving Tuesday - General image handling", "numOfRegistrants": 17, "numOfSubmissions": 3, diff --git a/__tests__/shared/components/SubmissionManagement/__mocks__/design-submissions.json b/__tests__/shared/components/SubmissionManagement/__mocks__/design-submissions.json index 02d316be75..dbb133b188 100644 --- a/__tests__/shared/components/SubmissionManagement/__mocks__/design-submissions.json +++ b/__tests__/shared/components/SubmissionManagement/__mocks__/design-submissions.json @@ -11,7 +11,9 @@ "name": "Test Design Challenge for Submission Management Page", "reviewType": "INTERNAL", "id": 30050696, - "forumId": 595805, + "legacy": { + "forumId": 595805 + }, "numOfSubmissions": 0, "numOfRegistrants": 4, "registrationStartDate": "2017-03-27T20:38:52.000Z", diff --git a/src/shared/components/Dashboard/Program/IosCard.jsx b/src/shared/components/Dashboard/Program/IosCard.jsx index 0fd94637fe..f86f1989f9 100644 --- a/src/shared/components/Dashboard/Program/IosCard.jsx +++ b/src/shared/components/Dashboard/Program/IosCard.jsx @@ -9,7 +9,7 @@ import './IosCard.scss'; const IosCard = (props) => { const { challenge } = props; const { legacy } = challenge; - const { track } = legacy; + const { track, forumId } = legacy; return (
Posts diff --git a/src/shared/components/challenge-detail/Header/TabSelector/index.jsx b/src/shared/components/challenge-detail/Header/TabSelector/index.jsx index 768ad25042..ecbd593b38 100644 --- a/src/shared/components/challenge-detail/Header/TabSelector/index.jsx +++ b/src/shared/components/challenge-detail/Header/TabSelector/index.jsx @@ -33,7 +33,7 @@ export default function ChallengeViewSelector(props) { mySubmissions, } = props; - const forumId = _.get(challenge, 'forumId') || 0; + const forumId = _.get(challenge, 'legacy.forumId') || 0; const roles = _.get(challenge, 'userDetails.roles') || []; const forumEndpoint = trackLower === 'design' @@ -199,8 +199,8 @@ ChallengeViewSelector.propTypes = { isLoggedIn: PT.bool, challenge: PT.shape({ subTrack: PT.any, - details: PT.shape({ - forumId: PT.number.isRequired, + legacy: PT.shape({ + forumId: PT.number, }), userDetails: PT.shape({ roles: PT.arrayOf(PT.string), diff --git a/src/shared/components/challenge-detail/Specification/index.jsx b/src/shared/components/challenge-detail/Specification/index.jsx index f8f27df96e..fcaa3ce798 100644 --- a/src/shared/components/challenge-detail/Specification/index.jsx +++ b/src/shared/components/challenge-detail/Specification/index.jsx @@ -38,7 +38,6 @@ export default function ChallengeDetailsView(props) { } = props; const { - forumId, groups, description, privateDescription, @@ -53,7 +52,12 @@ export default function ChallengeDetailsView(props) { const tags = challenge.tags || []; const roles = (userDetails || {}).roles || []; - const { track, reviewScorecardId, screeningScorecardId } = legacy; + const { + track, + reviewScorecardId, + screeningScorecardId, + forumId, + } = legacy; const allowStockArt = _.find(metadata, { type: 'allowStockArt' }); let environment = ''; @@ -415,9 +419,9 @@ ChallengeDetailsView.propTypes = { track: PT.string.isRequired, reviewScorecardId: PT.string, screeningScorecardId: PT.string, + forumId: PT.number, }), groups: PT.any, - forumId: PT.number, reviewType: PT.string, tags: PT.arrayOf(PT.string), numberOfCheckpointsPrizes: PT.number, diff --git a/src/shared/components/challenge-listing/ChallengeCard/Status/index.jsx b/src/shared/components/challenge-listing/ChallengeCard/Status/index.jsx index 3409350d6e..96dac65598 100644 --- a/src/shared/components/challenge-listing/ChallengeCard/Status/index.jsx +++ b/src/shared/components/challenge-listing/ChallengeCard/Status/index.jsx @@ -164,6 +164,7 @@ export default function ChallengeStatus(props) { * the common code being used in both places. */ function completedChallenge() { const { challenge } = props; + const forumId = _.get(challenge, 'legacy.forumId') || 0; return (