@@ -379,8 +379,14 @@ export default class Registrants extends React.Component {
{
sortedRegistrants.map((r) => {
- const placement = getPlace(results, r.handle, places);
- const colorStyle = JSON.parse(r.colorStyle.replace(/(\w+):\s*([^;]*)/g, '{"$1": "$2"}'));
+ const placement = getPlace(results, r.memberHandle, places);
+ /*
+ * TODO: Need check as get this back, currenlty V5 API missing this data
+ * = JSON.parse(r.colorStyle.replace(/(\w+):\s*([^;]*)/g, '{"$1": "$2"}'));
+ */
+ const colorStyle = {
+ color: '#000000',
+ };
let checkpoint = this.getCheckPoint(r);
if (checkpoint) {
checkpoint = formatDate(checkpoint);
@@ -393,7 +399,7 @@ export default class Registrants extends React.Component {
}
return (
-
+
{
!isDesign && !isF2F && !isBugHunt && (
@@ -411,11 +417,11 @@ export default class Registrants extends React.Component {
@@ -423,7 +429,7 @@ export default class Registrants extends React.Component {
Registration Date
-
{formatDate(r.registrationDate)}
+
{formatDate(r.created)}
{
twoRounds
@@ -437,7 +443,7 @@ export default class Registrants extends React.Component {
{checkpoint}
{
- passedCheckpoint(checkpoints, r.handle, checkpointResults)
+ passedCheckpoint(checkpoints, r.memberHandle, checkpointResults)
&&
}
@@ -482,16 +488,16 @@ Registrants.propTypes = {
challenge: PT.shape({
phases: PT.arrayOf(PT.shape({
actualEndDate: PT.string,
- phaseType: PT.string.isRequired,
+ name: PT.string.isRequired,
scheduledEndDate: PT.string,
})).isRequired,
allPhases: PT.arrayOf(PT.shape()),
checkpoints: PT.arrayOf(PT.shape()),
legacy: PT.shape({
- track: PT.any,
+ track: PT.string,
}),
- subTrack: PT.any,
- prizes: PT.arrayOf(PT.number).isRequired,
+ type: PT.string,
+ prizeSets: PT.arrayOf(PT.shape()).isRequired,
registrants: PT.arrayOf(PT.shape()).isRequired,
round1Introduction: PT.string,
round2Introduction: PT.string,
diff --git a/src/shared/components/challenge-detail/Specification/SideBar/index.jsx b/src/shared/components/challenge-detail/Specification/SideBar/index.jsx
index 0ace088c75..4602d9602b 100644
--- a/src/shared/components/challenge-detail/Specification/SideBar/index.jsx
+++ b/src/shared/components/challenge-detail/Specification/SideBar/index.jsx
@@ -36,7 +36,7 @@ export default function SideBar({
const faqURL = config.URL.INFO.DESIGN_CHALLENGE_SUBMISSION;
let submissionLimitDisplay = 'Unlimited';
const submissionLimit = _.find(metadata, { type: 'submissionLimit' });
- const fileTypes = _.find(metadata, { type: 'fileTypes' });
+ const fileTypes = _.find(metadata, { name: 'fileTypes' });
if (submissionLimit) {
if (submissionLimit.value === 1) {
diff --git a/src/shared/components/challenge-detail/Submissions/index.jsx b/src/shared/components/challenge-detail/Submissions/index.jsx
index a7936abc70..b975a8d387 100644
--- a/src/shared/components/challenge-detail/Submissions/index.jsx
+++ b/src/shared/components/challenge-detail/Submissions/index.jsx
@@ -327,8 +327,8 @@ class SubmissionsComponent extends React.Component {
);
- const isF2F = challenge.subTrack.indexOf('FIRST_2_FINISH') > -1;
- const isBugHunt = challenge.subTrack.indexOf('BUG_HUNT') > -1;
+ const isF2F = challenge.type.toLowerCase().indexOf('first2finish') > -1;
+ const isBugHunt = challenge.type.toLowerCase() === 'bug hunt';
// copy colorStyle from registrants to submissions
_.forEach(sortedSubmissions, (s) => {
@@ -785,7 +785,7 @@ SubmissionsComponent.propTypes = {
registrants: PT.any,
allPhases: PT.any,
phases: PT.any,
- subTrack: PT.any,
+ type: PT.any,
}).isRequired,
toggleSubmissionHistory: PT.func.isRequired,
submissionHistoryOpen: PT.shape({}).isRequired,
diff --git a/src/shared/components/challenge-listing/ChallengeCard/index.jsx b/src/shared/components/challenge-listing/ChallengeCard/index.jsx
index 7e3da661a0..97cef46625 100644
--- a/src/shared/components/challenge-listing/ChallengeCard/index.jsx
+++ b/src/shared/components/challenge-listing/ChallengeCard/index.jsx
@@ -71,7 +71,7 @@ function ChallengeCard({
0 ? challenge.events[0].eventName : ''}
+ tcoEligible={!_.isEmpty(challenge.events) ? challenge.events[0].eventName : ''}
isDataScience={challenge.isDataScience}
/>
diff --git a/src/shared/containers/challenge-detail/index.jsx b/src/shared/containers/challenge-detail/index.jsx
index 63013b6476..f4ce7ef42b 100644
--- a/src/shared/containers/challenge-detail/index.jsx
+++ b/src/shared/containers/challenge-detail/index.jsx
@@ -116,7 +116,7 @@ function isRegistered(details, registrants, handle) {
if (details && details.roles && details.roles.includes('Submitter')) {
return true;
}
- if (_.find(registrants, r => _.toString(r.handle) === _.toString(handle))) {
+ if (_.find(registrants, r => _.toString(r.memberHandle) === _.toString(handle))) {
return true;
}
return false;
@@ -231,6 +231,7 @@ class ChallengeDetailPageContainer extends React.Component {
challenge
&& challenge.id === challengeId
&& !loadingRecommendedChallengesUUID
+ && recommendedTechnology
&& (
!recommendedChallenges[recommendedTechnology]
|| (
@@ -731,7 +732,7 @@ function mapStateToProps(state, props) {
if (challenge.submissions) {
challenge.submissions = challenge.submissions.map(submission => ({
...submission,
- registrant: _.find(challenge.registrants, { handle: submission.submitter }),
+ registrant: _.find(challenge.registrants, { memberHandle: submission.createdBy }),
}));
}
@@ -739,7 +740,7 @@ function mapStateToProps(state, props) {
mmSubmissions = mmSubmissions.map((submission) => {
let registrant;
let { member } = submission;
- if (auth.user.handle === submission.member) {
+ if (auth.user.handle === submission.memberHandle) {
mySubmissions = submission.submissions || [];
mySubmissions = mySubmissions.map((mySubmission, index) => {
// eslint-disable-next-line no-param-reassign
diff --git a/src/shared/reducers/index.js b/src/shared/reducers/index.js
index 6b759c0c7c..a84d236a80 100644
--- a/src/shared/reducers/index.js
+++ b/src/shared/reducers/index.js
@@ -45,12 +45,12 @@ function generateSsrOptions(req) {
const res = {
auth: getAuthTokens(req),
};
- if (req.url.match(/^\/challenges\/\d+\/my-submissions/)) {
- const challengeId = req.url.match(/\d+/)[0];
+ if (req.url.match(/^\/challenges\/(([\w]{4,12}-?){5}|\d+)\/my-submissions/)) {
+ const challengeId = req.url.match(/(([\w]{4,12}-?){5}|\d+)/)[0];
_.set(res, 'challenge.challengeDetails.id', challengeId);
_.set(res, 'challenge.challengeDetails.mySubmission', true);
- } else if (req.url.match(/\/challenges\/\d+([?/].*)?$/)) {
- const challengeId = req.url.match(/\d+/)[0];
+ } else if (req.url.match(/\/challenges\/(([\w]{4,12}-?){5}|\d+)\/?(\?.*)?$/)) {
+ const challengeId = req.url.match(/(([\w]{4,12}-?){5}|\d+)/)[0];
_.set(res, 'challenge.challengeDetails.id', challengeId);
}
@@ -62,8 +62,8 @@ function generateSsrOptions(req) {
let entity;
// if it's challenge details page
- if (req.url.match(/^\/challenges\/\d+/)) {
- const challengeId = req.url.match(/\d+/)[0];
+ if (req.url.match(/^\/challenges\/(([\w]{4,12}-?){5}|\d+)/)) {
+ const challengeId = req.url.match(/(([\w]{4,12}-?){5}|\d+)/)[0];
entity = { type: 'challenge', id: challengeId };
}
diff --git a/src/shared/reducers/reviewOpportunity.js b/src/shared/reducers/reviewOpportunity.js
index 080b6614d4..2bdd61235a 100644
--- a/src/shared/reducers/reviewOpportunity.js
+++ b/src/shared/reducers/reviewOpportunity.js
@@ -15,9 +15,9 @@ import { reducers } from 'topcoder-react-lib';
*/
export function factory(req) {
const options = {};
- if (req && req.url.match(/^\/challenges\/\d{8}\/review-opportunities/)) {
+ if (req && req.url.match(/^\/challenges\/(([\w]{4,12}-?){5}|\d+)\/review-opportunities/)) {
options.auth = getAuthTokens(req);
- const challengeId = req.url.match(/\d+/)[0];
+ const challengeId = req.url.match(/(([\w]{4,12}-?){5}|\d+)/)[0];
_.set(options, 'reviewOpportunity.challenge.id', challengeId);
}
diff --git a/src/shared/reducers/terms.js b/src/shared/reducers/terms.js
index 13c1f54a61..463610a28e 100644
--- a/src/shared/reducers/terms.js
+++ b/src/shared/reducers/terms.js
@@ -322,8 +322,8 @@ export function factory(req) {
let entity;
// if it's challenge details page
- if (req.url.match(/^\/challenges\/\d+/)) {
- const challengeId = req.url.match(/\d+/)[0];
+ if (req.url.match(/^\/challenges\/(([\w]{4,12}-?){5}|\d+)/)) {
+ const challengeId = req.url.match(/(([\w]{4,12}-?){5}|\d+)/)[0];
entity = { type: 'challenge', id: challengeId };
}
diff --git a/src/shared/routes/Communities/Comcast/Routes.jsx b/src/shared/routes/Communities/Comcast/Routes.jsx
index 63684d1ec6..0ff445ff3a 100644
--- a/src/shared/routes/Communities/Comcast/Routes.jsx
+++ b/src/shared/routes/Communities/Comcast/Routes.jsx
@@ -48,7 +48,7 @@ export default function CS({ base, meta }) {
communityId: meta.communityId,
})}
exact
- path={`${base}/work/:challengeId(\\d{8}|\\d{5})`}
+ path={`${base}/work/:challengeId(((([\\w]{4,12}-?){5}|\\d+)))`}
/>
Submission({
@@ -56,7 +56,7 @@ export default function CS({ base, meta }) {
challengesUrl: `${base}/work`,
})}
exact
- path={`${base}/work/:challengeId(\\d{8}|\\d{5})/submit`}
+ path={`${base}/work/:challengeId(((([\\w]{4,12}-?){5}|\\d+)))/submit`}
/>
SubmissionManagement({
@@ -64,7 +64,7 @@ export default function CS({ base, meta }) {
challengesUrl: `${base}/work`,
})}
exact
- path={`${base}/work/:challengeId(\\d{8}|\\d{5})/my-submissions`}
+ path={`${base}/work/:challengeId(((([\\w]{4,12}-?){5}|\\d+))/my-submissions`}
/>
-
+