Skip to content

Commit 4d453d8

Browse files
Merge pull request #4918 from topcoder-platform/milestone-20200917
Smoke Testing 2020-09-15 #1
2 parents 52dd617 + 0f91bf0 commit 4d453d8

File tree

9 files changed

+41
-47
lines changed

9 files changed

+41
-47
lines changed

.circleci/config.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ workflows:
230230
filters:
231231
branches:
232232
only:
233-
- milestone-20200917
234233
- develop
235234
# This is alternate dev env for parallel testing
236235
- "build-test":
@@ -260,7 +259,7 @@ workflows:
260259
filters:
261260
branches:
262261
only:
263-
- feature-contentful
262+
- develop
264263
# Production builds are exectuted
265264
# when PR is merged to the master
266265
# Don't change anything in this configuration

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

+7-4
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,15 @@ exports[`renders marathon 1`] = `
202202
className="src-shared-components-ChallengeTile-___style__completed-challenge___3w5tT"
203203
>
204204
<header>
205-
<a
205+
<Link
206206
className="src-shared-components-ChallengeTile-___style__name___1jF7j"
207-
href="https://community.topcoder.com/longcontest/stats/?module=ViewOverview&rd=17153"
207+
replace={false}
208+
to="/challenges/15404"
208209
>
209-
2018 TCO Marathon
210-
</a>
210+
<span>
211+
2018 TCO Marathon
212+
</span>
213+
</Link>
211214
<p
212215
className="src-shared-components-ChallengeTile-___style__subtrack-color___2AJaw"
213216
>

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
"tc-accounts": "git+https://github.com/appirio-tech/accounts-app.git#dev",
138138
"tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.3",
139139
"tc-ui": "^1.0.12",
140-
"topcoder-react-lib": "1.0.4",
140+
"topcoder-react-lib": "1000.22.6",
141141
"topcoder-react-ui-kit": "2.0.0",
142142
"topcoder-react-utils": "0.7.8",
143143
"turndown": "^4.0.2",

src/shared/components/ChallengeTile/index.jsx

+4-14
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Challenge tile.
33
*/
44
/* eslint-env browser */
5-
import _ from 'lodash';
65
import React from 'react';
76
import PT from 'prop-types';
87
import { Link } from 'react-router-dom';
@@ -83,36 +82,27 @@ class ChallengeTile extends React.Component {
8382
margin: '10px 5px',
8483
};
8584

86-
const isDataScience = track === COMPETITION_TRACKS.DATA_SCIENCE;
8785
const isDevelopment = track === COMPETITION_TRACKS.DEVELOP;
8886
const isDesign = track === COMPETITION_TRACKS.DESIGN;
8987

90-
const roundId = isDataScience ? _.get(challenge, 'rounds.0.id') : 0;
91-
9288
return (
9389
<div styleName="challenge tile" style={extraStyle}>
9490
<div styleName={outStyleName}>
9591
<div styleName="completed-challenge">
9692
<header>
97-
{ !isDataScience && (!challenge.isPrivate
93+
{ !challenge.isPrivate
9894
? (
9995
<Link to={`/challenges/${challenge.id}`} styleName="name">
10096
<span>
10197
{ challenge.name }
10298
</span>
10399
</Link>
104-
) : (
100+
)
101+
: (
105102
<span>
106103
{ challenge.name }
107104
</span>
108-
)) }
109-
110-
{ isDataScience
111-
&& (
112-
<a styleName="name" href={`https://community.topcoder.com/longcontest/stats/?module=ViewOverview&rd=${roundId}`}>
113-
{ challenge.name }
114-
</a>
115-
) }
105+
)}
116106

117107
<p styleName="subtrack-color">
118108
{underscoreReplace(type)}

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

