diff --git a/.circleci/config.yml b/.circleci/config.yml index cd03e3288f..4a590c1e08 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -230,7 +230,6 @@ workflows: filters: branches: only: - - milestone-20200917 - develop # This is alternate dev env for parallel testing - "build-test": @@ -260,7 +259,7 @@ workflows: filters: branches: only: - - feature-contentful + - develop # Production builds are exectuted # when PR is merged to the master # Don't change anything in this configuration diff --git a/__tests__/shared/components/ChallengeTile/__snapshots__/index.jsx.snap b/__tests__/shared/components/ChallengeTile/__snapshots__/index.jsx.snap index 26ba777088..c733309a43 100644 --- a/__tests__/shared/components/ChallengeTile/__snapshots__/index.jsx.snap +++ b/__tests__/shared/components/ChallengeTile/__snapshots__/index.jsx.snap @@ -202,12 +202,15 @@ exports[`renders marathon 1`] = ` className="src-shared-components-ChallengeTile-___style__completed-challenge___3w5tT" >
- - 2018 TCO Marathon - + + 2018 TCO Marathon + +

diff --git a/package.json b/package.json index c02656c845..049a57b7e7 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,7 @@ "tc-accounts": "git+https://github.com/appirio-tech/accounts-app.git#dev", "tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.3", "tc-ui": "^1.0.12", - "topcoder-react-lib": "1.0.4", + "topcoder-react-lib": "1000.22.6", "topcoder-react-ui-kit": "2.0.0", "topcoder-react-utils": "0.7.8", "turndown": "^4.0.2", diff --git a/src/shared/components/ChallengeTile/index.jsx b/src/shared/components/ChallengeTile/index.jsx index 47e389c869..87f935e7fe 100644 --- a/src/shared/components/ChallengeTile/index.jsx +++ b/src/shared/components/ChallengeTile/index.jsx @@ -2,7 +2,6 @@ * Challenge tile. */ /* eslint-env browser */ -import _ from 'lodash'; import React from 'react'; import PT from 'prop-types'; import { Link } from 'react-router-dom'; @@ -83,36 +82,27 @@ class ChallengeTile extends React.Component { margin: '10px 5px', }; - const isDataScience = track === COMPETITION_TRACKS.DATA_SCIENCE; const isDevelopment = track === COMPETITION_TRACKS.DEVELOP; const isDesign = track === COMPETITION_TRACKS.DESIGN; - const roundId = isDataScience ? _.get(challenge, 'rounds.0.id') : 0; - return (

- { !isDataScience && (!challenge.isPrivate + { !challenge.isPrivate ? ( { challenge.name } - ) : ( + ) + : ( { challenge.name } - )) } - - { isDataScience - && ( - - { challenge.name } - - ) } + )}

