Skip to content

Commit 09efe5d

Browse files
committed
1 parent 12adaec commit 09efe5d

File tree

2 files changed

+23
-2
lines changed
  • src/shared

2 files changed

+23
-2
lines changed

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

+22-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import shortId from 'shortid';
1313
import ChallengeTile from 'components/ChallengeTile';
1414
import SRMTile from 'components/SRMTile';
1515
import { actions } from 'topcoder-react-lib';
16+
import { OLD_COMPETITION_TRACKS, COMPETITION_TRACKS } from 'utils/tc';
1617
import LoadingIndicator from 'components/LoadingIndicator';
1718
import GalleryModal from './GalleryModal';
1819
import './style.scss';
@@ -104,6 +105,27 @@ const processPastChallenge = (challenge) => {
104105
} else {
105106
cloned.numImages = 0;
106107
}
108+
109+
if (!cloned.type) {
110+
cloned.type = cloned.subTrack;
111+
}
112+
113+
switch (cloned.track) {
114+
case OLD_COMPETITION_TRACKS.DATA_SCIENCE:
115+
cloned.track = COMPETITION_TRACKS.DS;
116+
break;
117+
case OLD_COMPETITION_TRACKS.DESIGN:
118+
cloned.track = COMPETITION_TRACKS.DES;
119+
break;
120+
case OLD_COMPETITION_TRACKS.DEVELOP:
121+
cloned.track = COMPETITION_TRACKS.DEV;
122+
break;
123+
case OLD_COMPETITION_TRACKS.QA:
124+
cloned.track = COMPETITION_TRACKS.QA;
125+
break;
126+
default:
127+
break;
128+
}
107129
}
108130
return cloned;
109131
};
@@ -421,7 +443,6 @@ function mapDispatchToProps(dispatch) {
421443
pageNum,
422444
pageSize,
423445
refresh,
424-
userId,
425446
) => {
426447
const uuid = shortId();
427448
dispatch(action.getSubtrackChallengesInit(handle, uuid));
@@ -434,7 +455,6 @@ function mapDispatchToProps(dispatch) {
434455
pageNum,
435456
pageSize,
436457
refresh,
437-
userId,
438458
));
439459
},
440460
loadSRM: (handle, tokenV3, pageNum, pageSize, refresh) => {

src/shared/utils/tc.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { config, isomorphy } from 'topcoder-react-utils';
1111
import { tc } from 'topcoder-react-lib';
1212

1313
export const {
14+
OLD_COMPETITION_TRACKS,
1415
COMPETITION_TRACKS,
1516
CHALLENGE_STATUS,
1617
REVIEW_OPPORTUNITY_TYPES,

0 commit comments

Comments
 (0)