Skip to content

Commit 5c3de45

Browse files
Issue#4641 : Fix forum link
1 parent 473933e commit 5c3de45

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

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)