From 774f8c74df17a63c645c24be57fda8ff660d13ff Mon Sep 17 00:00:00 2001 From: rashmi73 <41687423+rashmi73@users.noreply.github.com> Date: Thu, 10 Sep 2020 04:35:25 +0530 Subject: [PATCH 01/32] Update FilterPanel.jsx --- src/shared/containers/challenge-listing/FilterPanel.jsx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/shared/containers/challenge-listing/FilterPanel.jsx b/src/shared/containers/challenge-listing/FilterPanel.jsx index 7fe064ce44..c161b03d44 100644 --- a/src/shared/containers/challenge-listing/FilterPanel.jsx +++ b/src/shared/containers/challenge-listing/FilterPanel.jsx @@ -64,12 +64,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); - } } } From 8227ebd1b9b1ea6f3e8b319ebe08d3bc33450c73 Mon Sep 17 00:00:00 2001 From: rashmi73 <41687423+rashmi73@users.noreply.github.com> Date: Thu, 10 Sep 2020 19:58:37 +0530 Subject: [PATCH 02/32] Update ChallengeFilters.jsx --- .../components/challenge-listing/Filters/ChallengeFilters.jsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/shared/components/challenge-listing/Filters/ChallengeFilters.jsx b/src/shared/components/challenge-listing/Filters/ChallengeFilters.jsx index 2ed2b5684d..cdb32d3e76 100644 --- a/src/shared/components/challenge-listing/Filters/ChallengeFilters.jsx +++ b/src/shared/components/challenge-listing/Filters/ChallengeFilters.jsx @@ -8,7 +8,6 @@ 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'; @@ -55,7 +54,6 @@ export default function ChallengeFilters({ 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); }; From fe9e708007ddd759c17cef19ec963f2bdba9fa20 Mon Sep 17 00:00:00 2001 From: rashmi73 <41687423+rashmi73@users.noreply.github.com> Date: Thu, 10 Sep 2020 20:01:02 +0530 Subject: [PATCH 03/32] Update index.jsx --- .../components/challenge-listing/Filters/FiltersPanel/index.jsx | 1 - 1 file changed, 1 deletion(-) 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 }} From 01405d9e92e0d869a690e0cc91a97b1881d103e4 Mon Sep 17 00:00:00 2001 From: rashmi73 <41687423+rashmi73@users.noreply.github.com> Date: Thu, 10 Sep 2020 20:01:52 +0530 Subject: [PATCH 04/32] Update FilterPanel.jsx --- src/shared/containers/challenge-listing/FilterPanel.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/shared/containers/challenge-listing/FilterPanel.jsx b/src/shared/containers/challenge-listing/FilterPanel.jsx index c161b03d44..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'; From 1310b69f5b1d3e0e2251d04da1f9ca05054c04d5 Mon Sep 17 00:00:00 2001 From: rashmi73 <41687423+rashmi73@users.noreply.github.com> Date: Thu, 10 Sep 2020 20:12:56 +0530 Subject: [PATCH 05/32] Update ChallengeFilters.jsx --- .../components/challenge-listing/Filters/ChallengeFilters.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/shared/components/challenge-listing/Filters/ChallengeFilters.jsx b/src/shared/components/challenge-listing/Filters/ChallengeFilters.jsx index cdb32d3e76..249582b835 100644 --- a/src/shared/components/challenge-listing/Filters/ChallengeFilters.jsx +++ b/src/shared/components/challenge-listing/Filters/ChallengeFilters.jsx @@ -53,7 +53,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'); setFilterState(filterObj); }; From ed9025efb693193ca53158c9c7b2cd2a3c54a243 Mon Sep 17 00:00:00 2001 From: rashmi73 <41687423+rashmi73@users.noreply.github.com> Date: Thu, 10 Sep 2020 20:19:12 +0530 Subject: [PATCH 06/32] Update ChallengeFilters.jsx --- .../components/challenge-listing/Filters/ChallengeFilters.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/shared/components/challenge-listing/Filters/ChallengeFilters.jsx b/src/shared/components/challenge-listing/Filters/ChallengeFilters.jsx index 249582b835..4866ffdd4e 100644 --- a/src/shared/components/challenge-listing/Filters/ChallengeFilters.jsx +++ b/src/shared/components/challenge-listing/Filters/ChallengeFilters.jsx @@ -6,7 +6,6 @@ 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 ChallengeSearchBar from './ChallengeSearchBar'; import EditTrackPanel from './EditTrackPanel'; From f22bd8b2490c155e986335c26fa2456f501f23db Mon Sep 17 00:00:00 2001 From: narekcat Date: Thu, 10 Sep 2020 19:04:45 +0400 Subject: [PATCH 07/32] fix: for issue #2069 --- .../Stats/SubTrackChallengeView/index.jsx | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/shared/components/ProfilePage/Stats/SubTrackChallengeView/index.jsx b/src/shared/components/ProfilePage/Stats/SubTrackChallengeView/index.jsx index 1fadb2a65f..961606ce5f 100644 --- a/src/shared/components/ProfilePage/Stats/SubTrackChallengeView/index.jsx +++ b/src/shared/components/ProfilePage/Stats/SubTrackChallengeView/index.jsx @@ -116,7 +116,7 @@ class SubTrackChallengeView extends React.Component { this.state = { // this is current page number. starts with 0. // 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,6 +140,10 @@ class SubTrackChallengeView extends React.Component { userId, } = this.props; + const { + pageNum, + } = this.state; + if (track === 'DEVELOP' || track === 'DESIGN') { if (!loadingSubTrackChallengesUUID) { loadSubtrackChallenges( @@ -159,7 +163,7 @@ class SubTrackChallengeView extends React.Component { } } 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); } } } @@ -209,7 +213,7 @@ class SubTrackChallengeView extends React.Component { } } 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 }); } } @@ -347,7 +351,6 @@ class SubTrackChallengeView extends React.Component { userMarathons, item => ({ ...item, - submissionEndDate: _.get(item, 'rounds.0.systemTestEndAt'), pointTotal: _.get(item, 'rounds.0.userMMDetails.pointTotal'), }), ); @@ -440,10 +443,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, + )); }, }; } From b46b0001494c8b43ec4b66659e7a206a0d0f0799 Mon Sep 17 00:00:00 2001 From: gets0ul Date: Sat, 12 Sep 2020 04:58:09 +0700 Subject: [PATCH 08/32] Fix for #4347 - Open blog page in new, separate tab --- __tests__/shared/components/Header/__snapshots__/index.jsx.snap | 1 + config/default.js | 1 + config/production.js | 1 + 3 files changed, 3 insertions(+) diff --git a/__tests__/shared/components/Header/__snapshots__/index.jsx.snap b/__tests__/shared/components/Header/__snapshots__/index.jsx.snap index 9f0f7a4186..5e384a6d98 100644 --- a/__tests__/shared/components/Header/__snapshots__/index.jsx.snap +++ b/__tests__/shared/components/Header/__snapshots__/index.jsx.snap @@ -118,6 +118,7 @@ exports[`Default render 1`] = ` }, Object { "href": "https://www.topcoder-dev.com/blog", + "openNewTab": true, "title": "Blog", }, Object { diff --git a/config/default.js b/config/default.js index e9c1df07aa..1b87d67929 100644 --- a/config/default.js +++ b/config/default.js @@ -370,6 +370,7 @@ module.exports = { { title: 'Blog', href: 'https://www.topcoder-dev.com/blog', + openNewTab: true, }, { title: 'Thrive', diff --git a/config/production.js b/config/production.js index d62be0f17d..405c90e93b 100644 --- a/config/production.js +++ b/config/production.js @@ -171,6 +171,7 @@ module.exports = { { title: 'Blog', href: 'https://www.topcoder.com/blog', + openNewTab: true, }, { title: 'Thrive', From 4be833ad1987b586c86b91308ede75ce2c102bc5 Mon Sep 17 00:00:00 2001 From: rashmi73 <41687423+rashmi73@users.noreply.github.com> Date: Sat, 12 Sep 2020 03:40:13 +0530 Subject: [PATCH 09/32] Update index.jsx --- src/shared/components/ProfilePage/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/components/ProfilePage/index.jsx b/src/shared/components/ProfilePage/index.jsx index 92195ee203..d810d1c3d3 100644 --- a/src/shared/components/ProfilePage/index.jsx +++ b/src/shared/components/ProfilePage/index.jsx @@ -192,7 +192,7 @@ class ProfilePage extends React.Component { info={info} onShowBadges={() => this.setState({ badgesModalOpen: true })} showBadgesButton={achievements && achievements.length > 0} - wins={_.get(stats, 'wins', 0)} + wins={_.get(stats && stats[0] || {}, 'wins', 0)} /> From a6a68d6e1f7177f45d69076fb986e56ec6093d74 Mon Sep 17 00:00:00 2001 From: rashmi73 <41687423+rashmi73@users.noreply.github.com> Date: Sat, 12 Sep 2020 03:56:49 +0530 Subject: [PATCH 10/32] Update index.jsx --- src/shared/components/ProfilePage/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/components/ProfilePage/index.jsx b/src/shared/components/ProfilePage/index.jsx index d810d1c3d3..74181a61ca 100644 --- a/src/shared/components/ProfilePage/index.jsx +++ b/src/shared/components/ProfilePage/index.jsx @@ -192,7 +192,7 @@ class ProfilePage extends React.Component { info={info} onShowBadges={() => this.setState({ badgesModalOpen: true })} showBadgesButton={achievements && achievements.length > 0} - wins={_.get(stats && stats[0] || {}, 'wins', 0)} + wins={_.get((stats && stats[0]) || {}, 'wins', 0)} /> From ea282e2593a1787334845f1ddd3f4224d0a12b45 Mon Sep 17 00:00:00 2001 From: rashmi73 <41687423+rashmi73@users.noreply.github.com> Date: Sat, 12 Sep 2020 04:29:16 +0530 Subject: [PATCH 11/32] Update index.jsx.snap --- .../shared/components/ProfilePage/__snapshots__/index.jsx.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/shared/components/ProfilePage/__snapshots__/index.jsx.snap b/__tests__/shared/components/ProfilePage/__snapshots__/index.jsx.snap index fb48f813bb..3f8045b9fa 100644 --- a/__tests__/shared/components/ProfilePage/__snapshots__/index.jsx.snap +++ b/__tests__/shared/components/ProfilePage/__snapshots__/index.jsx.snap @@ -58,7 +58,7 @@ exports[`renders a full Profile correctly 1`] = ` } onShowBadges={[Function]} showBadgesButton={true} - wins={3} + wins={0} /> From 7b542d630944f5045865301b021a2ef63ca26912 Mon Sep 17 00:00:00 2001 From: Gaurav Seta Date: Sat, 12 Sep 2020 06:15:01 +0530 Subject: [PATCH 12/32] Update index.jsx --- src/shared/routes/index.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shared/routes/index.jsx b/src/shared/routes/index.jsx index 9c8eb25569..6b6a8440b7 100644 --- a/src/shared/routes/index.jsx +++ b/src/shared/routes/index.jsx @@ -93,6 +93,10 @@ function Routes({ communityId }) { component={() => } path="/community/(competitive-programming|data-science|design|development|qa)/how-to-compete" /> + Date: Sun, 13 Sep 2020 17:03:58 -0300 Subject: [PATCH 13/32] fix: for issue #2069 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ae87ddb95a..1c34045e62 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": "1000.22.3", + "topcoder-react-lib": "1000.22.5", "topcoder-react-ui-kit": "2.0.0", "topcoder-react-utils": "0.7.8", "turndown": "^4.0.2", From 09f4c8b41fd1b88bcbd5bfef8f099f940bae911a Mon Sep 17 00:00:00 2001 From: "Luiz R. Rodrigues" Date: Sun, 13 Sep 2020 17:42:09 -0300 Subject: [PATCH 14/32] Hide RSS feature from front-end --- .../challenge-listing/Sidebar/BucketSelector/index.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 */} + {/* + */} ); } From 5b5bb81933a8cbdb698b031a6f43b56d81d47acb Mon Sep 17 00:00:00 2001 From: Luiz Ricardo Rodrigues Date: Sun, 13 Sep 2020 18:43:10 -0300 Subject: [PATCH 15/32] Deploy milestone-20200917 to Dev and Stag Issues: #2069 #4898 --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6180803b84..b115284c8b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -260,6 +260,7 @@ workflows: filters: branches: only: + - milestone-20200917 - develop # Production builds are exectuted # when PR is merged to the master From 77ea49402f5a9cde80e8b53dafcde4837247dcce Mon Sep 17 00:00:00 2001 From: Luiz Ricardo Rodrigues Date: Sun, 13 Sep 2020 23:59:27 -0300 Subject: [PATCH 16/32] fix: for issue #2069 Issue: #2069 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4a36e009ab..903a2f69fa 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": "1000.22.5", + "topcoder-react-lib": "1000.22.6", "topcoder-react-ui-kit": "2.0.0", "topcoder-react-utils": "0.7.8", "turndown": "^4.0.2", From ff38813a8e5f51fbb31bd9ebf863211bca9a9fd9 Mon Sep 17 00:00:00 2001 From: Luiz Ricardo Rodrigues Date: Mon, 14 Sep 2020 00:36:01 -0300 Subject: [PATCH 17/32] fix: for #4745 Issue: https://github.com/topcoder-platform/community-app/issues/4745 PR: https://github.com/topcoder-platform/topcoder-react-ui-kit/pull/33 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c02656c845..cecb7f752a 100644 --- a/package.json +++ b/package.json @@ -138,7 +138,7 @@ "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-ui-kit": "2.0.0", + "topcoder-react-ui-kit": "1000.1.0", "topcoder-react-utils": "0.7.8", "turndown": "^4.0.2", "url-parse": "^1.4.1", From 3fba9206797344b3e7bd8859c8e0e92f1fd75293 Mon Sep 17 00:00:00 2001 From: "Luiz R. Rodrigues" Date: Mon, 14 Sep 2020 04:37:26 -0300 Subject: [PATCH 18/32] ChallengeTile: Fix MM link to Challenge details page --- .../ChallengeTile/__snapshots__/index.jsx.snap | 11 +++++++---- src/shared/components/ChallengeTile/index.jsx | 18 ++++-------------- 2 files changed, 11 insertions(+), 18 deletions(-) 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/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)} From 227c600fd151d8971b5d46d870ffc91bff33679e Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Mon, 14 Sep 2020 11:22:27 +0300 Subject: [PATCH 19/32] Fixes for #4887 --- .../components/Contentful/Article/Article.jsx | 23 ++++++++++++++++++- src/shared/containers/EDU/Home.jsx | 8 +++++++ src/shared/containers/EDU/Search.jsx | 8 +++++++ src/shared/containers/EDU/Tracks.jsx | 8 +++++++ 4 files changed, 46 insertions(+), 1 deletion(-) diff --git a/src/shared/components/Contentful/Article/Article.jsx b/src/shared/components/Contentful/Article/Article.jsx index 150d213290..c9078713ea 100644 --- a/src/shared/components/Contentful/Article/Article.jsx +++ b/src/shared/components/Contentful/Article/Article.jsx @@ -15,7 +15,10 @@ import LoadingIndicator from 'components/LoadingIndicator'; import YouTubeVideo from 'components/YouTubeVideo'; import moment from 'moment'; import localStorage from 'localStorage'; -import { config, Link, isomorphy } from 'topcoder-react-utils'; +import { Helmet } from 'react-helmet'; +import { + config, Link, isomorphy, +} from 'topcoder-react-utils'; import qs from 'qs'; // SVGs and assets import GestureIcon from 'assets/images/icon-gesture.svg'; @@ -110,9 +113,27 @@ export default class Article extends React.Component { if (isomorphy.isClientSide()) { shareUrl = encodeURIComponent(window.location.href); } + const description = htmlToText.fromString( + ReactDOMServer.renderToString(markdown(fields.content)), + { + ignoreHref: true, + ignoreImage: true, + singleNewLineParagraphs: true, + uppercaseHeadings: false, + }, + ).substring(0, CONTENT_PREVIEW_LENGTH); return ( + + {fields.title} + + + + + + + {/* Banner */} { fields.featuredImage ? ( diff --git a/src/shared/containers/EDU/Home.jsx b/src/shared/containers/EDU/Home.jsx index 275efaab6c..30c8455a26 100644 --- a/src/shared/containers/EDU/Home.jsx +++ b/src/shared/containers/EDU/Home.jsx @@ -3,6 +3,7 @@ */ import React from 'react'; import { config } from 'topcoder-react-utils'; +import { Helmet } from 'react-helmet'; import Viewport from 'components/Contentful/Viewport'; import SearchBar from 'components/Contentful/SearchBar/SearchBar'; import { getService } from 'services/contentful'; @@ -45,6 +46,13 @@ export default class EDUHome extends React.Component { const { taxonomy } = this.state; return (

