Skip to content

Commit 68de6f2

Browse files
Added QA to challenge listing filter
1 parent c6a7ba4 commit 68de6f2

File tree

8 files changed

+60
-3
lines changed

8 files changed

+60
-3
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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"
@@ -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
`;

src/shared/components/TrackIcon/style.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ $track-radius-4: $corner-radius * 2;
3434
background: $tc-light-blue-110;
3535
}
3636

37-
&.develop,
38-
&.qa {
37+
&.develop {
3938
background: $tc-green-110;
4039
}
4140

41+
&.qa {
42+
background: $tc-purple-110;
43+
}
44+
4245
&.data_science,
4346
&.data-science,
4447
&.data {

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ function ChallengeCard({
4848
challenge.isDataScience = false;
4949
if ((challenge.tags && challenge.tags.includes('Data Science')) || isDevelopMM(challenge)) {
5050
challenge.isDataScience = true;
51+
track = 'DATA_SCIENCE';
52+
}
53+
if (challenge.tags && challenge.tags.includes('QA')) {
54+
track = 'QA';
5155
}
5256
challenge.prize = challenge.prizes || [];
5357

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ export default function ChallengeFilters({
100100
onSwitch={on => switchTrack(TRACKS.DATA_SCIENCE, on)}
101101
/>
102102
</span>
103+
<span styleName="filter-switch-with-label" aria-label={`QA toggle button pressed ${isTrackOn(TRACKS.QA) ? 'On' : 'Off'}`} role="switch" aria-checked={isTrackOn(TRACKS.QA)}>
104+
<SwitchWithLabel
105+
enabled={isTrackOn(TRACKS.QA)}
106+
labelBefore="QA"
107+
onSwitch={on => switchTrack(TRACKS.QA, on)}
108+
/>
109+
</span>
103110
</span>
104111
) : ''
105112
}
@@ -178,6 +185,8 @@ export default function ChallengeFilters({
178185
switchDev={on => switchTrack(TRACKS.DEVELOP, on)}
179186
dataScienceEnabled={isTrackOn(TRACKS.DATA_SCIENCE)}
180187
switchDataScience={on => switchTrack(TRACKS.DATA_SCIENCE, on)}
188+
qaEnabled={isTrackOn(TRACKS.QA)}
189+
switchQA={on => switchTrack(TRACKS.QA, on)}
181190
/>
182191
</div>
183192
);

src/shared/components/challenge-listing/Filters/ChallengeSearchBar/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ $challenge-radius-4: $corner-radius * 2;
1010

1111
/* -100px is necessary to compensate for the temporarly added `Alpha preview`
1212
* banner. Should be modified / removed together with banner. */
13-
$search-bar-width: '100% - 475px';
13+
$search-bar-width: '100% - 536px';
1414
$search-input-width: '100% - 56px';
1515

1616
.ChallengeSearchBar {

src/shared/components/challenge-listing/Filters/EditTrackPanel/index.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* switchDev={enable => this.setTracks(DEVELOP_TRACK, enable)}
1717
* dataScienceEnabled={this.state.filter.tracks.has(DATA_SCIENCE_TRACK)}
1818
* switchDataScience={enable => this.setTracks(DATA_SCIENCE_TRACK, enable)}
19+
* qaEnabled={this.state.filter.tracks.has(QA_TRACK)}
20+
* switchQA={enable => this.setTracks(QA_TRACK, enable)}
1921
* />
2022
*/
2123
import React from 'react';
@@ -28,11 +30,13 @@ function EditTrackPanel({
2830
dataScienceEnabled,
2931
designEnabled,
3032
devEnabled,
33+
qaEnabled,
3134
onClose,
3235
opened,
3336
switchDataScience,
3437
switchDesign,
3538
switchDev,
39+
switchQA,
3640
}) {
3741
return (
3842
<div styleName={`EditTrackPanel ${opened === true ? 'opened' : 'closed'}`}>
@@ -75,6 +79,15 @@ function EditTrackPanel({
7579
onSwitch={switchDataScience}
7680
/>
7781
</div>
82+
<div styleName="row">
83+
<span>
84+
QA
85+
</span>
86+
<Switch
87+
enabled={qaEnabled}
88+
onSwitch={switchQA}
89+
/>
90+
</div>
7891
</div>
7992
);
8093
}
@@ -92,6 +105,8 @@ EditTrackPanel.propTypes = {
92105
switchDev: PT.func.isRequired,
93106
dataScienceEnabled: PT.bool.isRequired,
94107
switchDataScience: PT.func.isRequired,
108+
qaEnabled: PT.bool.isRequired,
109+
switchQA: PT.func.isRequired,
95110
};
96111

97112
export default EditTrackPanel;

src/shared/components/challenge-listing/Tooltips/TrackAbbreviationTooltip/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ const TRACK_COLOR_CLASS = {
9292
DESIGN: 'blue',
9393
DEVELOP: 'green',
9494
DATA_SCIENCE: 'orange',
95+
QA: 'purple',
9596
};
9697

9798
/**

src/shared/components/challenge-listing/Tooltips/TrackAbbreviationTooltip/style.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ $track-radius-4: $corner-radius * 2;
2525
&.orange {
2626
border-left: $track-radius-4 solid $tc-orange;
2727
}
28+
29+
&.purple {
30+
border-left: $track-radius-4 solid $tc-purple;
31+
}
2832
}
2933

3034
.body {

0 commit comments

Comments
 (0)