Skip to content

Commit 12b1a54

Browse files
Merge pull request #6631 from topcoder-platform/develop
Release v1.17.19
2 parents f9eac9d + ed190e4 commit 12b1a54

File tree

9 files changed

+83
-75
lines changed

9 files changed

+83
-75
lines changed

__tests__/shared/components/Leaderboard/__snapshots__/Podium.jsx.snap

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`Matches shallow shapshot 1`] = `
55
className="src-shared-components-Leaderboard-Podium-themes-___default__Podium___1qIZm"
66
>
77
<div
8-
className="src-shared-components-Leaderboard-Podium-themes-___default__PodiumWrapCondense___3aV24"
8+
className="src-shared-components-Leaderboard-Podium-themes-___default__PodiumWrap___2hDWP"
99
style={
1010
Object {
1111
"justify-content": "space-between",
@@ -29,7 +29,6 @@ exports[`Matches shallow shapshot 1`] = `
2929
isCopilot={false}
3030
isTopGear={false}
3131
onUsernameClick={null}
32-
podiumPlaces={4}
3332
themeName="Default"
3433
/>
3534
</div>
@@ -50,7 +49,6 @@ exports[`Matches shallow shapshot 1`] = `
5049
isCopilot={false}
5150
isTopGear={false}
5251
onUsernameClick={null}
53-
podiumPlaces={4}
5452
themeName="Default"
5553
/>
5654
</div>
@@ -71,7 +69,6 @@ exports[`Matches shallow shapshot 1`] = `
7169
isCopilot={false}
7270
isTopGear={false}
7371
onUsernameClick={null}
74-
podiumPlaces={4}
7572
themeName="Default"
7673
/>
7774
</div>
@@ -92,7 +89,6 @@ exports[`Matches shallow shapshot 1`] = `
9289
isCopilot={false}
9390
isTopGear={false}
9491
onUsernameClick={null}
95-
podiumPlaces={4}
9692
themeName="Default"
9793
/>
9894
</div>

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

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ function getMyPastChallengesInit(uuid, page, frontFilter) {
184184
*/
185185
function getActiveChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter = {}) {
186186
const { sorts } = frontFilter;
187+
const sortObj = SORT[sorts[BUCKETS.ONGOING]];
187188
const filter = {
188189
backendFilter,
189190
frontFilter: {
@@ -193,8 +194,8 @@ function getActiveChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter
193194
registrationEndDateEnd: new Date().toISOString(),
194195
perPage: PAGE_SIZE,
195196
page: page + 1,
196-
sortBy: sorts[BUCKETS.ONGOING],
197-
sortOrder: SORT[sorts[BUCKETS.ONGOING]].order,
197+
sortBy: sortObj.field ? sortObj.field : sorts[BUCKETS.ONGOING],
198+
sortOrder: sortObj.order,
198199
},
199200
};
200201
delete filter.frontFilter.sorts;
@@ -245,7 +246,7 @@ function getActiveChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter
245246
function getOpenForRegistrationChallengesDone(uuid, page, backendFilter,
246247
tokenV3, frontFilter = {}, recommended = false, handle) {
247248
const { sorts } = frontFilter;
248-
const sortOrder = SORT[sorts[BUCKETS.OPEN_FOR_REGISTRATION]];
249+
const sortObj = SORT[sorts[BUCKETS.OPEN_FOR_REGISTRATION]];
249250
const filter = {
250251
backendFilter,
251252
frontFilter: {
@@ -254,8 +255,8 @@ function getOpenForRegistrationChallengesDone(uuid, page, backendFilter,
254255
currentPhaseName: 'Registration',
255256
perPage: PAGE_SIZE,
256257
page: page + 1,
257-
sortBy: sorts[BUCKETS.OPEN_FOR_REGISTRATION],
258-
sortOrder: sortOrder ? sortOrder.order : 'asc',
258+
sortBy: sortObj && sortObj.field ? sortObj.field : sorts[BUCKETS.OPEN_FOR_REGISTRATION],
259+
sortOrder: sortObj ? sortObj.order : 'asc',
259260
},
260261
};
261262
delete filter.frontFilter.sorts;
@@ -280,6 +281,7 @@ function getOpenForRegistrationChallengesDone(uuid, page, backendFilter,
280281
function getMyChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter = {}) {
281282
const userId = decodeToken(tokenV3).userId.toString();
282283
const { sorts } = frontFilter;
284+
const sortObj = SORT[sorts[BUCKETS.MY]];
283285
const filter = {
284286
backendFilter,
285287
frontFilter: {
@@ -288,8 +290,8 @@ function getMyChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter = {
288290
memberId: userId,
289291
perPage: PAGE_SIZE,
290292
page: page + 1,
291-
sortBy: sorts[BUCKETS.MY],
292-
sortOrder: SORT[sorts[BUCKETS.MY]].order,
293+
sortBy: sortObj.field ? sortObj.field : sorts[BUCKETS.MY],
294+
sortOrder: sortObj.order,
293295
},
294296
};
295297
delete filter.frontFilter.sorts;
@@ -304,15 +306,16 @@ function getMyChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter = {
304306

305307
function getAllChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter = {}) {
306308
const { sorts } = frontFilter;
309+
const sortObj = SORT[sorts[BUCKETS.ALL]];
307310
const filter = {
308311
backendFilter,
309312
frontFilter: {
310313
...frontFilter,
311314
status: 'Active',
312315
perPage: PAGE_SIZE,
313316
page: page + 1,
314-
sortBy: sorts[BUCKETS.ALL],
315-
sortOrder: SORT[sorts[BUCKETS.ALL]].order,
317+
sortBy: sortObj.field ? sortObj.field : sorts[BUCKETS.ALL],
318+
sortOrder: sortObj.order,
316319
},
317320
};
318321
delete filter.frontFilter.sorts;
@@ -328,6 +331,7 @@ function getAllChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter =
328331
function getMyPastChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter = {}) {
329332
const userId = decodeToken(tokenV3).userId.toString();
330333
const { sorts } = frontFilter;
334+
const sortObj = SORT[sorts[BUCKETS.MY_PAST]];
331335
const filter = {
332336
backendFilter,
333337
frontFilter: {
@@ -336,8 +340,8 @@ function getMyPastChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter
336340
memberId: userId,
337341
perPage: PAGE_SIZE,
338342
page: page + 1,
339-
sortBy: sorts[BUCKETS.MY_PAST],
340-
sortOrder: SORT[sorts[BUCKETS.MY_PAST]].order,
343+
sortBy: sortObj.field ? sortObj.field : sorts[BUCKETS.MY_PAST],
344+
sortOrder: sortObj.order,
341345
},
342346
};
343347
delete filter.frontFilter.sorts;
@@ -436,15 +440,16 @@ function getPastChallengesInit(uuid, page, frontFilter) {
436440
*/
437441
function getPastChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter = {}) {
438442
const { sorts } = frontFilter;
443+
const sortObj = SORT[sorts[BUCKETS.ALL_PAST]];
439444
const filter = {
440445
backendFilter,
441446
frontFilter: {
442447
...frontFilter,
443448
status: 'Completed',
444449
perPage: PAGE_SIZE,
445450
page: page + 1,
446-
sortBy: sorts[BUCKETS.ALL_PAST],
447-
sortOrder: SORT[sorts[BUCKETS.ALL_PAST]].order,
451+
sortBy: sortObj.field ? sortObj.field : sorts[BUCKETS.ALL_PAST],
452+
sortOrder: sortObj.order,
448453
},
449454
};
450455
delete filter.frontFilter.sorts;
@@ -546,6 +551,7 @@ export default createActions({
546551
DROP_MY_CHALLENGES: _.noop,
547552
DROP_ALL_CHALLENGES: _.noop,
548553
DROP_PAST_CHALLENGES: _.noop,
554+
DROP_MY_PAST_CHALLENGES: _.noop,
549555
DROP_RECOMMENDED_CHALLENGES: _.noop,
550556

551557
// GET_ALL_ACTIVE_CHALLENGES_INIT: getAllActiveChallengesInit,

src/shared/components/Leaderboard/Podium/index.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,12 @@ export default function Podium(props) {
6464
isTopGear={isTopGear}
6565
isAlgo={isAlgo}
6666
themeName={themeName}
67-
podiumPlaces={comps.length}
6867
/>
6968
</div>
7069
));
7170

7271
return (
73-
<div styleName={`${stylesName}.${comps.length > 3 ? 'PodiumWrapCondense' : 'PodiumWrap'}`} style={comps.length === 4 ? { 'justify-content': 'space-between' } : {}}>
72+
<div styleName={`${stylesName}.${themeName === 'TCO23' ? 'PodiumWrapCondense' : 'PodiumWrap'}`} style={comps.length === 4 ? { 'justify-content': 'space-between' } : {}}>
7473
{podiumSpots}
7574
</div>
7675
);

src/shared/components/Leaderboard/PodiumSpot/index.jsx

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*/
2626

2727
import React from 'react';
28-
import PT, { number } from 'prop-types';
28+
import PT from 'prop-types';
2929
import { Avatar } from 'topcoder-react-ui-kit';
3030
import { config } from 'topcoder-react-utils';
3131
import _ from 'lodash';
@@ -127,7 +127,6 @@ export default function PodiumSpot(props) {
127127
isTopGear,
128128
isAlgo,
129129
themeName,
130-
podiumPlaces,
131130
} = props;
132131

133132
const stylesName = THEME[themeName];
@@ -141,7 +140,7 @@ export default function PodiumSpot(props) {
141140
if (photoUrl) {
142141
photoUrl = `${config.CDN.PUBLIC}/avatar/${encodeURIComponent(photoUrl)}?size=160`;
143142
}
144-
let rootStyle = `${stylesName}.${podiumPlaces > 3 ? 'PodiumSpotCondense' : 'PodiumSpot'}`;
143+
let rootStyle = `${stylesName}.${themeName === 'TCO23' ? 'PodiumSpotCondense' : 'PodiumSpot'}`;
145144
if (PODIUM_ITEM_MODIFIER[competitor.rank]) rootStyle += ` ${stylesName}.PodiumSpot--${PODIUM_ITEM_MODIFIER[competitor.rank]}`;
146145
const fulfillment = competitor['tco_leaderboard.fulfillment']
147146
? (parseFloat(competitor['tco_leaderboard.fulfillment']) * 100).toFixed(2).replace(/[.,]00$/, '')
@@ -175,24 +174,15 @@ export default function PodiumSpot(props) {
175174
<div styleName={`${stylesName}.wave-wrap--${PODIUM_ITEM_MODIFIER[competitor.rank > 4 ? 4 : competitor.rank]}`}>
176175
<svg
177176
xmlns="http://www.w3.org/2000/svg"
178-
width={podiumPlaces > 3 ? 200 : 392}
179-
height={podiumPlaces > 3 ? 16 : 25}
177+
width={200}
178+
height={16}
180179
fill="none"
181-
viewBox={`0 0 ${podiumPlaces > 3 ? 200 : 392} ${podiumPlaces > 3 ? 16 : 25}`}
180+
viewBox="0 0 200 16"
182181
>
183-
{
184-
podiumPlaces > 3 ? (
185-
<path
186-
fill="#fff"
187-
d="M149.572 0.823649C173.331 0.823652 191.313 6.86156 198 9.88051L198 0.0893164L7.94832e-07 0.0892861L3.05705e-07 9.88048C6.08897 12.3283 17.0268 16 38.0337 16C64.2924 16 122.203 0.823644 149.572 0.823649Z"
188-
/>
189-
) : (
190-
<path
191-
fill="#fff"
192-
d="M296.123 1.385c47.038 0 82.638 9.395 95.877 14.093V.242H0v15.236C12.055 19.287 33.71 25 75.3 25c51.986 0 166.637-23.615 220.823-23.615z"
193-
/>
194-
)
195-
}
182+
<path
183+
fill="#fff"
184+
d="M149.572 0.823649C173.331 0.823652 191.313 6.86156 198 9.88051L198 0.0893164L7.94832e-07 0.0892861L3.05705e-07 9.88048C6.08897 12.3283 17.0268 16 38.0337 16C64.2924 16 122.203 0.823644 149.572 0.823649Z"
185+
/>
196186
</svg>
197187
<span styleName={`${stylesName}.leaderboard-avatar`}>
198188
{
@@ -376,7 +366,6 @@ PodiumSpot.propTypes = {
376366
isTopGear: PT.bool,
377367
isAlgo: PT.bool,
378368
themeName: PT.string,
379-
podiumPlaces: number,
380369
};
381370

382371
PodiumSpot.defaultProps = {
@@ -385,5 +374,4 @@ PodiumSpot.defaultProps = {
385374
isTopGear: false,
386375
isAlgo: false,
387376
themeName: 'Default',
388-
podiumPlaces: 1,
389377
};

src/shared/components/Leaderboard/PodiumSpot/themes/tco23.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ $podium-border-color: #ededf2;
217217
text-transform: uppercase;
218218
margin-bottom: 8px;
219219
color: #000;
220+
border: none;
221+
padding: 0;
220222
}
221223

222224
.handle-link {

src/shared/components/SortingSelectBar/style.scss

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ $down-arrow-size: $base-unit;
5252
// 'Sort by' dropdown
5353
.Select {
5454
@include roboto-regular;
55-
}
5655

57-
.is-focused {
58-
font-weight: 700;
56+
border-color: #b3b3b3 !important;
5957
}
6058

6159
.Select-control {
@@ -88,8 +86,9 @@ $down-arrow-size: $base-unit;
8886
overflow: visible;
8987
}
9088

91-
.Select.is-focused:not(.is-open) > .Select-control {
92-
border-color: #137d60 !important;
89+
.Select.is-focused > .Select-control {
90+
outline: none;
91+
box-shadow: none;
9392
}
9493

9594
.Select-value-label {
@@ -120,51 +119,41 @@ $down-arrow-size: $base-unit;
120119
.Select-menu-outer {
121120
width: 100%;
122121
color: $tc-gray-90;
122+
border-bottom-right-radius: 4px;
123+
border-bottom-left-radius: 4px;
123124
font-weight: 400;
124125
font-size: 12px;
125126
background-color: $tc-white;
126127
box-sizing: border-box;
127-
margin-top: 2px;
128-
padding: 4px 0;
128+
border: 1px solid #ccc;
129+
max-height: 200px;
129130
position: absolute;
131+
left: 0;
132+
height: fit-content;
130133
top: 100%;
131-
right: 0;
132-
z-index: 1000;
133-
-webkit-overflow-scrolling: touch;
134-
border: none !important;
135134
}
136135

137136
.Select-menu {
138-
max-height: none;
139137
overflow-y: visible;
140-
height: 22px;
141138
font-size: 14px;
142139
}
143140

144141
.Select-option {
145142
box-sizing: border-box;
146-
color: rgba(51, 51, 51, 0.8);
143+
color: #2a2a2b;
147144
cursor: pointer;
148145
display: block;
149-
padding: 6px 16px;
150-
border-left: 1px solid #aaa;
151-
border-right: 1px solid #aaa;
152-
}
153-
154-
.Select-option:last-child {
155-
border-bottom-right-radius: 5px !important;
156-
border-bottom-left-radius: 5px !important;
157-
border-bottom: 1px solid #aaa;
146+
padding: 8px 15px;
158147
}
159148

160-
.Select-option:first-child {
161-
border-top: 1px solid #aaa;
162-
border-top-left-radius: $base-unit;
163-
border-top-right-radius: $base-unit;
149+
.Select-option:hover {
150+
color: #fff !important;
151+
font-weight: 400 !important;
152+
background-color: #229173 !important;
164153
}
165154

166-
.Select-option:hover {
167-
color: $tc-black;
155+
.Select.is-focused:not(.is-open) > .Select-control {
156+
border-color: #b3b3b3 !important;
168157
}
169158

170159
.Select-option.is-selected {

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

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -587,16 +587,29 @@ hr.hr {
587587
.Select.is-focused > .Select-control {
588588
outline: none;
589589
box-shadow: none;
590-
border-color: #151516 !important;
591590
}
592591

593592
.Select-menu-outer {
594-
margin-top: 1px;
595593
font-size: 14px;
596594

595+
.Select-option {
596+
color: #2a2a2b !important;
597+
padding: 8px 15px;
598+
}
599+
600+
.Select-option.is-focused {
601+
background-color: #fff !important;
602+
}
603+
597604
.Select-option.is-selected {
598-
background-color: #137d60 !important;
599-
color: $tc-white !important;
605+
font-weight: 700;
606+
color: #2a2a2b !important;
607+
background-color: #fff !important;
608+
}
609+
610+
.Select-option:hover {
611+
background-color: #229173 !important;
612+
color: #fff !important;
600613
}
601614
}
602615
}

0 commit comments

Comments
 (0)