+ + THRIVE - Grow with us. Tutorials and workshops that matter. + + + + + {/* Banner */}
diff --git a/src/shared/containers/EDU/Search.jsx b/src/shared/containers/EDU/Search.jsx index b49128c77a..6b311aa68e 100644 --- a/src/shared/containers/EDU/Search.jsx +++ b/src/shared/containers/EDU/Search.jsx @@ -13,6 +13,7 @@ import { updateQuery } from 'utils/url'; import qs from 'qs'; import LoadingIndicator from 'components/LoadingIndicator'; import SearchPageFilter from 'components/Contentful/SearchPageFilter/SearchPageFilter'; +import { Helmet } from 'react-helmet'; // Partials import ResultTabs from './partials/ResultTabs'; // CSS @@ -91,6 +92,13 @@ export default class EDUSearch extends React.Component { if (!taxonomy) return ; return (
+ + THRIVE - Search {`${query.title}`} + + + + + {/* Banner */}
diff --git a/src/shared/containers/EDU/Tracks.jsx b/src/shared/containers/EDU/Tracks.jsx index 0a1b4c8398..d98099191e 100644 --- a/src/shared/containers/EDU/Tracks.jsx +++ b/src/shared/containers/EDU/Tracks.jsx @@ -14,6 +14,7 @@ import qs from 'qs'; import TracksTree from 'components/Contentful/TracksTree/TracksTree'; import LoadingIndicator from 'components/LoadingIndicator'; import TracksFilter from 'components/Contentful/TracksFilter/TracksFilter'; +import { Helmet } from 'react-helmet'; // SVGs & Assets import Dev from 'assets/images/img-development.png'; import Design from 'assets/images/img_design.png'; @@ -167,6 +168,13 @@ export default class EDUTracks extends React.Component { if (!taxonomy) return ; return (
+ + THRIVE - {`${query.track}`} + + + + + {/* Banner */}
Date: Mon, 14 Sep 2020 12:22:27 +0300 Subject: [PATCH 20/32] Fixes for #4888 --- .../Contentful/SearchBar/SearchBar.jsx | 47 +++++++++++++++++-- .../Contentful/SearchBar/themes/default.scss | 4 ++ .../containers/EDU/partials/ResultTabs.jsx | 6 +-- 3 files changed, 49 insertions(+), 8 deletions(-) diff --git a/src/shared/components/Contentful/SearchBar/SearchBar.jsx b/src/shared/components/Contentful/SearchBar/SearchBar.jsx index 9444c56777..1ffecbb36d 100644 --- a/src/shared/components/Contentful/SearchBar/SearchBar.jsx +++ b/src/shared/components/Contentful/SearchBar/SearchBar.jsx @@ -56,6 +56,7 @@ export class SearchBarInner extends Component { this.getSuggestionList = this.getSuggestionList.bind(this); this.handleSearchChange = this.handleSearchChange.bind(this); this.handleClickOutside = this.handleClickOutside.bind(this); + this.onKeyDown = this.onKeyDown.bind(this); // using debounce to avoid processing or requesting too much this.updateSuggestionListWithNewSearch = _.debounce( this.updateSuggestionListWithNewSearch.bind(this), 400, @@ -71,6 +72,29 @@ export class SearchBarInner extends Component { document.removeEventListener('mousedown', this.handleClickOutside); } + onKeyDown(e) { + const { inputlVal, selectedFilter } = this.state; + if (inputlVal && e.which === 13) { + const searchQuery = {}; + if (this.searchFieldRef && this.searchFieldRef.value) { + if (selectedFilter.name === 'Tags') { + searchQuery.tags = [this.searchFieldRef.value]; + } + if (selectedFilter.name === 'All') { + searchQuery.phrase = this.searchFieldRef.value; + } + if (selectedFilter.name === 'Title') { + searchQuery.title = this.searchFieldRef.value; + } + } + if (selectedFilter.name !== 'Author') { + window.location.href = `${config.TC_EDU_BASE_PATH}${config.TC_EDU_SEARCH_PATH}?${qs.stringify(searchQuery)}`; + } else { + window.location.href = `${config.TC_EDU_BASE_PATH}${config.TC_EDU_SEARCH_PATH}?author=${inputlVal}`; + } + } + } + /** * Set the search field ref */ @@ -136,6 +160,7 @@ export class SearchBarInner extends Component { isShowSuggestion, suggestionList, selectedFilter, + noResults, } = this.state; const searchQuery = {}; @@ -151,7 +176,8 @@ export class SearchBarInner extends Component { } } - return (suggestionList && !_.isEmpty(suggestionList) && isShowSuggestion && ( + // eslint-disable-next-line no-nested-ternary + return suggestionList && !_.isEmpty(suggestionList) && isShowSuggestion ? (
- )); + ) : noResults ? ( +
+ No Results +
+ ) : null; } handleClickOutside(e) { @@ -379,7 +412,10 @@ export class SearchBarInner extends Component { .then((results) => { // Nothing found? if (!results.total) { - this.setState({ suggestionList: {} }); + this.setState({ + suggestionList: {}, + noResults: true, + }); return; } // Author query? @@ -387,7 +423,7 @@ export class SearchBarInner extends Component { const suggestionList = { Author: _.map(results.items, item => ({ ...item.fields })), }; - this.setState({ suggestionList }); + this.setState({ suggestionList, noResults: false }); return; } // ALL && Tags @@ -395,7 +431,7 @@ export class SearchBarInner extends Component { this.setState({ suggestionList }); }); } else { - this.setState({ suggestionList: {} }); + this.setState({ suggestionList: {}, noResults: false }); } } @@ -471,6 +507,7 @@ export class SearchBarInner extends Component { document.addEventListener('mousedown', this.handleClickOutside); }} onChange={this.handleSearchChange} + onKeyDown={this.onKeyDown} />
- ) : (

Nothing Found

) + ) : (

No results found

) } { videos.total > videos.items.length ? ( @@ -225,7 +225,7 @@ export default class ResultTabs extends React.Component { /> ); }) - ) : (

Nothing Found

) + ) : (

No results found

) } { posts.total > posts.items.length ? ( From 8a807045a7329019cb21c8654836d14a423e856f Mon Sep 17 00:00:00 2001 From: "Luiz R. Rodrigues" Date: Mon, 14 Sep 2020 06:28:13 -0300 Subject: [PATCH 21/32] Profile Stats Challenges : Fix loading icon --- .../Stats/SubTrackChallengeView/index.jsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/shared/components/ProfilePage/Stats/SubTrackChallengeView/index.jsx b/src/shared/components/ProfilePage/Stats/SubTrackChallengeView/index.jsx index 961606ce5f..332374de38 100644 --- a/src/shared/components/ProfilePage/Stats/SubTrackChallengeView/index.jsx +++ b/src/shared/components/ProfilePage/Stats/SubTrackChallengeView/index.jsx @@ -111,10 +111,8 @@ 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: 1, // which challenge's modal should be poped. null means no modal @@ -150,7 +148,7 @@ class SubTrackChallengeView extends React.Component { handle, auth.tokenV3, track, subTrack, - 0, + pageNum, CHALLENGE_PER_PAGE, true, userId, @@ -159,7 +157,8 @@ 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) { @@ -208,7 +207,7 @@ 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') { @@ -249,7 +248,7 @@ class SubTrackChallengeView extends React.Component { userId, } = this.props; - if (pageNum === 0 + if (pageNum === 1 && (loadingSubTrackChallengesUUID || loadingSRMUUID || loadingMarathonUUID)) { return ; } From b83393204453ae36ee377bfbb45acaae49ebe7d6 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Mon, 14 Sep 2020 12:30:54 +0300 Subject: [PATCH 22/32] Fix #4896 --- src/shared/components/Contentful/SearchBar/SearchBar.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shared/components/Contentful/SearchBar/SearchBar.jsx b/src/shared/components/Contentful/SearchBar/SearchBar.jsx index 1ffecbb36d..d23301d0ed 100644 --- a/src/shared/components/Contentful/SearchBar/SearchBar.jsx +++ b/src/shared/components/Contentful/SearchBar/SearchBar.jsx @@ -455,6 +455,7 @@ export class SearchBarInner extends Component { contentAuthor: contentAuthor.fields, externalArticle: fields.externalArticle, contentUrl: fields.contentUrl, + slug: fields.slug, }; }), 'type', From 22a2677df057d6c4e48b735dd78ecf4389238e49 Mon Sep 17 00:00:00 2001 From: Luiz Ricardo Rodrigues Date: Mon, 14 Sep 2020 07:03:22 -0300 Subject: [PATCH 23/32] Deploy milestone-20200924 to Dev and Stag Issues: #4347 #4745 #4895 #4687 --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 00fe48889e..aa518f77e1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -230,6 +230,7 @@ workflows: filters: branches: only: + - milestone-20200924 - develop # This is alternate dev env for parallel testing - "build-test": @@ -260,8 +261,7 @@ workflows: filters: branches: only: - - milestone-v1.3 - - milestone-20200910 + - milestone-20200924 - develop # Production builds are exectuted # when PR is merged to the master From 21576ee445530c23067433f5a3f734354028594e Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Mon, 14 Sep 2020 14:21:07 +0300 Subject: [PATCH 24/32] Fix #4889 --- src/shared/services/contentful.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/services/contentful.js b/src/shared/services/contentful.js index 4508f76d6d..60fc4a5a50 100644 --- a/src/shared/services/contentful.js +++ b/src/shared/services/contentful.js @@ -346,8 +346,8 @@ class Service { query.query = tags.join(' '); } } - if (startDate) query['sys.createdAt[gte]'] = startDate; - if (endDate) query['sys.createdAt[lte]'] = endDate; + if (startDate) query['fields.creationDate[gte]'] = startDate; + if (endDate) query['fields.creationDate[lte]'] = endDate; if (phrase) query.query = phrase; if (title) query['fields.title[match]'] = title; const content = {}; From 08fb3c3c6f6192fb971269bb071aeef52e991b99 Mon Sep 17 00:00:00 2001 From: "Luiz R. Rodrigues" Date: Mon, 14 Sep 2020 08:42:49 -0300 Subject: [PATCH 25/32] Added validation before call phaseEndDate and phaseStartDate --- .../challenge-listing/Tooltips/ProgressBarTooltip/index.jsx | 6 +++--- src/shared/utils/challenge-listing/sort.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shared/components/challenge-listing/Tooltips/ProgressBarTooltip/index.jsx b/src/shared/components/challenge-listing/Tooltips/ProgressBarTooltip/index.jsx index 432afcde8b..5d7af55ffe 100644 --- a/src/shared/components/challenge-listing/Tooltips/ProgressBarTooltip/index.jsx +++ b/src/shared/components/challenge-listing/Tooltips/ProgressBarTooltip/index.jsx @@ -97,9 +97,9 @@ function Tip(props) { const allPhases = c.phases || []; const endPhaseDate = Math.max(...allPhases.map(d => phaseEndDate(d))); - const registrationPhase = allPhases.find(phase => phase.name === 'Registration'); - const submissionPhase = allPhases.find(phase => phase.name === 'Submission'); - const checkpointPhase = allPhases.find(phase => phase.name === 'Checkpoint Submission'); + const registrationPhase = allPhases.find(phase => phase.name === 'Registration') || {}; + const submissionPhase = allPhases.find(phase => phase.name === 'Submission') || {}; + const checkpointPhase = allPhases.find(phase => phase.name === 'Checkpoint Submission') || {}; if (registrationPhase) { steps.push({ diff --git a/src/shared/utils/challenge-listing/sort.js b/src/shared/utils/challenge-listing/sort.js index 65e6803f0a..0f8d77a159 100644 --- a/src/shared/utils/challenge-listing/sort.js +++ b/src/shared/utils/challenge-listing/sort.js @@ -56,8 +56,8 @@ export default { const getChallengeStartDate = (challenge) => { // extract the phases from `challenge.phases`, // as `challenge.registrationStartDate` returned from API is not reliable - const registrationPhase = find(challenge.phases, p => p.name === 'Registration'); - const submissionPhase = find(challenge.phases, p => p.name === 'Submission'); + const registrationPhase = find(challenge.phases, p => p.name === 'Registration') || {}; + const submissionPhase = find(challenge.phases, p => p.name === 'Submission') || {}; // registration phase exists if (registrationPhase) { return moment(phaseStartDate(registrationPhase)); From 2ffaeec8ff6c568e162fd89c0e76c157db50591c Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Mon, 14 Sep 2020 15:05:06 +0300 Subject: [PATCH 26/32] ci: on staging --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6180803b84..cd03e3288f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -260,7 +260,7 @@ workflows: filters: branches: only: - - develop + - feature-contentful # Production builds are exectuted # when PR is merged to the master # Don't change anything in this configuration From ed0044a40fa2af3c104e243bf76828221e73ab3b Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Mon, 14 Sep 2020 23:03:34 +0300 Subject: [PATCH 27/32] Implements #4912 --- __tests__/shared/__snapshots__/index.jsx.snap | 8 ++++++++ config/default.js | 1 + src/shared/app.jsx | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/__tests__/shared/__snapshots__/index.jsx.snap b/__tests__/shared/__snapshots__/index.jsx.snap index 2f1255577e..be74448c8d 100644 --- a/__tests__/shared/__snapshots__/index.jsx.snap +++ b/__tests__/shared/__snapshots__/index.jsx.snap @@ -19,6 +19,10 @@ exports[`Snapshot match 1`] = ` href="/challenges/manifest.json" rel="manifest" /> +