Skip to content

Commit a0deef2

Browse files
authored
Merge pull request #4728 from topcoder-platform/issue-4709
Issue#4709 : Track and Subtrack enhancements : Details page
2 parents b72b8e5 + baa0293 commit a0deef2

File tree

42 files changed

+315
-460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+315
-460
lines changed

__tests__/shared/components/SubmissionManagement/SubmissionsTable.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ test('Matches shallow shapshot', () => {
1010
submissionObjects={[{
1111
id: '12345',
1212
}]}
13-
type="DESIGN"
13+
track="Design"
1414
/>
1515
));
1616
expect(renderer.getRenderOutput()).toMatchSnapshot();
1717

1818
renderer.render((
1919
<SubmissionsTable
2020
showDetails={{ 12345: true }}
21-
type="DESIGN"
21+
track="Design"
2222
/>
2323
));
2424
expect(renderer.getRenderOutput()).toMatchSnapshot();

__tests__/shared/components/SubmissionManagement/__snapshots__/SubmissionsTable.jsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ exports[`Matches shallow shapshot 1`] = `
3939
"id": "12345",
4040
}
4141
}
42-
type="DESIGN"
42+
track="Design"
4343
/>
4444
<tr
4545
className="src-shared-components-SubmissionManagement-SubmissionsTable-___styles__submission-row___1uclT"

__tests__/shared/components/TrackIcon/__snapshots__/index.jsx.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`Matches shallow shapshot 1`] = `
55
className="src-shared-components-TrackIcon-___style__trackIcon___3gJ9l"
66
>
77
<div
8-
className="src-shared-components-TrackIcon-___style__develop___3v4fM src-shared-components-TrackIcon-___style__main-icon___1q-1_"
8+
className="src-shared-components-TrackIcon-___style__development___1LZdf src-shared-components-TrackIcon-___style__main-icon___1q-1_"
99
>
1010
CH
1111
</div>
@@ -26,15 +26,15 @@ exports[`Matches shallow shapshot 2`] = `
2626
className="src-shared-components-TrackIcon-___style__trackIcon___3gJ9l"
2727
>
2828
<div
29-
className="src-shared-components-TrackIcon-___style__develop___3v4fM src-shared-components-TrackIcon-___style__main-icon___1q-1_"
29+
className="src-shared-components-TrackIcon-___style__development___1LZdf src-shared-components-TrackIcon-___style__main-icon___1q-1_"
3030
>
3131
CH
3232
</div>
3333
<a
3434
href="https://www.topcoder-dev.com/tco"
3535
>
3636
<div
37-
className="src-shared-components-TrackIcon-___style__develop___3v4fM src-shared-components-TrackIcon-___style__tco-icon___18ZV7"
37+
className="src-shared-components-TrackIcon-___style__development___1LZdf src-shared-components-TrackIcon-___style__tco-icon___18ZV7"
3838
>
3939
TCO
4040
</div>
@@ -47,15 +47,15 @@ exports[`Matches shallow shapshot 3`] = `
4747
className="src-shared-components-TrackIcon-___style__trackIcon___3gJ9l"
4848
>
4949
<div
50-
className="src-shared-components-TrackIcon-___style__develop___3v4fM src-shared-components-TrackIcon-___style__main-icon___1q-1_"
50+
className="src-shared-components-TrackIcon-___style__development___1LZdf src-shared-components-TrackIcon-___style__main-icon___1q-1_"
5151
>
5252
CH
5353
</div>
5454
<a
5555
href="https://www.topcoder-dev.com/tco"
5656
>
5757
<div
58-
className="src-shared-components-TrackIcon-___style__develop___3v4fM src-shared-components-TrackIcon-___style__tco-icon___18ZV7"
58+
className="src-shared-components-TrackIcon-___style__development___1LZdf src-shared-components-TrackIcon-___style__tco-icon___18ZV7"
5959
>
6060
TCO
6161
</div>

