Skip to content

Commit 94a2f50

Browse files
authored
Merge pull request #4646 from topcoder-platform/issue-4641
Issue#4641 - Fix forumId in Challenge Details page
2 parents 473933e + 7552428 commit 94a2f50

File tree

10 files changed

+59
-34
lines changed

10 files changed

+59
-34
lines changed

__tests__/shared/components/ChallengeTile/__mocks__/design.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
"technologies": "",
1616
"status": "COMPLETED",
1717
"legacy": {
18-
"track": "DESIGN"
18+
"track": "DESIGN",
19+
"forumId": 599349
1920
},
2021
"subTrack": "LOGO_DESIGN",
2122
"name": "Sunshot - MapMySolar - SunGiver - Brand Concept Logo Design Challenge",
2223
"reviewType": "INTERNAL",
2324
"id": 30051608,
24-
"forumId": 599349,
2525
"numOfSubmissions": 22,
2626
"numOfRegistrants": 31,
2727
"registrationStartDate": "2015-10-01T22:21:07.491Z",
@@ -320,13 +320,13 @@
320320
"technologies": "",
321321
"status": "COMPLETED",
322322
"legacy": {
323-
"track": "DESIGN"
323+
"track": "DESIGN",
324+
"forumId": 598066
324325
},
325326
"subTrack": "LOGO_DESIGN",
326327
"name": "2016 Topcoder Open Logo Design Challenge",
327328
"reviewType": "INTERNAL",
328329
"id": 30051059,
329-
"forumId": 598066,
330330
"numOfSubmissions": 57,
331331
"numOfRegistrants": 111,
332332
"registrationStartDate": "2015-08-10T13:00:01.576Z",
@@ -532,13 +532,13 @@
532532
"technologies": "",
533533
"status": "COMPLETED",
534534
"legacy": {
535-
"track": "DESIGN"
535+
"track": "DESIGN",
536+
"forumId": 596557
536537
},
537538
"subTrack": "LOGO_DESIGN",
538539
"name": "ACME Logos Design Challenge",
539540
"reviewType": "INTERNAL",
540541
"id": 30050375,
541-
"forumId": 596557,
542542
"numOfSubmissions": 15,
543543
"numOfRegistrants": 55,
544544
"registrationStartDate": "2015-06-01T19:00:33.351Z",

__tests__/shared/components/ChallengeTile/__mocks__/develop.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
"technologies": "CSS, HTML, JavaScript",
2323
"status": "COMPLETED",
2424
"legacy": {
25-
"track": "DEVELOP"
25+
"track": "DEVELOP",
26+
"forumId": 39153
2627
},
2728
"subTrack": "FIRST_2_FINISH",
2829
"name": "$100 Eaton PX 2.0 Petting Zoo - MDC Web Enhancement F2F Challenge",
2930
"reviewType": "INTERNAL",
3031
"id": 30060905,
31-
"forumId": 39153,
3232
"numOfSubmissions": 3,
3333
"numOfRegistrants": 8,
3434
"registrationStartDate": "2017-12-02T09:01:23.251Z",
@@ -165,13 +165,13 @@
165165
"technologies": "ReactJS",
166166
"status": "COMPLETED",
167167
"legacy": {
168-
"track": "DEVELOP"
168+
"track": "DEVELOP",
169+
"forumId": 39151
169170
},
170171
"subTrack": "FIRST_2_FINISH",
171172
"name": "$100 Eaton PX 2.0 Petting Zoo - ReactJS Enhancement F2F Challenge",
172173
"reviewType": "INTERNAL",
173174
"id": 30060903,
174-
"forumId": 39151,
175175
"numOfSubmissions": 2,
176176
"numOfRegistrants": 6,
177177
"registrationStartDate": "2017-12-02T09:01:21.329Z",
@@ -323,13 +323,13 @@
323323
"technologies": "Angular 2+, Express, JSON, Node.js",
324324
"status": "COMPLETED",
325325
"legacy": {
326-
"track": "DEVELOP"
326+
"track": "DEVELOP",
327+
"forumId": 38951
327328
},
328329
"subTrack": "FIRST_2_FINISH",
329330
"name": "$500 BG800 Online Course Mock Rest API F2F Challenge",
330331
"reviewType": "INTERNAL",
331332
"id": 30060687,
332-
"forumId": 38951,
333333
"numOfSubmissions": 14,
334334
"numOfRegistrants": 18,
335335
"registrationStartDate": "2017-11-24T13:27:44.751Z",
@@ -631,13 +631,13 @@
631631
"technologies": "JavaScript, ReactJS",
632632
"status": "COMPLETED",
633633
"legacy": {
634-
"track": "DEVELOP"
634+
"track": "DEVELOP",
635+
"forumId": 38702
635636
},
636637
"subTrack": "FIRST_2_FINISH",
637638
"name": "John Hancock - Giving Tuesday - General image handling",
638639
"reviewType": "INTERNAL",
639640
"id": 30060425,
640-
"forumId": 38702,
641641
"numOfSubmissions": 3,
642642
"numOfRegistrants": 17,
643643
"registrationStartDate": "2017-11-11T02:02:21.127Z",

