diff --git a/config/default.js b/config/default.js index 542134c966..7de679aec0 100644 --- a/config/default.js +++ b/config/default.js @@ -401,6 +401,4 @@ module.exports = { TC_EDU_ARTICLES_PATH: '/articles', TC_EDU_SEARCH_PATH: '/search', TC_EDU_SEARCH_BAR_MAX_RESULTS_EACH_GROUP: 3, - // SRM ChallengeType ID - SRM_TYPE_ID: '7494c009-b425-45c5-923a-fd3a6ace3196', }; diff --git a/src/shared/actions/challenge-listing/index.js b/src/shared/actions/challenge-listing/index.js index b358113edb..ae9c5aeb5e 100644 --- a/src/shared/actions/challenge-listing/index.js +++ b/src/shared/actions/challenge-listing/index.js @@ -8,7 +8,6 @@ import { decodeToken } from 'tc-accounts'; import 'isomorphic-fetch'; import { processSRM } from 'utils/tc'; import { errors, services } from 'topcoder-react-lib'; -import { config } from 'topcoder-react-utils'; const { fireErrorMessage } = errors; const { getService } = services.challenge; @@ -292,11 +291,7 @@ function getSrmsInit(uuid) { */ function getSrmsDone(uuid, handle, params, tokenV3) { const service = getService(tokenV3); - const newParams = { - ...params, - typeId: config.SRM_TYPE_ID, - }; - const promises = [service.getSrms(newParams)]; + const promises = [service.getSrms(params)]; if (handle) { promises.push(service.getUserSrms(handle, params)); } diff --git a/src/shared/components/Dashboard/CurrentActivity/Challenges/ChallengeCard/index.jsx b/src/shared/components/Dashboard/CurrentActivity/Challenges/ChallengeCard/index.jsx index a6a18841ae..e87b28375b 100644 --- a/src/shared/components/Dashboard/CurrentActivity/Challenges/ChallengeCard/index.jsx +++ b/src/shared/components/Dashboard/CurrentActivity/Challenges/ChallengeCard/index.jsx @@ -46,18 +46,17 @@ export default function ChallengeCard({ }) { const { currentPhases, - forumId, + legacy, id, registrationStartDate, status, subTrack, - track, userDetails, } = challenge; let EventTag; // let TrackTag; - switch (track) { + switch (legacy.track) { case 'DATA_SCIENCE': EventTag = DataScienceTrackEventTag; // TrackTag = DataScienceTrackTag; @@ -73,9 +72,9 @@ export default function ChallengeCard({ default: } - const forumEndpoint = _.toLower(track) === 'design' - ? `/?module=ThreadList&forumID=${forumId}` - : `/?module=Category&categoryID=${forumId}`; + const forumEndpoint = _.toLower(legacy.track) === 'design' + ? `/?module=ThreadList&forumID=${legacy.forumId}` + : `/?module=Category&categoryID=${legacy.forumId}`; const isTco = challenge.events && challenge.events.find(x => x.eventName.match(/tco\d{2}/)); @@ -275,10 +274,12 @@ export default function ChallengeCard({ ChallengeCard.propTypes = { challenge: PT.shape({ - forumId: PT.number.isRequired, - id: PT.number.isRequired, + legacy: PT.shape({ + track: PT.oneOf(['DATA_SCIENCE', 'DESIGN', 'DEVELOP']).isRequired, + forumId: PT.oneOfType([PT.number, PT.string]), + }).isRequired, + id: PT.oneOfType([PT.number, PT.string]).isRequired, name: PT.string.isRequired, - track: PT.oneOf(['DATA_SCIENCE', 'DESIGN', 'DEVELOP']).isRequired, currentPhases: PT.any, registrationStartDate: PT.any, status: PT.any, diff --git a/src/shared/containers/Dashboard/index.jsx b/src/shared/containers/Dashboard/index.jsx index 5650334bea..c375466e30 100644 --- a/src/shared/containers/Dashboard/index.jsx +++ b/src/shared/containers/Dashboard/index.jsx @@ -337,6 +337,7 @@ function mapStateToProps(state, props) { finances: finances.data, financesLoading: Boolean(finances.loadingUuid), financesTimestamp: finances.timestamp, + handle: userHandle, profile: state.auth.profile, showChallengeFilter: dash.showChallengeFilter, showEarnings: dash.showEarnings,