__tests__/shared/components/TrackIcon/index.jsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,23 @@ import TrackIcon from 'components/TrackIcon';
55
test('Matches shallow shapshot', () => {
66
const renderer = new Renderer();
77

8+
const type = {
9+
name: 'Challenge',
10+
abbreviation: 'CH',
11+
};
12+
813
renderer.render((
9-
<TrackIcon track="DEVELOP" subTrack="CODE" />
14+
<TrackIcon track="Development" type={type} />
1015
));
1116
expect(renderer.getRenderOutput()).toMatchSnapshot();
1217

1318
renderer.render((
14-
<TrackIcon track="DEVELOP" subTrack="CODE" isDataScience tcoEligible="yes" />
19+
<TrackIcon track="Development" type={type} isDataScience tcoEligible="yes" />
1520
));
1621
expect(renderer.getRenderOutput()).toMatchSnapshot();
1722

1823
renderer.render((
19-
<TrackIcon track="DEVELOP" subTrack="CODE" isDataScience={false} tcoEligible="yes" />
24+
<TrackIcon track="Development" type={type} isDataScience={false} tcoEligible="yes" />
2025
));
2126
expect(renderer.getRenderOutput()).toMatchSnapshot();
2227
});

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

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ exports[`Matches shallow shapshot shapshot 1 1`] = `
1818
"eventName": "Submit",
1919
},
2020
],
21-
"legacy": Object {
22-
"track": "DEVELOP",
23-
},
2421
"prize": Array [
2522
1200,
2623
600,
@@ -30,18 +27,24 @@ exports[`Matches shallow shapshot shapshot 1 1`] = `
3027
600,
3128
],
3229
"status": "ACTIVE",
33-
"subTrack": "CODE",
3430
"tags": Array [
3531
"Data Science",
3632
],
3733
"technologies": Array [
3834
"Data Science",
3935
],
4036
"totalPrize": 1800,
37+
"track": "Data Science",
38+
"type": "Challenge",
4139
"users": Object {},
4240
}
4341
}
44-
challengeTypes={Array []}
42+
challengeType={
43+
Object {
44+
"abbreviation": "CH",
45+
"name": "Challenge",
46+
}
47+
}
4548
domRef={null}
4649
expandTag={null}
4750
expandedTags={Array []}
@@ -67,25 +70,28 @@ exports[`Matches shallow shapshot shapshot 2 1`] = `
6770
],
6871
"events": Array [],
6972
"id": "1",
70-
"legacy": Object {
71-
"track": "DATA_SCIENCE",
72-
},
7373
"prizes": Array [
7474
1200,
7575
600,
7676
],
77-
"subTrack": "CODE",
7877
"tags": Array [
7978
"Go",
8079
],
8180
"technologies": Array [
8281
"Go",
8382
],
8483
"totalPrize": 1800,
84+
"track": "Data Science",
85+
"type": "Challenge",
8586
"users": Object {},
8687
}
8788
}
88-
challengeTypes={Array []}
89+
challengeType={
90+
Object {
91+
"abbreviation": "CH",
92+
"name": "Challenge",
93+
}
94+
}
8995
domRef={null}
9096
expandTag={null}
9197
expandedTags={Array []}
@@ -111,21 +117,24 @@ exports[`Matches shallow shapshot shapshot 3 1`] = `
111117
],
112118
"events": Array [],
113119
"id": "long id",
114-
"legacy": Object {
115-
"track": "DATA_SCIENCE",
116-
},
117120
"prizes": Array [
118121
1200,
119122
600,
120123
],
121-
"subTrack": "CODE",
122124
"tags": Array [],
123125
"technologies": Array [],
124126
"totalPrize": 1800,
127+
"track": "Data Science",
128+
"type": "Challenge",
125129
"users": Object {},
126130
}
127131
}
128-
challengeTypes={Array []}
132+
challengeType={
133+
Object {
134+
"abbreviation": "CH",
135+
"name": "Challenge",
136+
}
137+
}
129138
domRef={null}
130139
expandTag={null}
131140
expandedTags={Array []}

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

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,17 @@ const mockData1 = {
2828
}],
2929
currentPhases: ['Registration'],
3030
prizes: [1200, 600],
31-
legacy: {
32-
track: 'DEVELOP',
33-
},
31+
track: 'Data Science',
32+
type: 'Challenge',
3433
totalPrize: 1800,
35-
subTrack: 'CODE',
3634
events: [{ eventName: 'Submit' }],
3735
status: 'ACTIVE',
3836
users: {},
3937
},
38+
challengeType: {
39+
name: 'Challenge',
40+
abbreviation: 'CH',
41+
},
4042
};
4143