+23-13
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,10 @@ const processPastChallenge = (challenge) => {
111111
class SubTrackChallengeView extends React.Component {
112112
constructor(props, context) {
113113
super(props, context);
114-
// this is current page number. starts with 0.
115-
// everytime we scroll at the bottom, we query from offset = pageNum * CHALLENGE_PER_PAGE
116114
this.state = {
117-
// this is current page number. starts with 0.
115+
// this is current page number. starts with 1.
118116
// everytime we scroll at the bottom, we query from offset = pageNum * CHALLENGE_PER_PAGE
119-
pageNum: 0,
117+
pageNum: 1,
120118
// which challenge's modal should be poped. null means no modal
121119
challengeIndexToPopModal: null,
122120
};
@@ -140,13 +138,17 @@ class SubTrackChallengeView extends React.Component {
140138
userId,
141139
} = this.props;
142140

141+
const {
142+
pageNum,
143+
} = this.state;
144+
143145
if (track === 'DEVELOP' || track === 'DESIGN') {
144146
if (!loadingSubTrackChallengesUUID) {
145147
loadSubtrackChallenges(
146148
handle,
147149
auth.tokenV3,
148150
track, subTrack,
149-
0,
151+
pageNum,
150152
CHALLENGE_PER_PAGE,
151153
true,
152154
userId,
@@ -155,11 +157,12 @@ class SubTrackChallengeView extends React.Component {
155157
} else if (track === 'DATA_SCIENCE') {
156158
if (subTrack === 'SRM') {
157159
if (!loadingSRMUUID) {
158-
loadSRM(handle, auth.tokenV3, 0, CHALLENGE_PER_PAGE, true);
160+
// pageNum - 1 to match with v4 offset
161+
loadSRM(handle, auth.tokenV3, pageNum - 1, CHALLENGE_PER_PAGE, true);
159162
}
160163
} else if (subTrack === 'MARATHON_MATCH') {
161164
if (!loadingMarathonUUID) {
162-
loadMarathon(handle, auth.tokenV3, 0, CHALLENGE_PER_PAGE, true);
165+
loadMarathon(handle, userId, auth.tokenV3, pageNum, CHALLENGE_PER_PAGE, true);
163166
}
164167
}
165168
}
@@ -204,12 +207,12 @@ class SubTrackChallengeView extends React.Component {
204207
} else if (track === 'DATA_SCIENCE') {
205208
if (subTrack === 'SRM') {
206209
if (!loadingSRMUUID) {
207-
loadSRM(handle, auth.tokenV3, pageNum + 1, CHALLENGE_PER_PAGE, false);
210+
loadSRM(handle, auth.tokenV3, pageNum, CHALLENGE_PER_PAGE, false);
208211
this.setState({ pageNum: pageNum + 1 });
209212
}
210213
} else if (subTrack === 'MARATHON_MATCH') {
211214
if (!loadingMarathonUUID) {
212-
loadMarathon(handle, auth.tokenV3, pageNum + 1, CHALLENGE_PER_PAGE, false);
215+
loadMarathon(handle, userId, auth.tokenV3, pageNum + 1, CHALLENGE_PER_PAGE, false);
213216
this.setState({ pageNum: pageNum + 1 });
214217
}
215218
}
@@ -245,7 +248,7 @@ class SubTrackChallengeView extends React.Component {
245248
userId,
246249
} = this.props;
247250

248-
if (pageNum === 0
251+
if (pageNum === 1
249252
&& (loadingSubTrackChallengesUUID || loadingSRMUUID || loadingMarathonUUID)) {
250253
return <LoadingIndicator />;
251254
}
@@ -347,7 +350,6 @@ class SubTrackChallengeView extends React.Component {
347350
userMarathons,
348351
item => ({
349352
...item,
350-
submissionEndDate: _.get(item, 'rounds.0.systemTestEndAt'),
351353
pointTotal: _.get(item, 'rounds.0.userMMDetails.pointTotal'),
352354
}),
353355
);
@@ -440,10 +442,18 @@ function mapDispatchToProps(dispatch) {
440442
dispatch(action.getUserSrmInit(handle, uuid));
441443
dispatch(action.getUserSrmDone(uuid, handle, tokenV3, pageNum, pageSize, refresh));
442444
},
443-
loadMarathon: (handle, tokenV3, pageNum, pageSize, refresh) => {
445+
loadMarathon: (handle, memberId, tokenV3, pageNum, pageSize, refresh) => {
444446
const uuid = shortId();
445447
dispatch(action.getUserMarathonInit(handle, uuid));
446-
dispatch(action.getUserMarathonDone(uuid, handle, tokenV3, pageNum, pageSize, refresh));
448+
dispatch(action.getUserMarathonDone(
449+
uuid,
450+
handle,
451+
memberId,
452+
tokenV3,
453+
pageNum,
454+
pageSize,
455+
refresh,
456+
));
447457
},
448458
};
449459
}

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

-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import PT from 'prop-types';
66
import SwitchWithLabel from 'components/SwitchWithLabel';
77
import { challenge as challengeUtils } from 'topcoder-react-lib';
88
import { COMPETITION_TRACKS as TRACKS } from 'utils/tc';
9-
import _ from 'lodash';
109

11-
import localStorage from 'localStorage';
1210
import ChallengeSearchBar from './ChallengeSearchBar';
1311
import EditTrackPanel from './EditTrackPanel';
1412
import FiltersIcon from './FiltersSwitch/filters-icon.svg';
@@ -54,8 +52,6 @@ export default function ChallengeFilters({
5452
const switchTrack = (track, on) => {
5553
const act = on ? Filter.addTrack : Filter.removeTrack;
5654
const filterObj = act(filterState, track);
57-
const newFilterObj = _.pick(filterObj, 'tracks');
58-
localStorage.setItem('trackStatus', JSON.stringify(newFilterObj));
5955
setFilterState(filterObj);
6056
};
6157

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

-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ export default function FiltersPanel({
349349
setFilterState({});
350350
selectCommunity(defaultCommunityId);
351351
setSearchText('');
352-
localStorage.setItem('trackStatus', JSON.stringify({}));
353352
}}
354353
size="sm"
355354
theme={{ button: style.button }}

src/shared/components/challenge-listing/Sidebar/BucketSelector/index.jsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import './style.scss';
1515

1616
const Filter = challengeUtils.filter;
1717

18-
const RSS_LINK = 'http://feeds.topcoder.com/challenges/feed?list=active&contestType=all';
18+
// DISABLED: Until feeds.topcoder.com domain fixed community-app#4606
19+
// const RSS_LINK = 'http://feeds.topcoder.com/challenges/feed?list=active&contestType=all';
1920

2021
export default function BucketSelector({
2122
activeBucket,
@@ -109,11 +110,14 @@ export default function BucketSelector({
109110
) : ''
110111
}
111112
<hr />
113+
{/* DISABLED: Until feeds.topcoder.com domain fixed community-app#4606 */}
114+
{/*
112115
<div styleName="get-rss">
113116
<a href={RSS_LINK}>
114117
Get the RSS feed
115118
</a>
116119
</div>
120+
*/}
117121
</div>
118122
);
119123
}

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

-7
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ 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';
1413
import sidebarActions from 'actions/challenge-listing/sidebar';
1514
import { BUCKETS, isReviewOpportunitiesBucket } from 'utils/challenge-listing/buckets';
1615
import { bindActionCreators } from 'redux';
@@ -64,12 +63,6 @@ export class Container extends React.Component {
6463
const query = qs.parse(window.location.search.slice(1));
6564
if (query.filter && !filterState.track) {
6665
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-
}
7366
}
7467
}
7568

0 commit comments

Comments
 (0)