Skip to content

Commit 739b241

Browse files
authored
Merge pull request #4396 from topcoder-platform/issue-4379
Fix MM challenge links
2 parents b36afcf + 3eec145 commit 739b241

File tree

3 files changed

+6
-15
lines changed
  • src/shared/components
    • ProfilePage/Stats/HistoryGraph
    • challenge-detail/RecommendedActiveChallenges/ChallengesCard
    • challenge-listing/ChallengeCard

3 files changed

+6
-15
lines changed

src/shared/components/ProfilePage/Stats/HistoryGraph/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export default class HistoryGraph extends React.Component {
211211
}
212212
if (track === 'DATA_SCIENCE') {
213213
if (subTrack === 'MARATHON_MATCH') {
214-
return `${config.URL.COMMUNITY}/tc?module=MatchDetails&rd=${challengeId}`;
214+
return `/challenges/${challengeId}`;
215215
}
216216
if (subTrack === 'SRM') {
217217
return `${config.URL.COMMUNITY}/stat?c=round_overview&rd=${challengeId}`;

src/shared/components/challenge-detail/RecommendedActiveChallenges/ChallengesCard/index.jsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import _ from 'lodash';
33
import PT from 'prop-types';
4-
import { config, Link } from 'topcoder-react-utils';
4+
import { Link } from 'topcoder-react-utils';
55
import moment from 'moment';
66
import { TABS as DETAIL_TABS } from 'actions/page/challenge-details';
77
import {
@@ -32,19 +32,14 @@ export default function ChallengesCard({
3232
}) {
3333
const {
3434
id,
35-
subTrack,
3635
legacy,
37-
status,
3836
allPhases,
3937
currentPhases,
4038
} = challenge;
4139

4240
const { track } = legacy;
4341

44-
let challengeDetailLink = `${challengesUrl}/${id}`;
45-
if (track === 'DATA_SCIENCE' && subTrack === 'MARATHON_MATCH' && status === 'Active') {
46-
challengeDetailLink = `${config.URL.COMMUNITY}/tc?module=MatchDetails&rd=${id}`;
47-
}
42+
const challengeDetailLink = `${challengesUrl}/${id}`;
4843

4944
const checkPhases = (currentPhases && currentPhases.length > 0 ? currentPhases : allPhases);
5045
const statusPhase = checkPhases

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import React from 'react';
33
import PT from 'prop-types';
44
import TrackIcon from 'components/TrackIcon';
55
import { TABS as DETAIL_TABS } from 'actions/page/challenge-details';
6-
import { config, Link } from 'topcoder-react-utils';
7-
import { isMM, isDevelopMM } from 'utils/challenge';
6+
import { Link } from 'topcoder-react-utils';
7+
import { isDevelopMM } from 'utils/challenge';
88
import {
99
getEndDate,
1010
PRIZE_MODE,
@@ -42,7 +42,6 @@ function ChallengeCard({
4242
const challenge = passedInChallenge;
4343
const {
4444
id,
45-
status,
4645
legacy,
4746
} = challenge;
4847

@@ -53,10 +52,7 @@ function ChallengeCard({
5352
}
5453
challenge.prize = challenge.prizes || [];
5554

56-
let challengeDetailLink = `${challengesUrl}/${id}`;
57-
if (track === 'DATA_SCIENCE' && isMM(challenge) && status === 'Active') {
58-
challengeDetailLink = `${config.URL.COMMUNITY}/tc?module=MatchDetails&rd=${id}`;
59-
}
55+
const challengeDetailLink = `${challengesUrl}/${id}`;
6056

6157
const subTrack = getChallengeSubTrack(challenge.type, challengeTypes);
6258
if (subTrack === 'DEVELOP_MARATHON_MATCH') {

0 commit comments

Comments
 (0)