4244
const mockData2 = {
@@ -49,15 +51,17 @@ const mockData2 = {
4951
}],
5052
currentPhases: ['Registration'],
5153
prizes: [1200, 600],
52-
legacy: {
53-
track: 'DATA_SCIENCE',
54-
},
55-
subTrack: 'CODE',
54+
track: 'Data Science',
55+
type: 'Challenge',
5656
id: '1',
5757
totalPrize: 1800,
5858
users: {},
5959
events: [],
6060
},
61+
challengeType: {
62+
name: 'Challenge',
63+
abbreviation: 'CH',
64+
},
6165
};
6266

6367
const mockData3 = {
@@ -70,15 +74,17 @@ const mockData3 = {
7074
}],
7175
currentPhases: ['Registration'],
7276
prizes: [1200, 600],
73-
legacy: {
74-
track: 'DATA_SCIENCE',
75-
},
76-
subTrack: 'CODE',
77+
track: 'Data Science',
78+
type: 'Challenge',
7779
id: 'long id',
7880
totalPrize: 1800,
7981
users: {},
8082
events: [],
8183
},
84+
challengeType: {
85+
name: 'Challenge',
86+
abbreviation: 'CH',
87+
},
8288
};
8389

8490
const mockData4 = {
@@ -91,15 +97,17 @@ const mockData4 = {
9197
}],
9298
currentPhases: ['Registration'],
9399
prizes: [1200, 600],
94-
legacy: {
95-
track: 'DATA_SCIENCE',
96-
},
97-
subTrack: 'CODE',
100+
track: 'Data Science',
101+
type: 'Challenge',
98102
id: 'long id',
99103
totalPrize: 1800,
100104
users: {},
101105
events: [],
102106
},
107+
challengeType: {
108+
name: 'Challenge',
109+
abbreviation: 'CH',
110+
},
103111
};
104112

105113
const mockData5 = {
@@ -112,15 +120,17 @@ const mockData5 = {
112120
}],
113121
currentPhases: ['Registration'],
114122
prizes: [1200, 600],
115-
legacy: {
116-
track: 'DATA_SCIENCE',
117-
},
118-
subTrack: 'CODE',
123+
track: 'Data Science',
124+
type: 'Challenge',
119125
id: 'long id',
120126
totalPrize: 1800,
121127
users: {},
122128
events: [],
123129
},
130+
challengeType: {
131+
name: 'Challenge',
132+
abbreviation: 'CH',
133+
},
124134
};
125135

126136
describe('Matches shallow shapshot', () => {

__tests__/shared/components/challenge-listing/Listing/Bucket.jsx

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const mockDatas = [{
3232
prizes: [1200, 600],
3333
totalPrize: 1800,
3434
users: {},
35+
type: 'Challenge',
3536
},
3637
{
3738
id: '2',
@@ -43,15 +44,25 @@ const mockDatas = [{
4344
phaseStatus: 'Open',
4445
}],
4546
currentPhases: ['Registration'],
46-
legacy: {
47-
track: 'DEVELOP',
48-
},
49-
subTrack: 'CODE',
47+
track: 'Development',
48+
type: 'Challenge',
5049
events: [{ eventName: 'Submit' }],
5150
prizes: [1200, 600],
5251
totalPrize: 1800,
5352
users: {},
5453
}],
54+
challengeTypes: [
55+
{
56+
name: 'Challenge',
57+
abbreviation: 'CH',
58+
}, {
59+
name: 'First2Finish',
60+
abbreviation: 'F2F',
61+
}, {
62+
name: 'Task',
63+
abbreviation: 'TSK',
64+
},
65+
],
5566
loading: false,
5667
loadMore,
5768
setFilterState,
@@ -145,6 +156,18 @@ const mockDatas = [{
145156
users: {},
146157
},
147158
],
159+
challengeTypes: [
160+
{
161+
name: 'Challenge',
162+
abbreviation: 'CH',
163+
}, {
164+
name: 'First2Finish',
165+
abbreviation: 'F2F',
166+
}, {
167+
name: 'Task',
168+
abbreviation: 'TSK',
169+
},
170+
],
148171
loading: true,
149172
loadMore,
150173
setFilterState,
@@ -161,6 +184,18 @@ const mockDatas = [{
161184
expand,
162185
challenges: [
163186
],
187+
challengeTypes: [
188+
{
189+
name: 'Challenge',
190+
abbreviation: 'CH',
191+
}, {
192+
name: 'First2Finish',
193+
abbreviation: 'F2F',
194+
}, {
195+
name: 'Task',
196+
abbreviation: 'TSK',
197+
},
198+
],
164199
loading: true,
165200
setFilterState,
166201
setSort,

0 commit comments

Comments
 (0)