__tests__/shared/components/ProfilePage/Stats/SubTrackChallengeView/GalleryModal/__mocks__/challenge.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@
8383
"name": "2016 Topcoder Open Logo Design Challenge",
8484
"reviewType": "INTERNAL",
8585
"id": 30051059,
86-
"forumId": 598066,
86+
"legacy": {
87+
"forumId": 598066
88+
},
8789
"numOfSubmissions": 57,
8890
"numOfRegistrants": 111,
8991
"registrationStartDate": "2015-08-10T13:00:01.576Z",

__tests__/shared/components/ProfilePage/Stats/SubTrackChallengeView/__mocks__/develop.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
"name": "$100 Eaton PX 2.0 Petting Zoo - MDC Web Enhancement F2F Challenge",
3636
"reviewType": "INTERNAL",
3737
"id": 30060905,
38-
"forumId": 39153,
38+
"legacy": {
39+
"forumId": 39153
40+
},
3941
"numOfSubmissions": 3,
4042
"numOfRegistrants": 8,
4143
"registrationStartDate": "2017-12-02T09:01:23.251Z",
@@ -189,7 +191,9 @@
189191
"name": "$100 Eaton PX 2.0 Petting Zoo - ReactJS Enhancement F2F Challenge",
190192
"reviewType": "INTERNAL",
191193
"id": 30060903,
192-
"forumId": 39151,
194+
"legacy": {
195+
"forumId": 38951
196+
},
193197
"numOfSubmissions": 2,
194198
"numOfRegistrants": 6,
195199
"registrationStartDate": "2017-12-02T09:01:21.329Z",
@@ -385,7 +389,9 @@
385389
"name": "$500 BG800 Online Course Mock Rest API F2F Challenge",
386390
"reviewType": "INTERNAL",
387391
"id": 30060687,
388-
"forumId": 38951,
392+
"legacy": {
393+
"forumId": 38951
394+
},
389395
"numOfSubmissions": 14,
390396
"numOfRegistrants": 18,
391397
"registrationStartDate": "2017-11-24T13:27:44.751Z",
@@ -713,7 +719,9 @@
713719
"name": "John Hancock - Giving Tuesday - General image handling",
714720
"reviewType": "INTERNAL",
715721
"id": 30060425,
716-
"forumId": 38702,
722+
"legacy": {
723+
"forumId": 38702
724+
},
717725
"numOfSubmissions": 3,
718726
"numOfRegistrants": 17,
719727
"registrationStartDate": "2017-11-11T02:02:21.127Z",

__tests__/shared/components/ProfilePage/Stats/SubTrackChallengeView/__snapshots__/index.jsx.snap

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,14 @@ exports[`SubtrackChallengeView matches shallow snapshot 1`] = `
107107
"projectId": 30060905,
108108
},
109109
],
110-
"forumId": 39153,
111110
"groupIds": null,
112111
"handle": "thomaskranitsas",
113112
"id": 30060905,
114113
"isPrivate": false,
115114
"isTask": false,
115+
"legacy": Object {
116+
"forumId": 39153,
117+
},
116118
"name": "$100 Eaton PX 2.0 Petting Zoo - MDC Web Enhancement F2F Challenge",
117119
"numOfRegistrants": 8,
118120
"numOfSubmissions": 3,
@@ -285,12 +287,14 @@ exports[`SubtrackChallengeView matches shallow snapshot 1`] = `
285287
"projectId": 30060903,
286288
},
287289
],
288-
"forumId": 39151,
289290
"groupIds": null,
290291
"handle": "thomaskranitsas",
291292
"id": 30060903,
292293
"isPrivate": false,
293294
"isTask": false,
295+
"legacy": Object {
296+
"forumId": 38951,
297+
},
294298
"name": "$100 Eaton PX 2.0 Petting Zoo - ReactJS Enhancement F2F Challenge",
295299
"numOfRegistrants": 6,
296300
"numOfSubmissions": 2,
@@ -633,12 +637,14 @@ exports[`SubtrackChallengeView matches shallow snapshot 1`] = `
633637
"projectId": 30060687,
634638
},
635639
],
636-
"forumId": 38951,
637640
"groupIds": null,
638641
"handle": "thomaskranitsas",
639642
"id": 30060687,
640643
"isPrivate": false,
641644
"isTask": false,
645+
"legacy": Object {
646+
"forumId": 38951,
647+
},
642648
"name": "$500 BG800 Online Course Mock Rest API F2F Challenge",
643649
"numOfRegistrants": 18,
644650
"numOfSubmissions": 14,
@@ -867,12 +873,14 @@ exports[`SubtrackChallengeView matches shallow snapshot 1`] = `
867873
"projectId": 30060425,
868874
},
869875
],
870-
"forumId": 38702,
871876
"groupIds": null,
872877
"handle": "thomaskranitsas",
873878
"id": 30060425,
874879
"isPrivate": false,
875880
"isTask": false,
881+
"legacy": Object {
882+
"forumId": 38702,
883+
},
876884
"name": "John Hancock - Giving Tuesday - General image handling",
877885
"numOfRegistrants": 17,
878886
"numOfSubmissions": 3,

