diff --git a/package.json b/package.json index 719076c89e..36a5ba9991 100644 --- a/package.json +++ b/package.json @@ -140,7 +140,7 @@ "supertest": "^3.1.0", "tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.3", "tc-ui": "^1.0.12", - "topcoder-react-lib": "1.1.1", + "topcoder-react-lib": "1000.25.7", "topcoder-react-ui-kit": "2.0.1", "topcoder-react-utils": "0.7.8", "turndown": "^4.0.2", diff --git a/src/shared/components/ProfilePage/Stats/SubTrackChallengeView/index.jsx b/src/shared/components/ProfilePage/Stats/SubTrackChallengeView/index.jsx index 332374de38..6bd154dc37 100644 --- a/src/shared/components/ProfilePage/Stats/SubTrackChallengeView/index.jsx +++ b/src/shared/components/ProfilePage/Stats/SubTrackChallengeView/index.jsx @@ -13,6 +13,7 @@ import shortId from 'shortid'; import ChallengeTile from 'components/ChallengeTile'; import SRMTile from 'components/SRMTile'; import { actions } from 'topcoder-react-lib'; +import { OLD_COMPETITION_TRACKS, COMPETITION_TRACKS } from 'utils/tc'; import LoadingIndicator from 'components/LoadingIndicator'; import GalleryModal from './GalleryModal'; import './style.scss'; @@ -104,6 +105,27 @@ const processPastChallenge = (challenge) => { } else { cloned.numImages = 0; } + + if (!cloned.type) { + cloned.type = cloned.subTrack; + } + + switch (cloned.track) { + case OLD_COMPETITION_TRACKS.DATA_SCIENCE: + cloned.track = COMPETITION_TRACKS.DS; + break; + case OLD_COMPETITION_TRACKS.DESIGN: + cloned.track = COMPETITION_TRACKS.DES; + break; + case OLD_COMPETITION_TRACKS.DEVELOP: + cloned.track = COMPETITION_TRACKS.DEV; + break; + case OLD_COMPETITION_TRACKS.QA: + cloned.track = COMPETITION_TRACKS.QA; + break; + default: + break; + } } return cloned; }; @@ -421,7 +443,6 @@ function mapDispatchToProps(dispatch) { pageNum, pageSize, refresh, - userId, ) => { const uuid = shortId(); dispatch(action.getSubtrackChallengesInit(handle, uuid)); @@ -434,7 +455,6 @@ function mapDispatchToProps(dispatch) { pageNum, pageSize, refresh, - userId, )); }, loadSRM: (handle, tokenV3, pageNum, pageSize, refresh) => { diff --git a/src/shared/utils/tc.js b/src/shared/utils/tc.js index 8475ee8a05..73a0f84699 100644 --- a/src/shared/utils/tc.js +++ b/src/shared/utils/tc.js @@ -11,6 +11,7 @@ import { config, isomorphy } from 'topcoder-react-utils'; import { tc } from 'topcoder-react-lib'; export const { + OLD_COMPETITION_TRACKS, COMPETITION_TRACKS, CHALLENGE_STATUS, REVIEW_OPPORTUNITY_TYPES,