Skip to content

Commit d7cc87d

Browse files
committed
Merge remote-tracking branch 'origin/integration-v5-challenge-api' into integration-v5-challenge-api-md
2 parents 8c68fa8 + 25ad0ca commit d7cc87d

File tree

24 files changed

+152
-96
lines changed

24 files changed

+152
-96
lines changed

.circleci/config.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,22 +209,21 @@ workflows:
209209
filters:
210210
branches:
211211
only:
212-
- hot-fix
213212
- integration-v5-challenge-api
214213
# This is beta env for production soft releases
215214
- "build-prod-beta":
216215
context : org-global
217216
filters:
218217
branches:
219218
only:
220-
- develop
219+
- integration-v5-challenge-api
221220
# This is stage env for production QA releases
222221
- "build-prod-staging":
223222
context : org-global
224223
filters:
225224
branches:
226225
only:
227-
- integration-v5-challenge-api
226+
- develop
228227
# Production builds are exectuted
229228
# when PR is merged to the master
230229
# Don't change anything in this configuration

__tests__/shared/components/challenge-listing/ChallengeCard/__snapshots__/index.jsx.snap

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ exports[`Matches shallow shapshot shapshot 1 1`] = `
4949
newChallengeDetails={false}
5050
onTechTagClicked={[Function]}
5151
openChallengesInNewTabs={false}
52-
prizeMode="money-usd"
5352
userHandle=""
5453
/>
5554
`;
@@ -93,7 +92,6 @@ exports[`Matches shallow shapshot shapshot 2 1`] = `
9392
newChallengeDetails={false}
9493
onTechTagClicked={[Function]}
9594
openChallengesInNewTabs={false}
96-
prizeMode="money-usd"
9795
userHandle=""
9896
/>
9997
`;
@@ -133,7 +131,6 @@ exports[`Matches shallow shapshot shapshot 3 1`] = `
133131
newChallengeDetails={false}
134132
onTechTagClicked={[Function]}
135133
openChallengesInNewTabs={false}
136-
prizeMode="money-usd"
137134
userHandle=""
138135
/>
139136
`;

package-lock.json

Lines changed: 36 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
"tc-accounts": "git+https://github.com/appirio-tech/accounts-app.git#dev",
136136
"tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.3",
137137
"tc-ui": "^1.0.12",
138-
"topcoder-react-lib": "1000.19.0",
138+
"topcoder-react-lib": "1000.19.4",
139139
"topcoder-react-ui-kit": "^1.0.11",
140140
"topcoder-react-utils": "0.7.8",
141141
"turndown": "^4.0.2",

