Skip to content

Commit 8612399

Browse files
Merge pull request #25 from topcoder-platform/integration-v5-challenge-api
Integration v5 challenge api
2 parents ac0b11d + 8514b0a commit 8612399

File tree

7 files changed

+12
-6
lines changed

7 files changed

+12
-6
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ exports[`Matches shallow shapshot shapshot 2 1`] = `
6666
"currentPhases": Array [
6767
"Registration",
6868
],
69+
"events": Array [],
6970
"id": "1",
7071
"legacy": Object {
7172
"track": "DATA_SCIENCE",
@@ -109,6 +110,7 @@ exports[`Matches shallow shapshot shapshot 3 1`] = `
109110
"currentPhases": Array [
110111
"Registration",
111112
],
113+
"events": Array [],
112114
"id": "long id",
113115
"legacy": Object {
114116
"track": "DATA_SCIENCE",

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const mockData2 = {
5656
id: '1',
5757
totalPrize: 1800,
5858
users: {},
59+
events: [],
5960
},
6061
};
6162

@@ -76,6 +77,7 @@ const mockData3 = {
7677
id: 'long id',
7778
totalPrize: 1800,
7879
users: {},
80+
events: [],
7981
},
8082
};
8183

@@ -96,6 +98,7 @@ const mockData4 = {
9698
id: 'long id',
9799
totalPrize: 1800,
98100
users: {},
101+
events: [],
99102
},
100103
};
101104

@@ -116,6 +119,7 @@ const mockData5 = {
116119
id: 'long id',
117120
totalPrize: 1800,
118121
users: {},
122+
events: [],
119123
},
120124
};
121125

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.6",
138+
"topcoder-react-lib": "1000.19.7",
139139
"topcoder-react-ui-kit": "^1.0.11",
140140
"topcoder-react-utils": "0.7.8",
141141
"turndown": "^4.0.2",

src/shared/components/Dashboard/CurrentActivity/Challenges/ChallengeCard/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default function ChallengeCard({
7777
: `/?module=Category&categoryID=${legacy.forumId}`;
7878

7979
const isTco = challenge.events
80-
&& challenge.events.find(x => x.eventName.match(/tco\d{2}/));
80+
&& challenge.events.find(x => x.eventName && x.eventName.match(/tco\d{2}/));
8181

8282
const roles = _.get(userDetails, 'roles') || [];
8383

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default function ChallengesCard({
6565
<TrackIcon
6666
track={track}
6767
subTrack={challenge.subTrack}
68-
tcoEligible={challenge.events ? challenge.events[0].eventName : ''}
68+
tcoEligible={challenge.events && challenge.events.length > 0 ? challenge.events[0].eventName : ''}
6969
isDataScience={challenge.isDataScience}
7070
challengesUrl={challengesUrl}
7171
/>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ export default function ChallengeDetailsView(props) {
5656

5757
const allowStockArt = _.find(metadata, { type: 'allowStockArt' });
5858
let environment = '';
59-
const environmentData = _.find(metadata, { type: 'environment' });
59+
const environmentData = _.find(metadata, { name: 'environment' });
6060
if (environmentData) {
6161
environment = environmentData.value;
6262
}
6363

6464
let codeRepo = '';
65-
const codeRepoData = _.find(metadata, { type: 'codeRepo' });
65+
const codeRepoData = _.find(metadata, { name: 'codeRepo' });
6666
if (codeRepoData) {
6767
codeRepo = codeRepoData.value;
6868
}

src/shared/components/challenge-listing/ChallengeCard/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function ChallengeCard({
7171
<TrackIcon
7272
track={track}
7373
subTrack={subTrack}
74-
tcoEligible={challenge.events ? challenge.events[0].eventName : ''}
74+
tcoEligible={challenge.events && challenge.events.length > 0 ? challenge.events[0].eventName : ''}
7575
isDataScience={challenge.isDataScience}
7676
/>
7777
</span>

0 commit comments

Comments
 (0)