Skip to content

Issue#4641 - Fix forumId in Challenge Details page #4646

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

Merged
merged 2 commits into from
Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/shared/components/Dashboard/Program/IosCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import './IosCard.scss';
const IosCard = (props) => {
const { challenge } = props;
const { legacy } = challenge;
const { track } = legacy;
const { track, forumId } = legacy;
return (
<div styleName={`challenge tile-view ${track}`}>
<div styleName="challenge-track" />
Expand Down Expand Up @@ -39,7 +39,7 @@ const IosCard = (props) => {
</p>
</a>
</div>
<a href={`${config.URL.FORUMS}/?module=Category&categoryID=${challenge.forumId}`} styleName="forum">
<a href={`${config.URL.FORUMS}/?module=Category&categoryID=${forumId}`} styleName="forum">
<div styleName="forum-icon" />
<p>
Posts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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),
Expand Down
10 changes: 7 additions & 3 deletions src/shared/components/challenge-detail/Specification/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export default function ChallengeDetailsView(props) {
} = props;

const {
forumId,
groups,
description,
privateDescription,
Expand All @@ -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 = '';
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div>
{renderLeaderboard()}
Expand Down Expand Up @@ -191,7 +192,7 @@ export default function ChallengeStatus(props) {
challenge.myChallenge
&& (
<div styleName="spacing">
<a styleName="link-forum past" href={`${FORUM_URL}${challenge.forumId}`}>
<a styleName="link-forum past" href={`${FORUM_URL}${forumId}`}>
<ForumIcon />
</a>
</div>
Expand All @@ -205,12 +206,12 @@ export default function ChallengeStatus(props) {
function activeChallenge() {
const { challenge } = props;
const {
forumId,
myChallenge,
status,
subTrack,
} = challenge;
const allPhases = challenge.phases || [];
const forumId = _.get(challenge, 'legacy.forumId') || 0;

let statusPhase = allPhases
.filter(p => p.name !== 'Registration' && p.isOpen)
Expand Down