src/shared/actions/challenge-listing/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ function getAllRecommendedChallengesInit(uuid) {
221221
function getAllRecommendedChallengesDone(uuid, tokenV3, recommendedTags) {
222222
const filter = {
223223
status: 'Active',
224-
tag: recommendedTags,
224+
...(!_.isEmpty(recommendedTags) && { tag: recommendedTags }),
225225
};
226226
return getAllActiveChallengesWithUsersDone(uuid, tokenV3, filter);
227227
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export default class HistoryGraph extends React.Component {
211211
}
212212
if (track === 'DATA_SCIENCE') {
213213
if (subTrack === 'MARATHON_MATCH') {
214-
return `${config.URL.COMMUNITY}/tc?module=MatchDetails&rd=${challengeId}`;
214+
return `/challenges/${challengeId}`;
215215
}
216216
if (subTrack === 'SRM') {
217217
return `${config.URL.COMMUNITY}/stat?c=round_overview&rd=${challengeId}`;

src/shared/components/SubmissionPage/Submit/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ class Submit extends React.Component {
8080
let subPhaseId;
8181

8282
// Submission type logic
83-
if (checkpoint && checkpoint.isActive) {
83+
if (checkpoint && checkpoint.isOpen) {
8484
subType = 'Checkpoint Submission';
8585
subPhaseId = checkpoint.id;
86-
} else if (checkpoint && !checkpoint.isActive && submission && submission.isActive) {
86+
} else if (checkpoint && !checkpoint.isOpen && submission && submission.isOpen) {
8787
subType = 'Contest Submission';
8888
subPhaseId = submission.id;
89-
} else if (finalFix && finalFix.isActive) {
89+
} else if (finalFix && finalFix.isOpen) {
9090
subType = 'Studio Final Fix Submission';
9191
subPhaseId = finalFix.id;
9292
} else {

src/shared/components/TrackIcon/Abbreviation.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ const Abbreviation = {
6464
SRM: 'SRM',
6565
MARATHON_MATCH: 'MM',
6666
DEVELOP_MARATHON_MATCH: 'MM',
67+
FIRST2FINISH: 'F2F',
68+
FIRST_2_FINISH: 'F2F',
6769
},
6870
DATA: {
6971
SRM: 'SRM',

src/shared/components/challenge-detail/Header/ChallengeTags.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ export default function ChallengeTags(props) {
3636
/* TODO: Probably, we don't need this anymore, if we use correct data from
3737
* APIs (they should contain human-readable names, I believe). */
3838
const stylizedSubTrack = (t) => {
39-
if (challengeSubtracksMap[t]) {
40-
return challengeSubtracksMap[t].name;
39+
const filteredSubtrack = Object.values(challengeSubtracksMap)
40+
.filter(subtrack => subtrack.abbreviation === t)[0];
41+
if (filteredSubtrack) {
42+
return filteredSubtrack.name;
4143
}
4244
return (t || '').replace(/_/g, ' ')
4345
.replace(/\w\S*/g, txt => _.capitalize(txt));

src/shared/components/challenge-detail/RecommendedActiveChallenges/ChallengesCard/index.jsx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import _ from 'lodash';
33
import PT from 'prop-types';
4-
import { config, Link } from 'topcoder-react-utils';
4+
import { Link } from 'topcoder-react-utils';
55
import moment from 'moment';
66
import { TABS as DETAIL_TABS } from 'actions/page/challenge-details';
77
import {
@@ -32,23 +32,18 @@ export default function ChallengesCard({
3232
}) {
3333
const {
3434
id,
35-
subTrack,
3635
legacy,
37-
status,
3836
allPhases,
39-
currentPhases,
37+
phases,
4038
} = challenge;
4139

4240
const { track } = legacy;
4341

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

49-
const checkPhases = (currentPhases && currentPhases.length > 0 ? currentPhases : allPhases);
44+
const checkPhases = (phases && phases.length > 0 ? phases : allPhases);
5045
const statusPhase = checkPhases
51-
.filter(p => p.phaseType !== 'Registration')
46+
.filter(p => p.name !== 'Registration')
5247
.sort((a, b) => moment(a.scheduledEndDate).diff(b.scheduledEndDate))[0];
5348

5449
return (
@@ -127,7 +122,7 @@ ChallengesCard.defaultProps = {
127122
};
128123

129124
ChallengesCard.propTypes = {
130-
challenge: PT.arrayOf(PT.object).isRequired,
125+
challenge: PT.shape().isRequired,
131126
challengeTypes: PT.arrayOf(PT.shape()),
132127
className: PT.string,
133128
challengesUrl: PT.string.isRequired,

src/shared/components/challenge-detail/Specification/SideBar/index.jsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ export default function SideBar({
2929
codeRepo,
3030
isMM,
3131
metadata,
32+
reviewScorecardId,
33+
screeningScorecardId,
3234
}) {
3335
const scorecardURL = `${config.URL.ONLINE_REVIEW}/review/actions/ViewScorecard?scid=`;
3436
const faqURL = config.URL.INFO.DESIGN_CHALLENGE_SUBMISSION;
3537
let submissionLimitDisplay = 'Unlimited';
3638
const submissionLimit = _.find(metadata, { type: 'submissionLimit' });
37-
const screeningScorecardId = _.find(metadata, { type: 'screeningScorecardId' });
3839
const fileTypes = _.find(metadata, { type: 'fileTypes' });
3940

4041
if (submissionLimit) {
@@ -172,14 +173,14 @@ export default function SideBar({
172173
}
173174
{
174175
<p styleName="link-like-paragraph">
175-
<a href={`${scorecardURL}${screeningScorecardId ? screeningScorecardId.value : ''}`}>
176+
<a href={`${scorecardURL}${screeningScorecardId}`}>
176177
Screening Scorecard
177178
</a>
178179
</p>
179180
}
180181
{
181182
<span styleName="link-like-paragraph tooltip-container">
182-
<a href={`${scorecardURL}${screeningScorecardId ? screeningScorecardId.value : ''}`}>
183+
<a href={`${scorecardURL}${reviewScorecardId}`}>
183184
Review Scorecard
184185
</a>
185186
<Tooltip id="reviewscorecard-tip" content={reviewScorecardTip} className={styles['tooltip-overlay']} trigger={['hover', 'focus']}>
@@ -347,7 +348,9 @@ SideBar.defaultProps = {
347348
environment: '',
348349
codeRepo: '',
349350
isMM: false,
350-
metadata: [],
351+
metadata: {},
352+
reviewScorecardId: '',
353+
screeningScorecardId: '',
351354
};
352355

353356
SideBar.propTypes = {
@@ -367,5 +370,7 @@ SideBar.propTypes = {
367370
environment: PT.string,
368371
codeRepo: PT.string,
369372
isMM: PT.bool,
370-
metadata: PT.arrayOf(PT.shape()),
373+
metadata: PT.shape(),
374+
reviewScorecardId: PT.string,
375+
screeningScorecardId: PT.string,
371376
};

src/shared/components/challenge-detail/Specification/index.jsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ export default function ChallengeDetailsView(props) {
4949
codeRepo,
5050
userDetails,
5151
metadata,
52+
events,
5253
} = challenge;
5354

5455
const tags = challenge.tags || [];
5556
const roles = (userDetails || {}).roles || [];
56-
const { track } = legacy;
57+
const { track, reviewScorecardId, screeningScorecardId } = legacy;
5758

5859
const allowStockArt = _.find(metadata, { type: 'allowStockArt' });
5960

@@ -400,12 +401,15 @@ export default function ChallengeDetailsView(props) {
400401
hasRegistered={hasRegistered}
401402
isDesign={track.toLowerCase() === 'design'}
402403
isDevelop={track.toLowerCase() === 'develop'}
404+
eventDetail={_.isEmpty(events) ? null : events[0]}
403405
isMM={isMM(challenge)}
404406
terms={terms}
405407
shareable={_.isEmpty(groups)}
406408
environment={environment}
407409
codeRepo={codeRepo}
408410
metadata={metadata}
411+
reviewScorecardId={reviewScorecardId}
412+
screeningScorecardId={screeningScorecardId}
409413
/>
410414
</div>
411415
</div>
@@ -425,7 +429,10 @@ ChallengeDetailsView.defaultProps = {
425429
environment: '',
426430
descriptionFormat: 'HTML',
427431
codeRepo: '',
428-
metadata: [],
432+
metadata: {},
433+
events: [],
434+
reviewScorecardId: '',
435+
screeningScorecardId: '',
429436
},
430437
};
431438

@@ -441,6 +448,8 @@ ChallengeDetailsView.propTypes = {
441448
privateDescription: PT.string,
442449
legacy: PT.shape({
443450
track: PT.string.isRequired,
451+
reviewScorecardId: PT.string,
452+
screeningScorecardId: PT.string,
444453
}),
445454
groups: PT.any,
446455
forumId: PT.number,
@@ -453,7 +462,8 @@ ChallengeDetailsView.propTypes = {
453462
userDetails: PT.shape({
454463
roles: PT.arrayOf(PT.string).isRequired,
455464
}),
456-
metadata: PT.arrayOf(PT.shape()),
465+
metadata: PT.shape(),
466+
events: PT.arrayOf(PT.string),
457467
}),
458468
challengesUrl: PT.string.isRequired,
459469
communitiesList: PT.arrayOf(PT.shape({

src/shared/components/challenge-detail/Submissions/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ class SubmissionsComponent extends React.Component {
245245

246246
let isReviewPhaseComplete = false;
247247
_.forEach(allPhases, (phase) => {
248-
if (phase.name === 'Review' && !phase.isActive) {
248+
if (phase.name === 'Review' && !phase.isOpen) {
249249
isReviewPhaseComplete = true;
250250
}
251251
});

0 commit comments

Comments
 (0)