Skip to content

Commit ce63e59

Browse files
Merge pull request #5192 from topcoder-platform/new-forums
Hotfix 2 - Smoke Testing 2020/11/12 - New forums
2 parents 9f13621 + 4c1767f commit ce63e59

File tree

3 files changed

+36
-30
lines changed

3 files changed

+36
-30
lines changed

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

+15-13
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,21 @@ export default function ChallengeViewSelector(props) {
178178
}
179179
{ (() => {
180180
if (hasRegistered || Boolean(roles.length)) {
181-
if (_.isEmpty(discuss)) {
181+
if (!_.isEmpty(discuss)) {
182+
return (
183+
discuss.map(d => (
184+
<a
185+
href={d.url}
186+
styleName={getSelectorStyle(selectedView, DETAIL_TABS.CHALLENGE_FORUM)}
187+
target="_blank"
188+
rel="oopener noreferrer"
189+
>
190+
CHALLENGE DISCUSSION
191+
</a>
192+
))
193+
);
194+
}
195+
if (forumId > 0) {
182196
return (
183197
<a
184198
href={`${config.URL.FORUMS}${forumEndpoint}`}
@@ -190,18 +204,6 @@ export default function ChallengeViewSelector(props) {
190204
</a>
191205
);
192206
}
193-
return (
194-
discuss.map(d => (
195-
<a
196-
href={d.url}
197-
styleName={getSelectorStyle(selectedView, DETAIL_TABS.CHALLENGE_FORUM)}
198-
target="_blank"
199-
rel="oopener noreferrer"
200-
>
201-
CHALLENGE DISCUSSION
202-
</a>
203-
))
204-
);
205207
}
206208
return '';
207209
})()}

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

+15-13
Original file line numberDiff line numberDiff line change
@@ -322,19 +322,21 @@ export default function SideBar({
322322
pass screening.
323323
</a>
324324
</p>
325-
<p styleName="link-like-paragraph">
326-
Questions?
327-
&zwnj;
328-
{_.isEmpty(discuss) && (
329-
<a
330-
href={forumLink}
331-
target="_blank"
332-
rel="oopener noreferrer"
333-
>
334-
Ask in the Challenge Discussion Forums.
335-
</a>
336-
)}
337-
</p>
325+
{(forumLink || !_.isEmpty(discuss)) && (
326+
<p styleName="link-like-paragraph">
327+
Questions?
328+
&zwnj;
329+
{_.isEmpty(discuss) && (
330+
<a
331+
href={forumLink}
332+
target="_blank"
333+
rel="oopener noreferrer"
334+
>
335+
Ask in the Challenge Discussion Forums.
336+
</a>
337+
)}
338+
</p>
339+
)}
338340
{!_.isEmpty(discuss) && (
339341
<ul>
340342
{ discuss.map(d => (

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

+6-4
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ export default function ChallengeDetailsView(props) {
8080
d.type === 'challenge' && !_.isEmpty(d.url)
8181
));
8282

83-
let forumLink = track.toLowerCase() === 'design'
84-
? `/?module=ThreadList&forumID=${forumId}`
85-
: `/?module=Category&categoryID=${forumId}`;
86-
forumLink = `${config.URL.FORUMS}${forumLink}`;
83+
let forumLink = '';
84+
if (forumId > 0) {
85+
forumLink = track.toLowerCase() === 'design'
86+
? `/?module=ThreadList&forumID=${forumId}`
87+
: `/?module=Category&categoryID=${forumId}`;
88+
}
8789

8890
let isWipro = false;
8991
const wiproCommunity = communitiesList.find(x => x.communityId === 'wipro');

0 commit comments

Comments
 (0)