{underscoreReplace(type)} diff --git a/src/shared/components/ProfilePage/Stats/SubTrackChallengeView/index.jsx b/src/shared/components/ProfilePage/Stats/SubTrackChallengeView/index.jsx index 1fadb2a65f..332374de38 100644 --- a/src/shared/components/ProfilePage/Stats/SubTrackChallengeView/index.jsx +++ b/src/shared/components/ProfilePage/Stats/SubTrackChallengeView/index.jsx @@ -111,12 +111,10 @@ const processPastChallenge = (challenge) => { class SubTrackChallengeView extends React.Component { constructor(props, context) { super(props, context); - // this is current page number. starts with 0. - // everytime we scroll at the bottom, we query from offset = pageNum * CHALLENGE_PER_PAGE this.state = { - // this is current page number. starts with 0. + // this is current page number. starts with 1. // everytime we scroll at the bottom, we query from offset = pageNum * CHALLENGE_PER_PAGE - pageNum: 0, + pageNum: 1, // which challenge's modal should be poped. null means no modal challengeIndexToPopModal: null, }; @@ -140,13 +138,17 @@ class SubTrackChallengeView extends React.Component { userId, } = this.props; + const { + pageNum, + } = this.state; + if (track === 'DEVELOP' || track === 'DESIGN') { if (!loadingSubTrackChallengesUUID) { loadSubtrackChallenges( handle, auth.tokenV3, track, subTrack, - 0, + pageNum, CHALLENGE_PER_PAGE, true, userId, @@ -155,11 +157,12 @@ class SubTrackChallengeView extends React.Component { } else if (track === 'DATA_SCIENCE') { if (subTrack === 'SRM') { if (!loadingSRMUUID) { - loadSRM(handle, auth.tokenV3, 0, CHALLENGE_PER_PAGE, true); + // pageNum - 1 to match with v4 offset + loadSRM(handle, auth.tokenV3, pageNum - 1, CHALLENGE_PER_PAGE, true); } } else if (subTrack === 'MARATHON_MATCH') { if (!loadingMarathonUUID) { - loadMarathon(handle, auth.tokenV3, 0, CHALLENGE_PER_PAGE, true); + loadMarathon(handle, userId, auth.tokenV3, pageNum, CHALLENGE_PER_PAGE, true); } } } @@ -204,12 +207,12 @@ class SubTrackChallengeView extends React.Component { } else if (track === 'DATA_SCIENCE') { if (subTrack === 'SRM') { if (!loadingSRMUUID) { - loadSRM(handle, auth.tokenV3, pageNum + 1, CHALLENGE_PER_PAGE, false); + loadSRM(handle, auth.tokenV3, pageNum, CHALLENGE_PER_PAGE, false); this.setState({ pageNum: pageNum + 1 }); } } else if (subTrack === 'MARATHON_MATCH') { if (!loadingMarathonUUID) { - loadMarathon(handle, auth.tokenV3, pageNum + 1, CHALLENGE_PER_PAGE, false); + loadMarathon(handle, userId, auth.tokenV3, pageNum + 1, CHALLENGE_PER_PAGE, false); this.setState({ pageNum: pageNum + 1 }); } } @@ -245,7 +248,7 @@ class SubTrackChallengeView extends React.Component { userId, } = this.props; - if (pageNum === 0 + if (pageNum === 1 && (loadingSubTrackChallengesUUID || loadingSRMUUID || loadingMarathonUUID)) { return ; } @@ -347,7 +350,6 @@ class SubTrackChallengeView extends React.Component { userMarathons, item => ({ ...item, - submissionEndDate: _.get(item, 'rounds.0.systemTestEndAt'), pointTotal: _.get(item, 'rounds.0.userMMDetails.pointTotal'), }), ); @@ -440,10 +442,18 @@ function mapDispatchToProps(dispatch) { dispatch(action.getUserSrmInit(handle, uuid)); dispatch(action.getUserSrmDone(uuid, handle, tokenV3, pageNum, pageSize, refresh)); }, - loadMarathon: (handle, tokenV3, pageNum, pageSize, refresh) => { + loadMarathon: (handle, memberId, tokenV3, pageNum, pageSize, refresh) => { const uuid = shortId(); dispatch(action.getUserMarathonInit(handle, uuid)); - dispatch(action.getUserMarathonDone(uuid, handle, tokenV3, pageNum, pageSize, refresh)); + dispatch(action.getUserMarathonDone( + uuid, + handle, + memberId, + tokenV3, + pageNum, + pageSize, + refresh, + )); }, }; } diff --git a/src/shared/components/challenge-listing/Filters/ChallengeFilters.jsx b/src/shared/components/challenge-listing/Filters/ChallengeFilters.jsx index 2ed2b5684d..4866ffdd4e 100644 --- a/src/shared/components/challenge-listing/Filters/ChallengeFilters.jsx +++ b/src/shared/components/challenge-listing/Filters/ChallengeFilters.jsx @@ -6,9 +6,7 @@ import PT from 'prop-types'; import SwitchWithLabel from 'components/SwitchWithLabel'; import { challenge as challengeUtils } from 'topcoder-react-lib'; import { COMPETITION_TRACKS as TRACKS } from 'utils/tc'; -import _ from 'lodash'; -import localStorage from 'localStorage'; import ChallengeSearchBar from './ChallengeSearchBar'; import EditTrackPanel from './EditTrackPanel'; import FiltersIcon from './FiltersSwitch/filters-icon.svg'; @@ -54,8 +52,6 @@ export default function ChallengeFilters({ const switchTrack = (track, on) => { const act = on ? Filter.addTrack : Filter.removeTrack; const filterObj = act(filterState, track); - const newFilterObj = _.pick(filterObj, 'tracks'); - localStorage.setItem('trackStatus', JSON.stringify(newFilterObj)); setFilterState(filterObj); }; diff --git a/src/shared/components/challenge-listing/Filters/FiltersPanel/index.jsx b/src/shared/components/challenge-listing/Filters/FiltersPanel/index.jsx index a3320e0735..a5f71d344b 100644 --- a/src/shared/components/challenge-listing/Filters/FiltersPanel/index.jsx +++ b/src/shared/components/challenge-listing/Filters/FiltersPanel/index.jsx @@ -349,7 +349,6 @@ export default function FiltersPanel({ setFilterState({}); selectCommunity(defaultCommunityId); setSearchText(''); - localStorage.setItem('trackStatus', JSON.stringify({})); }} size="sm" theme={{ button: style.button }} diff --git a/src/shared/components/challenge-listing/Sidebar/BucketSelector/index.jsx b/src/shared/components/challenge-listing/Sidebar/BucketSelector/index.jsx index 3f267d87c3..66d7ea6988 100644 --- a/src/shared/components/challenge-listing/Sidebar/BucketSelector/index.jsx +++ b/src/shared/components/challenge-listing/Sidebar/BucketSelector/index.jsx @@ -15,7 +15,8 @@ import './style.scss'; const Filter = challengeUtils.filter; -const RSS_LINK = 'http://feeds.topcoder.com/challenges/feed?list=active&contestType=all'; +// DISABLED: Until feeds.topcoder.com domain fixed community-app#4606 +// const RSS_LINK = 'http://feeds.topcoder.com/challenges/feed?list=active&contestType=all'; export default function BucketSelector({ activeBucket, @@ -109,11 +110,14 @@ export default function BucketSelector({ ) : '' }


+ {/* DISABLED: Until feeds.topcoder.com domain fixed community-app#4606 */} + {/* + */}
); } diff --git a/src/shared/containers/challenge-listing/FilterPanel.jsx b/src/shared/containers/challenge-listing/FilterPanel.jsx index 7fe064ce44..df1a09565d 100644 --- a/src/shared/containers/challenge-listing/FilterPanel.jsx +++ b/src/shared/containers/challenge-listing/FilterPanel.jsx @@ -10,7 +10,6 @@ import shortId from 'shortid'; import FilterPanel from 'components/challenge-listing/Filters/ChallengeFilters'; import PT from 'prop-types'; import React from 'react'; -import localStorage from 'localStorage'; import sidebarActions from 'actions/challenge-listing/sidebar'; import { BUCKETS, isReviewOpportunitiesBucket } from 'utils/challenge-listing/buckets'; import { bindActionCreators } from 'redux'; @@ -64,12 +63,6 @@ export class Container extends React.Component { const query = qs.parse(window.location.search.slice(1)); if (query.filter && !filterState.track) { setFilterState(query.filter); - } else { - const trackStatus = localStorage.getItem('trackStatus'); - const filterObj = trackStatus ? JSON.parse(trackStatus) : null; - if (filterObj) { - setFilterState(filterObj); - } } }