__tests__/shared/components/SubmissionManagement/__mocks__/design-submissions.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"name": "Test Design Challenge for Submission Management Page",
1212
"reviewType": "INTERNAL",
1313
"id": 30050696,
14-
"forumId": 595805,
14+
"legacy": {
15+
"forumId": 595805
16+
},
1517
"numOfSubmissions": 0,
1618
"numOfRegistrants": 4,
1719
"registrationStartDate": "2017-03-27T20:38:52.000Z",

src/shared/components/Dashboard/Program/IosCard.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import './IosCard.scss';
99
const IosCard = (props) => {
1010
const { challenge } = props;
1111
const { legacy } = challenge;
12-
const { track } = legacy;
12+
const { track, forumId } = legacy;
1313
return (
1414
<div styleName={`challenge tile-view ${track}`}>
1515
<div styleName="challenge-track" />
@@ -39,7 +39,7 @@ const IosCard = (props) => {
3939
</p>
4040
</a>
4141
</div>
42-
<a href={`${config.URL.FORUMS}/?module=Category&categoryID=${challenge.forumId}`} styleName="forum">
42+
<a href={`${config.URL.FORUMS}/?module=Category&categoryID=${forumId}`} styleName="forum">
4343
<div styleName="forum-icon" />
4444
<p>
4545
Posts

src/shared/components/challenge-detail/Header/TabSelector/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default function ChallengeViewSelector(props) {
3333
mySubmissions,
3434
} = props;
3535

36-
const forumId = _.get(challenge, 'forumId') || 0;
36+
const forumId = _.get(challenge, 'legacy.forumId') || 0;
3737
const roles = _.get(challenge, 'userDetails.roles') || [];
3838

3939
const forumEndpoint = trackLower === 'design'
@@ -199,8 +199,8 @@ ChallengeViewSelector.propTypes = {
199199
isLoggedIn: PT.bool,
200200
challenge: PT.shape({
201201
subTrack: PT.any,
202-
details: PT.shape({
203-
forumId: PT.number.isRequired,
202+
legacy: PT.shape({
203+
forumId: PT.number,
204204
}),
205205
userDetails: PT.shape({
206206
roles: PT.arrayOf(PT.string),

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export default function ChallengeDetailsView(props) {
3838
} = props;
3939

4040
const {
41-
forumId,
4241
groups,
4342
description,
4443
privateDescription,
@@ -53,7 +52,12 @@ export default function ChallengeDetailsView(props) {
5352

5453
const tags = challenge.tags || [];
5554
const roles = (userDetails || {}).roles || [];
56-
const { track, reviewScorecardId, screeningScorecardId } = legacy;
55+
const {
56+
track,
57+
reviewScorecardId,
58+
screeningScorecardId,
59+
forumId,
60+
} = legacy;
5761

5862
const allowStockArt = _.find(metadata, { type: 'allowStockArt' });
5963
let environment = '';
@@ -415,9 +419,9 @@ ChallengeDetailsView.propTypes = {
415419
track: PT.string.isRequired,
416420
reviewScorecardId: PT.string,
417421
screeningScorecardId: PT.string,
422+
forumId: PT.number,
418423
}),
419424
groups: PT.any,
420-
forumId: PT.number,
421425
reviewType: PT.string,
422426
tags: PT.arrayOf(PT.string),
423427
numberOfCheckpointsPrizes: PT.number,

src/shared/components/challenge-listing/ChallengeCard/Status/index.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ export default function ChallengeStatus(props) {
164164
* the common code being used in both places. */
165165
function completedChallenge() {
166166
const { challenge } = props;
167+
const forumId = _.get(challenge, 'legacy.forumId') || 0;
167168
return (
168169
<div>
169170
{renderLeaderboard()}
@@ -191,7 +192,7 @@ export default function ChallengeStatus(props) {
191192
challenge.myChallenge
192193
&& (
193194
<div styleName="spacing">
194-
<a styleName="link-forum past" href={`${FORUM_URL}${challenge.forumId}`}>
195+
<a styleName="link-forum past" href={`${FORUM_URL}${forumId}`}>
195196
<ForumIcon />
196197
</a>
197198
</div>
@@ -205,12 +206,12 @@ export default function ChallengeStatus(props) {
205206
function activeChallenge() {
206207
const { challenge } = props;
207208
const {
208-
forumId,
209209
myChallenge,
210210
status,
211211
subTrack,
212212
} = challenge;
213213
const allPhases = challenge.phases || [];
214+
const forumId = _.get(challenge, 'legacy.forumId') || 0;
214215

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

0 commit comments

Comments
 (0)