Skip to content

Release v1.17.19 #6631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`Matches shallow shapshot 1`] = `
className="src-shared-components-Leaderboard-Podium-themes-___default__Podium___1qIZm"
>
<div
className="src-shared-components-Leaderboard-Podium-themes-___default__PodiumWrapCondense___3aV24"
className="src-shared-components-Leaderboard-Podium-themes-___default__PodiumWrap___2hDWP"
style={
Object {
"justify-content": "space-between",
Expand All @@ -29,7 +29,6 @@ exports[`Matches shallow shapshot 1`] = `
isCopilot={false}
isTopGear={false}
onUsernameClick={null}
podiumPlaces={4}
themeName="Default"
/>
</div>
Expand All @@ -50,7 +49,6 @@ exports[`Matches shallow shapshot 1`] = `
isCopilot={false}
isTopGear={false}
onUsernameClick={null}
podiumPlaces={4}
themeName="Default"
/>
</div>
Expand All @@ -71,7 +69,6 @@ exports[`Matches shallow shapshot 1`] = `
isCopilot={false}
isTopGear={false}
onUsernameClick={null}
podiumPlaces={4}
themeName="Default"
/>
</div>
Expand All @@ -92,7 +89,6 @@ exports[`Matches shallow shapshot 1`] = `
isCopilot={false}
isTopGear={false}
onUsernameClick={null}
podiumPlaces={4}
themeName="Default"
/>
</div>
Expand Down
32 changes: 19 additions & 13 deletions src/shared/actions/challenge-listing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ function getMyPastChallengesInit(uuid, page, frontFilter) {
*/
function getActiveChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter = {}) {
const { sorts } = frontFilter;
const sortObj = SORT[sorts[BUCKETS.ONGOING]];
const filter = {
backendFilter,
frontFilter: {
Expand All @@ -193,8 +194,8 @@ function getActiveChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter
registrationEndDateEnd: new Date().toISOString(),
perPage: PAGE_SIZE,
page: page + 1,
sortBy: sorts[BUCKETS.ONGOING],
sortOrder: SORT[sorts[BUCKETS.ONGOING]].order,
sortBy: sortObj.field ? sortObj.field : sorts[BUCKETS.ONGOING],
sortOrder: sortObj.order,
},
};
delete filter.frontFilter.sorts;
Expand Down Expand Up @@ -245,7 +246,7 @@ function getActiveChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter
function getOpenForRegistrationChallengesDone(uuid, page, backendFilter,
tokenV3, frontFilter = {}, recommended = false, handle) {
const { sorts } = frontFilter;
const sortOrder = SORT[sorts[BUCKETS.OPEN_FOR_REGISTRATION]];
const sortObj = SORT[sorts[BUCKETS.OPEN_FOR_REGISTRATION]];
const filter = {
backendFilter,
frontFilter: {
Expand All @@ -254,8 +255,8 @@ function getOpenForRegistrationChallengesDone(uuid, page, backendFilter,
currentPhaseName: 'Registration',
perPage: PAGE_SIZE,
page: page + 1,
sortBy: sorts[BUCKETS.OPEN_FOR_REGISTRATION],
sortOrder: sortOrder ? sortOrder.order : 'asc',
sortBy: sortObj && sortObj.field ? sortObj.field : sorts[BUCKETS.OPEN_FOR_REGISTRATION],
sortOrder: sortObj ? sortObj.order : 'asc',
},
};
delete filter.frontFilter.sorts;
Expand All @@ -280,6 +281,7 @@ function getOpenForRegistrationChallengesDone(uuid, page, backendFilter,
function getMyChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter = {}) {
const userId = decodeToken(tokenV3).userId.toString();
const { sorts } = frontFilter;
const sortObj = SORT[sorts[BUCKETS.MY]];
const filter = {
backendFilter,
frontFilter: {
Expand All @@ -288,8 +290,8 @@ function getMyChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter = {
memberId: userId,
perPage: PAGE_SIZE,
page: page + 1,
sortBy: sorts[BUCKETS.MY],
sortOrder: SORT[sorts[BUCKETS.MY]].order,
sortBy: sortObj.field ? sortObj.field : sorts[BUCKETS.MY],
sortOrder: sortObj.order,
},
};
delete filter.frontFilter.sorts;
Expand All @@ -304,15 +306,16 @@ function getMyChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter = {

function getAllChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter = {}) {
const { sorts } = frontFilter;
const sortObj = SORT[sorts[BUCKETS.ALL]];
const filter = {
backendFilter,
frontFilter: {
...frontFilter,
status: 'Active',
perPage: PAGE_SIZE,
page: page + 1,
sortBy: sorts[BUCKETS.ALL],
sortOrder: SORT[sorts[BUCKETS.ALL]].order,
sortBy: sortObj.field ? sortObj.field : sorts[BUCKETS.ALL],
sortOrder: sortObj.order,
},
};
delete filter.frontFilter.sorts;
Expand All @@ -328,6 +331,7 @@ function getAllChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter =
function getMyPastChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter = {}) {
const userId = decodeToken(tokenV3).userId.toString();
const { sorts } = frontFilter;
const sortObj = SORT[sorts[BUCKETS.MY_PAST]];
const filter = {
backendFilter,
frontFilter: {
Expand All @@ -336,8 +340,8 @@ function getMyPastChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter
memberId: userId,
perPage: PAGE_SIZE,
page: page + 1,
sortBy: sorts[BUCKETS.MY_PAST],
sortOrder: SORT[sorts[BUCKETS.MY_PAST]].order,
sortBy: sortObj.field ? sortObj.field : sorts[BUCKETS.MY_PAST],
sortOrder: sortObj.order,
},
};
delete filter.frontFilter.sorts;
Expand Down Expand Up @@ -436,15 +440,16 @@ function getPastChallengesInit(uuid, page, frontFilter) {
*/
function getPastChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter = {}) {
const { sorts } = frontFilter;
const sortObj = SORT[sorts[BUCKETS.ALL_PAST]];
const filter = {
backendFilter,
frontFilter: {
...frontFilter,
status: 'Completed',
perPage: PAGE_SIZE,
page: page + 1,
sortBy: sorts[BUCKETS.ALL_PAST],
sortOrder: SORT[sorts[BUCKETS.ALL_PAST]].order,
sortBy: sortObj.field ? sortObj.field : sorts[BUCKETS.ALL_PAST],
sortOrder: sortObj.order,
},
};
delete filter.frontFilter.sorts;
Expand Down Expand Up @@ -546,6 +551,7 @@ export default createActions({
DROP_MY_CHALLENGES: _.noop,
DROP_ALL_CHALLENGES: _.noop,
DROP_PAST_CHALLENGES: _.noop,
DROP_MY_PAST_CHALLENGES: _.noop,
DROP_RECOMMENDED_CHALLENGES: _.noop,

// GET_ALL_ACTIVE_CHALLENGES_INIT: getAllActiveChallengesInit,
Expand Down
3 changes: 1 addition & 2 deletions src/shared/components/Leaderboard/Podium/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,12 @@ export default function Podium(props) {
isTopGear={isTopGear}
isAlgo={isAlgo}
themeName={themeName}
podiumPlaces={comps.length}
/>
</div>
));

return (
<div styleName={`${stylesName}.${comps.length > 3 ? 'PodiumWrapCondense' : 'PodiumWrap'}`} style={comps.length === 4 ? { 'justify-content': 'space-between' } : {}}>
<div styleName={`${stylesName}.${themeName === 'TCO23' ? 'PodiumWrapCondense' : 'PodiumWrap'}`} style={comps.length === 4 ? { 'justify-content': 'space-between' } : {}}>
{podiumSpots}
</div>
);
Expand Down
30 changes: 9 additions & 21 deletions src/shared/components/Leaderboard/PodiumSpot/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/

import React from 'react';
import PT, { number } from 'prop-types';
import PT from 'prop-types';
import { Avatar } from 'topcoder-react-ui-kit';
import { config } from 'topcoder-react-utils';
import _ from 'lodash';
Expand Down Expand Up @@ -127,7 +127,6 @@ export default function PodiumSpot(props) {
isTopGear,
isAlgo,
themeName,
podiumPlaces,
} = props;

const stylesName = THEME[themeName];
Expand All @@ -141,7 +140,7 @@ export default function PodiumSpot(props) {
if (photoUrl) {
photoUrl = `${config.CDN.PUBLIC}/avatar/${encodeURIComponent(photoUrl)}?size=160`;
}
let rootStyle = `${stylesName}.${podiumPlaces > 3 ? 'PodiumSpotCondense' : 'PodiumSpot'}`;
let rootStyle = `${stylesName}.${themeName === 'TCO23' ? 'PodiumSpotCondense' : 'PodiumSpot'}`;
if (PODIUM_ITEM_MODIFIER[competitor.rank]) rootStyle += ` ${stylesName}.PodiumSpot--${PODIUM_ITEM_MODIFIER[competitor.rank]}`;
const fulfillment = competitor['tco_leaderboard.fulfillment']
? (parseFloat(competitor['tco_leaderboard.fulfillment']) * 100).toFixed(2).replace(/[.,]00$/, '')
Expand Down Expand Up @@ -175,24 +174,15 @@ export default function PodiumSpot(props) {
<div styleName={`${stylesName}.wave-wrap--${PODIUM_ITEM_MODIFIER[competitor.rank > 4 ? 4 : competitor.rank]}`}>
<svg
xmlns="http://www.w3.org/2000/svg"
width={podiumPlaces > 3 ? 200 : 392}
height={podiumPlaces > 3 ? 16 : 25}
width={200}
height={16}
fill="none"
viewBox={`0 0 ${podiumPlaces > 3 ? 200 : 392} ${podiumPlaces > 3 ? 16 : 25}`}
viewBox="0 0 200 16"
>
{
podiumPlaces > 3 ? (
<path
fill="#fff"
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"
/>
) : (
<path
fill="#fff"
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"
/>
)
}
<path
fill="#fff"
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"
/>
</svg>
<span styleName={`${stylesName}.leaderboard-avatar`}>
{
Expand Down Expand Up @@ -376,7 +366,6 @@ PodiumSpot.propTypes = {
isTopGear: PT.bool,
isAlgo: PT.bool,
themeName: PT.string,
podiumPlaces: number,
};

PodiumSpot.defaultProps = {
Expand All @@ -385,5 +374,4 @@ PodiumSpot.defaultProps = {
isTopGear: false,
isAlgo: false,
themeName: 'Default',
podiumPlaces: 1,
};
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ $podium-border-color: #ededf2;
text-transform: uppercase;
margin-bottom: 8px;
color: #000;
border: none;
padding: 0;
}

.handle-link {
Expand Down
47 changes: 18 additions & 29 deletions src/shared/components/SortingSelectBar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@ $down-arrow-size: $base-unit;
// 'Sort by' dropdown
.Select {
@include roboto-regular;
}

.is-focused {
font-weight: 700;
border-color: #b3b3b3 !important;
}

.Select-control {
Expand Down Expand Up @@ -88,8 +86,9 @@ $down-arrow-size: $base-unit;
overflow: visible;
}

.Select.is-focused:not(.is-open) > .Select-control {
border-color: #137d60 !important;
.Select.is-focused > .Select-control {
outline: none;
box-shadow: none;
}

.Select-value-label {
Expand Down Expand Up @@ -120,51 +119,41 @@ $down-arrow-size: $base-unit;
.Select-menu-outer {
width: 100%;
color: $tc-gray-90;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
font-weight: 400;
font-size: 12px;
background-color: $tc-white;
box-sizing: border-box;
margin-top: 2px;
padding: 4px 0;
border: 1px solid #ccc;
max-height: 200px;
position: absolute;
left: 0;
height: fit-content;
top: 100%;
right: 0;
z-index: 1000;
-webkit-overflow-scrolling: touch;
border: none !important;
}

.Select-menu {
max-height: none;
overflow-y: visible;
height: 22px;
font-size: 14px;
}

.Select-option {
box-sizing: border-box;
color: rgba(51, 51, 51, 0.8);
color: #2a2a2b;
cursor: pointer;
display: block;
padding: 6px 16px;
border-left: 1px solid #aaa;
border-right: 1px solid #aaa;
}

.Select-option:last-child {
border-bottom-right-radius: 5px !important;
border-bottom-left-radius: 5px !important;
border-bottom: 1px solid #aaa;
padding: 8px 15px;
}

.Select-option:first-child {
border-top: 1px solid #aaa;
border-top-left-radius: $base-unit;
border-top-right-radius: $base-unit;
.Select-option:hover {
color: #fff !important;
font-weight: 400 !important;
background-color: #229173 !important;
}

.Select-option:hover {
color: $tc-black;
.Select.is-focused:not(.is-open) > .Select-control {
border-color: #b3b3b3 !important;
}

.Select-option.is-selected {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,16 +587,29 @@ hr.hr {
.Select.is-focused > .Select-control {
outline: none;
box-shadow: none;
border-color: #151516 !important;
}

.Select-menu-outer {
margin-top: 1px;
font-size: 14px;

.Select-option {
color: #2a2a2b !important;
padding: 8px 15px;
}

.Select-option.is-focused {
background-color: #fff !important;
}

.Select-option.is-selected {
background-color: #137d60 !important;
color: $tc-white !important;
font-weight: 700;
color: #2a2a2b !important;
background-color: #fff !important;
}

.Select-option:hover {
background-color: #229173 !important;
color: #fff !important;
}
}
}
Expand Down
Loading