Skip to content

Fix MM challenge links #4396

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 1 commit into from
May 23, 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 @@ -211,7 +211,7 @@ export default class HistoryGraph extends React.Component {
}
if (track === 'DATA_SCIENCE') {
if (subTrack === 'MARATHON_MATCH') {
return `${config.URL.COMMUNITY}/tc?module=MatchDetails&rd=${challengeId}`;
return `/challenges/${challengeId}`;
}
if (subTrack === 'SRM') {
return `${config.URL.COMMUNITY}/stat?c=round_overview&rd=${challengeId}`;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import _ from 'lodash';
import PT from 'prop-types';
import { config, Link } from 'topcoder-react-utils';
import { Link } from 'topcoder-react-utils';
import moment from 'moment';
import { TABS as DETAIL_TABS } from 'actions/page/challenge-details';
import {
Expand Down Expand Up @@ -32,19 +32,14 @@ export default function ChallengesCard({
}) {
const {
id,
subTrack,
legacy,
status,
allPhases,
currentPhases,
} = challenge;

const { track } = legacy;

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

const checkPhases = (currentPhases && currentPhases.length > 0 ? currentPhases : allPhases);
const statusPhase = checkPhases
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import React from 'react';
import PT from 'prop-types';
import TrackIcon from 'components/TrackIcon';
import { TABS as DETAIL_TABS } from 'actions/page/challenge-details';
import { config, Link } from 'topcoder-react-utils';
import { isMM, isDevelopMM } from 'utils/challenge';
import { Link } from 'topcoder-react-utils';
import { isDevelopMM } from 'utils/challenge';
import {
getEndDate,
PRIZE_MODE,
Expand Down Expand Up @@ -42,7 +42,6 @@ function ChallengeCard({
const challenge = passedInChallenge;
const {
id,
status,
legacy,
} = challenge;

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

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

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