Skip to content

Commit 2376e34

Browse files
merge develop into hot-fix-no-result
2 parents 8a8a92e + a1c2683 commit 2376e34

File tree

12 files changed

+83
-59
lines changed

12 files changed

+83
-59
lines changed

.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ workflows:
174174
filters:
175175
branches:
176176
only:
177-
- develop
177+
- develop
178178
- hot-fix-no-result
179179
# This is alternate dev env for parallel testing
180180
- "build-test":
@@ -183,14 +183,14 @@ workflows:
183183
branches:
184184
only:
185185
- develop
186-
- feature-contentful
187186
# This is beta env for production soft releases
188187
- "build-prod-beta":
189188
context : org-global
190189
filters:
191190
branches:
192191
only:
193192
- develop
193+
- feature-contentful
194194
# Production builds are exectuted only on tagged commits to the
195195
# master branch.
196196
- "build-prod":

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

+1-11
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default function Podium(props) {
4242
} = props;
4343

4444
const renderPodium = (comps) => {
45-
let podiumSpots = comps.map(comp => (
45+
const podiumSpots = comps.map(comp => (
4646
<div key={comp.rank} styleName="podium-column">
4747
<PodiumSpot
4848
competitor={comp}
@@ -55,16 +55,6 @@ export default function Podium(props) {
5555
</div>
5656
));
5757

58-
if (comps.length === 3) {
59-
podiumSpots = [
60-
...podiumSpots.slice(0, 0),
61-
podiumSpots[1],
62-
...podiumSpots.slice(1, 1),
63-
podiumSpots[0],
64-
...podiumSpots.slice(2),
65-
];
66-
}
67-
6858
return (
6959
<div styleName="PodiumWrap">
7060
{podiumSpots}

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const PODIUM_ITEM_MODIFIER = {
4242
1: 'first',
4343
2: 'second',
4444
3: 'third',
45+
4: 'fourth',
4546
};
4647

4748
/**
@@ -53,11 +54,13 @@ const CUSTOM_STYLES = {
5354
1: avatarStyles.gold,
5455
2: avatarStyles.silver,
5556
3: avatarStyles.bronze,
57+
4: avatarStyles.iron,
5658
},
5759
TCO20: {
5860
1: avatarStyles['tco20-1'],
5961
2: avatarStyles['tco20-2'],
6062
3: avatarStyles['tco20-3'],
63+
4: avatarStyles['tco20-4'],
6164
},
6265
};
6366

@@ -68,6 +71,7 @@ const DISPLAY_RANKING = {
6871
1: '1',
6972
2: '2',
7073
3: '3',
74+
4: '4',
7175
};
7276

7377
const THEME = {
@@ -158,7 +162,7 @@ export default function PodiumSpot(props) {
158162
isCopilot ? (
159163
<div styleName={`${stylesName}.stats`}>
160164
<span styleName={`${stylesName}.value`}>{competitor.fulfillment}</span>
161-
<span>fulfillment</span>
165+
<span styleName={`${stylesName}.value-title`}>fulfillment</span>
162166
</div>
163167
) : null
164168
}

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

+40-29
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ $podium-border-color: #ededf2;
33

44
.PodiumSpot {
55
border-radius: 6px;
6-
padding: 25px;
6+
padding: 23px 15px;
77
display: flex;
8-
width: 324px;
8+
width: auto;
99

1010
.leaderboard-avatar {
1111
display: inline-block;
12-
overflow: hidden;
1312
position: relative;
1413
margin-bottom: 12px;
1514
margin-right: 20px;
15+
overflow: visible;
1616
}
1717

1818
.ranking {
@@ -23,7 +23,7 @@ $podium-border-color: #ededf2;
2323
display: inline-block;
2424
position: absolute;
2525
right: 0;
26-
bottom: 10px;
26+
bottom: -10px;
2727
font-size: 15px;
2828
}
2929

@@ -35,15 +35,16 @@ $podium-border-color: #ededf2;
3535
color: #56565d;
3636
font-size: 18px;
3737
display: flex;
38-
justify-content: space-around;
38+
justify-content: center;
3939
flex-direction: column;
4040

4141
.stats {
4242
color: #747480;
43-
font-size: 15px;
43+
font-size: 16px;
4444
font-weight: 400;
4545
line-height: 25px;
4646
display: flex;
47+
margin-bottom: 4px;
4748

4849
.value-title {
4950
color: #2a2a2a;
@@ -91,12 +92,12 @@ $podium-border-color: #ededf2;
9192
a.profile-link {
9293
color: #0d61bf;
9394
font-family: Barlow, sans-serif;
94-
font-size: 20px;
95+
font-size: 16px;
9596
font-weight: 600;
96-
line-height: 24px;
97+
line-height: 19px;
9798
text-align: left;
9899
text-decoration: underline;
99-
margin-bottom: 15px;
100+
margin-bottom: 13px;
100101

101102
&:hover {
102103
text-decoration: none;
@@ -135,31 +136,41 @@ $podium-border-color: #ededf2;
135136
}
136137
}
137138

139+
.PodiumSpot--fourth {
140+
background-color: #8dccd4;
141+
142+
.ranking {
143+
background-color: #2a2a2a;
144+
color: #fff;
145+
}
146+
}
147+
138148
.PodiumSpot--first,
139149
.PodiumSpot--second,
140-
.PodiumSpot--third {
150+
.PodiumSpot--third,
151+
.PodiumSpot--fourth {
141152
margin-top: 0;
142153

143154
.leaderboard-avatar {
144-
height: 64px;
145-
width: 64px;
155+
height: 79px;
156+
width: 79px;
146157
}
147158
}
148159

149-
@include md-to-lg {
150-
.PodiumSpot--first .leaderboard-avatar,
151-
.PodiumSpot--second .leaderboard-avatar,
152-
.PodiumSpot--third .leaderboard-avatar {
153-
height: 96px;
154-
width: 96px;
155-
}
156-
}
157-
158-
@include xl {
159-
.PodiumSpot--first .leaderboard-avatar,
160-
.PodiumSpot--second .leaderboard-avatar,
161-
.PodiumSpot--third .leaderboard-avatar {
162-
height: 128px;
163-
width: 128px;
164-
}
165-
}
160+
// @include md-to-lg {
161+
// .PodiumSpot--first .leaderboard-avatar,
162+
// .PodiumSpot--second .leaderboard-avatar,
163+
// .PodiumSpot--third .leaderboard-avatar {
164+
// height: 96px;
165+
// width: 96px;
166+
// }
167+
// }
168+
169+
// @include xl {
170+
// .PodiumSpot--first .leaderboard-avatar,
171+
// .PodiumSpot--second .leaderboard-avatar,
172+
// .PodiumSpot--third .leaderboard-avatar {
173+
// height: 128px;
174+
// width: 128px;
175+
// }
176+
// }

src/shared/components/Leaderboard/avatarStyles.scss

+14-7
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66
width: 100%;
77
}
88

9-
.bronze {
10-
@include avatar;
11-
12-
border-color: #d98f64;
13-
}
14-
159
.default {
1610
@include avatar;
1711

@@ -30,9 +24,22 @@
3024
border-color: #d1d0cf;
3125
}
3226

27+
.bronze {
28+
@include avatar;
29+
30+
border-color: #d98f64;
31+
}
32+
33+
.iron {
34+
@include avatar;
35+
36+
border-color: #d98f64;
37+
}
38+
3339
.tco20-1,
3440
.tco20-2,
35-
.tco20-3 {
41+
.tco20-3,
42+
.tco20-4 {
3643
border-radius: 50%;
3744
height: 100%;
3845
width: 100%;

src/shared/components/ProfilePage/Stats/index.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ Active Challenges
151151
className={subTrackRating ? styles.rating : ''}
152152
style={{ color: subTrackRating ? getRatingColor(parseInt(subTrackRating.toString().replace(/\D/g, ''), 10)) : undefined }}
153153
>
154-
<Link to={`/members/${info.handle}`}>
154+
<a href={`/members/${info.handle}`} target="_blank" rel="noopener noreferrer">
155155
{info.handle || '-'}
156-
</Link>
156+
</a>
157157
</div>
158158
</li>
159159
)

src/shared/components/challenge-detail/Submissions/index.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ class SubmissionsComponent extends React.Component {
179179
}
180180
case 'Time':
181181
case 'Submission Date': {
182-
valueA = new Date(a.submissions[0].submissionTime);
183-
valueB = new Date(b.submissions[0].submissionTime);
182+
valueA = new Date(a.submissions && a.submissions[0].submissionTime);
183+
valueB = new Date(b.submissions && b.submissions[0].submissionTime);
184184
break;
185185
}
186186
case 'Initial / Final Score': {

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import SwitchWithLabel from 'components/SwitchWithLabel';
99
import { challenge as challengeUtils } from 'topcoder-react-lib';
1010
import { COMPETITION_TRACKS as TRACKS } from 'utils/tc';
1111

12+
import localStorage from 'localStorage';
1213
import ChallengeSearchBar from './ChallengeSearchBar';
1314
import EditTrackPanel from './EditTrackPanel';
1415
import FiltersIcon from './FiltersSwitch/filters-icon.svg';
@@ -55,7 +56,9 @@ export default function ChallengeFilters({
5556

5657
const switchTrack = (track, on) => {
5758
const act = on ? Filter.addTrack : Filter.removeTrack;
58-
setFilterState(act(filterState, track));
59+
const filterObj = act(filterState, track);
60+
localStorage.setItem('trackStatus', JSON.stringify(filterObj));
61+
setFilterState(filterObj);
5962
};
6063

6164
return (

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

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import shortId from 'shortid';
1010
import FilterPanel from 'components/challenge-listing/Filters/ChallengeFilters';
1111
import PT from 'prop-types';
1212
import React from 'react';
13+
import localStorage from 'localStorage';
1314
import sidebarActions from 'actions/challenge-listing/sidebar';
1415
import { BUCKETS, isReviewOpportunitiesBucket } from 'utils/challenge-listing/buckets';
1516
import { bindActionCreators } from 'redux';
@@ -63,6 +64,12 @@ export class Container extends React.Component {
6364
const query = qs.parse(window.location.search.slice(1));
6465
if (query.filter && !filterState.track) {
6566
setFilterState(query.filter);
67+
} else {
68+
const trackStatus = localStorage.getItem('trackStatus');
69+
const filterObj = trackStatus ? JSON.parse(trackStatus) : null;
70+
if (filterObj) {
71+
setFilterState(filterObj);
72+
}
6673
}
6774
}
6875

src/shared/containers/challenge-listing/Listing/index.jsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,12 @@ export class ListingContainer extends React.Component {
6969
logger.error('Attempt to mount multiple instances of ChallengeListingPageContainer at the same time!');
7070
} else mounted = true;
7171

72-
this.loadChallenges();
72+
if (BUCKETS.PAST !== activeBucket) this.loadChallenges();
7373
}
7474

7575
componentDidUpdate(prevProps) {
7676
const {
77+
activeBucket,
7778
auth,
7879
dropChallenges,
7980
getCommunitiesList,
@@ -98,7 +99,8 @@ export class ListingContainer extends React.Component {
9899
});
99100
}
100101

101-
if (!loadingActiveChallengesUUID && !_.isEmpty(meta) && !allActiveChallengesLoaded) {
102+
if (!loadingActiveChallengesUUID && !_.isEmpty(meta) && !allActiveChallengesLoaded
103+
&& BUCKETS.PAST !== activeBucket) {
102104
getRestActiveChallenges(auth.tokenV3);
103105
}
104106
}

src/shared/containers/tco/Leaderboard/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class LeaderboardPageContainer extends React.Component {
7373
? (<LoadingIndicator />) : (
7474
<div>
7575
<div styleName="Leaderboard">
76-
<h2 styleName="section-title">{title}</h2>
76+
{title ? (<h2 styleName="section-title">{title}</h2>) : null}
7777
<Podium
7878
competitors={ld.slice(0, podiumSpots)}
7979
isCopilot={isCopilot}

src/shared/containers/tco/Leaderboard/themes/styles.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
.Leaderboard {
44
padding: 0 15px;
5-
margin: 20px auto;
5+
margin: 50px auto;
66
max-width: $screen-md;
77
}
88

0 commit comments

Comments
 (0)