Skip to content

Commit d5f76b4

Browse files
authored
Merge pull request #4711 from topcoder-platform/issue-4706
Issue#4706 : Track and Subtrack enhancements
2 parents 4fb098b + 8eba3b1 commit d5f76b4

File tree

39 files changed

+233
-290
lines changed

39 files changed

+233
-290
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exports[`Matches shallow shapshot 1`] = `
77
<div
88
className="src-shared-components-TrackIcon-___style__develop___3v4fM src-shared-components-TrackIcon-___style__main-icon___1q-1_"
99
>
10-
Cd
10+
CH
1111
</div>
1212
<a
1313
href="https://www.topcoder-dev.com/tco"
@@ -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__data_science___3YlDf src-shared-components-TrackIcon-___style__main-icon___1q-1_"
29+
className="src-shared-components-TrackIcon-___style__develop___3v4fM src-shared-components-TrackIcon-___style__main-icon___1q-1_"
3030
>
31-
Cd
31+
CH
3232
</div>
3333
<a
3434
href="https://www.topcoder-dev.com/tco"
3535
>
3636
<div
37-
className="src-shared-components-TrackIcon-___style__data_science___3YlDf src-shared-components-TrackIcon-___style__tco-icon___18ZV7"
37+
className="src-shared-components-TrackIcon-___style__develop___3v4fM src-shared-components-TrackIcon-___style__tco-icon___18ZV7"
3838
>
3939
TCO
4040
</div>
@@ -49,7 +49,7 @@ exports[`Matches shallow shapshot 3`] = `
4949
<div
5050
className="src-shared-components-TrackIcon-___style__develop___3v4fM src-shared-components-TrackIcon-___style__main-icon___1q-1_"
5151
>
52-
Cd
52+
CH
5353
</div>
5454
<a
5555
href="https://www.topcoder-dev.com/tco"

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ exports[`Matches shallow shapshot shapshot 1 1`] = `
1818
"eventName": "Submit",
1919
},
2020
],
21-
"isDataScience": true,
2221
"legacy": Object {
2322
"track": "DEVELOP",
2423
},

__tests__/shared/components/challenge-listing/Filters/ChallengeFilters.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ const mockDatas = [{
3939
showTrackModal,
4040
trackModalShown: true,
4141
validKeywords: [''],
42-
validSubtracks: [''],
42+
validTypes: [''],
4343
}, {
4444
challengeGroupId: '1',
4545
communityFilters: [{ filter: {} }],
4646
communityName: 'name',
4747
expanded: false,
4848
filterState: {
49-
tags: ['abc'], subtracks: ['CODE'], endDate: moment('2019-12-31T23:00:00.000Z'), startDate: moment('2019-12-31T23:00:00.000Z'), tracks: ['tracks'],
49+
tags: ['abc'], types: ['927abff4-7af9-4145-8ba1-577c16e64e2e'], endDate: moment('2019-12-31T23:00:00.000Z'), startDate: moment('2019-12-31T23:00:00.000Z'), tracks: ['tracks'],
5050
},
5151
isCardTypeSet: 'Challenges',
5252
saveFilter,
@@ -59,7 +59,7 @@ const mockDatas = [{
5959
showTrackModal,
6060
trackModalShown: true,
6161
validKeywords: [''],
62-
validSubtracks: [''],
62+
validTypes: [''],
6363
}];
6464

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

__tests__/shared/components/challenge-listing/Filters/FiltersPanel.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const mockDatas = [{
2525
setFilterState,
2626
setSearchText,
2727
validKeywords: ['key', 'word'],
28-
validSubtracks: [{ name: 'sub', subTrack: 'sub' }, { name: 'track', subTrack: 'track' }],
28+
validTypes: [{ name: 'sub', subTrack: 'sub' }, { name: 'track', subTrack: 'track' }],
2929
onClose,
3030
}, {
3131
communityFilters: [
@@ -42,7 +42,7 @@ const mockDatas = [{
4242
setFilterState,
4343
setSearchText,
4444
validKeywords: [],
45-
validSubtracks: [],
45+
validTypes: [],
4646
onClose,
4747
}];
4848

__tests__/shared/components/challenge-listing/Filters/__snapshots__/ChallengeFilters.jsx.snap

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ exports[`Matches shallow shapshot shapshot 1`] = `
7373
"",
7474
]
7575
}
76-
validSubtracks={
76+
validTypes={
7777
Array [
7878
"",
7979
]
@@ -85,9 +85,11 @@ exports[`Matches shallow shapshot shapshot 1`] = `
8585
devEnabled={true}
8686
onClose={[Function]}
8787
opened={true}
88+
qaEnabled={true}
8889
switchDataScience={[Function]}
8990
switchDesign={[Function]}
9091
switchDev={[Function]}
92+
switchQA={[Function]}
9193
/>
9294
</div>
9395
`;
@@ -159,6 +161,23 @@ exports[`Matches shallow shapshot shapshot 2`] = `
159161
themePriority="adhoc-context-default"
160162
/>
161163
</span>
164+
<span
165+
aria-checked={false}
166+
aria-label="QA toggle button pressed Off"
167+
className="src-shared-components-challenge-listing-Filters-___ChallengeFilters__filter-switch-with-label___21Ups"
168+
role="switch"
169+
>
170+
<ThemedSwitchWithLabel
171+
composeAdhocTheme="deeply"
172+
composeContextTheme="softly"
173+
enabled={false}
174+
labelAfter=""
175+
labelBefore="QA"
176+
mapThemrProps={[Function]}
177+
onSwitch={[Function]}
178+
themePriority="adhoc-context-default"
179+
/>
180+
</span>
162181
</span>
163182
<span
164183
className="src-shared-components-challenge-listing-Filters-___ChallengeFilters__pulled-right___bfsMZ"
@@ -216,15 +235,15 @@ exports[`Matches shallow shapshot shapshot 2`] = `
216235
Object {
217236
"endDate": "2019-12-31T23:00:00.000Z",
218237
"startDate": "2019-12-31T23:00:00.000Z",
219-
"subtracks": Array [
220-
"CODE",
221-
],
222238
"tags": Array [
223239
"abc",
224240
],
225241
"tracks": Array [
226242
"tracks",
227243
],
244+
"types": Array [
245+
"927abff4-7af9-4145-8ba1-577c16e64e2e",
246+
],
228247
}
229248
}
230249
hidden={true}
@@ -242,7 +261,7 @@ exports[`Matches shallow shapshot shapshot 2`] = `
242261
"",
243262
]
244263
}
245-
validSubtracks={
264+
validTypes={
246265
Array [
247266
"",
248267
]
@@ -254,9 +273,11 @@ exports[`Matches shallow shapshot shapshot 2`] = `
254273
devEnabled={false}
255274
onClose={[Function]}
256275
opened={true}
276+
qaEnabled={false}
257277
switchDataScience={[Function]}
258278
switchDesign={[Function]}
259279
switchDev={[Function]}
280+
switchQA={[Function]}
260281
/>
261282
</div>
262283
`;

__tests__/shared/components/challenge-listing/Filters/__snapshots__/FiltersPanel.jsx.snap

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ exports[`Matches shallow shapshot 1`] = `
109109
>
110110
<label
111111
className="src-shared-components-challenge-listing-Filters-FiltersPanel-___style__left-label___15kRu"
112-
htmlFor="track-select"
112+
htmlFor="type-select"
113113
>
114-
Subtrack
114+
Type
115115
<input
116116
type="hidden"
117117
/>
118118
</label>
119119
<Select
120-
id="track-select"
120+
id="type-select"
121121
multi={true}
122122
onChange={[Function]}
123123
options={
@@ -132,7 +132,7 @@ exports[`Matches shallow shapshot 1`] = `
132132
},
133133
]
134134
}
135-
placeholder="Select Subtrack"
135+
placeholder="Select Type"
136136
selectRef={[Function]}
137137
simpleValue={true}
138138
value={null}
@@ -304,19 +304,19 @@ exports[`Matches shallow shapshot 2`] = `
304304
>
305305
<label
306306
className="src-shared-components-challenge-listing-Filters-FiltersPanel-___style__left-label___15kRu"
307-
htmlFor="track-select"
307+
htmlFor="type-select"
308308
>
309-
Subtrack
309+
Type
310310
<input
311311
type="hidden"
312312
/>
313313
</label>
314314
<Select
315-
id="track-select"
315+
id="type-select"
316316
multi={true}
317317
onChange={[Function]}
318318
options={Array []}
319-
placeholder="Select Subtrack"
319+
placeholder="Select Type"
320320
selectRef={[Function]}
321321
simpleValue={true}
322322
value={null}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ exports[`Matches shallow shapshot 1`] = `
4747
},
4848
],
4949
"id": "2",
50-
"isDataScience": false,
5150
"legacy": Object {
5251
"track": "DEVELOP",
5352
},

__tests__/shared/containers/challenge-listing/FilterPanel.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('shallow render connnected component', () => {
2323
loadingChallengeTags: false,
2424
loadingChallengeTypes: false,
2525
challengeTags: [],
26-
challengeSubtracks: [],
26+
challengeTypes: [],
2727
selectedCommunityId: '1',
2828
},
2929
auth: {
@@ -68,9 +68,9 @@ describe('full render pure component', () => {
6868
filterState: {},
6969
getAvailableFilterName: jest.fn(),
7070
loadingKeywords: false,
71-
loadingSubtracks: false,
71+
loadingTypes: false,
7272
validKeywords: [],
73-
validSubtracks: [],
73+
validTypes: [],
7474
selectedCommunityId: '1',
7575
tokenV2: 'tokenV2',
7676
getTypes: jest.fn(),
@@ -117,7 +117,7 @@ describe('full render pure component', () => {
117117
instance = mount(<FilterPanel
118118
{...initialProps}
119119
challengeGroupId="1"
120-
loadingSubtracks
120+
loadingTypes
121121
loadingKeywords
122122
/>);
123123

@@ -183,7 +183,7 @@ describe('full render connnected component and dispatch actions', () => {
183183
loadingChallengeTags: true,
184184
loadingChallengeTypes: true,
185185
challengeTags: [],
186-
challengeSubtracks: [],
186+
challengeTypes: [],
187187
selectedCommunityId: '1',
188188
},
189189
auth: {

__tests__/shared/containers/challenge-listing/Listing.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('full render pure component', () => {
4040
allDraftChallengesLoaded: false,
4141
allPastChallengesLoaded: false,
4242
challenges: [],
43-
challengeSubtracks: [],
43+
challengeTypes: [],
4444
challengeTags: [],
4545
getCommunitiesList: () => {},
4646
communityFilters: [{ communityId: '1', name: 'My Filter', filter: {} }],
@@ -177,7 +177,7 @@ describe('full render connnected component and dispatch actions', () => {
177177
allDraftChallengesLoaded: false,
178178
allPastChallengesLoaded: false,
179179
challenges: [{ id: '1' }],
180-
challengeSubtracks: [],
180+
challengeTypes: [],
181181
challengeTags: [],
182182
// communityFilters: [{ id: '1', name: 'My Filter', filter: {} }],
183183
dropChallenges: jest.fn(),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function getAll(getter, page = 0, prev) {
4646
}
4747

4848
/**
49-
* Gets possible challenge subtracks.
49+
* Gets possible challenge types.
5050
* @return {Promise}
5151
*/
5252
function getChallengeTypesDone() {

src/shared/components/Contentful/ChallengesBlock/Card/index.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
DataScienceTrackTag,
88
DesignTrackTag,
99
DevelopmentTrackTag,
10+
QATrackTag,
1011
} from 'topcoder-react-ui-kit';
1112

1213
import { Link } from 'topcoder-react-utils';
@@ -40,6 +41,9 @@ export default function Card({
4041
case COMPETITION_TRACKS.DEVELOP:
4142
TrackTag = DevelopmentTrackTag;
4243
break;
44+
case COMPETITION_TRACKS.QA:
45+
TrackTag = QATrackTag;
46+
break;
4347
default:
4448
throw new Error('Wrong competition track value');
4549
}
@@ -57,7 +61,7 @@ export default function Card({
5761
return (
5862
<div styleName="container">
5963
<TrackTag
60-
to={`${baseUrl}/challenges?filter[subtracks][0]=${
64+
to={`${baseUrl}/challenges?filter[types][0]=${
6165
encodeURIComponent(subTrack)}`}
6266
>
6367
{_.capitalize(subTrack).replace(/_/g, ' ')}

0 commit comments

Comments
 (0)