From b46b0001494c8b43ec4b66659e7a206a0d0f0799 Mon Sep 17 00:00:00 2001 From: gets0ul Date: Sat, 12 Sep 2020 04:58:09 +0700 Subject: [PATCH 1/9] 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 2/9] 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 3/9] 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 4/9] 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 5/9] 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: Mon, 14 Sep 2020 00:36:01 -0300 Subject: [PATCH 6/9] 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 22a2677df057d6c4e48b735dd78ecf4389238e49 Mon Sep 17 00:00:00 2001 From: Luiz Ricardo Rodrigues Date: Mon, 14 Sep 2020 07:03:22 -0300 Subject: [PATCH 7/9] 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 08fb3c3c6f6192fb971269bb071aeef52e991b99 Mon Sep 17 00:00:00 2001 From: "Luiz R. Rodrigues" Date: Mon, 14 Sep 2020 08:42:49 -0300 Subject: [PATCH 8/9] 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 8e8d0717b83c095d2c927d9a53509e7d644ace0f Mon Sep 17 00:00:00 2001 From: "Luiz R. Rodrigues" Date: Mon, 14 Sep 2020 17:33:19 -0300 Subject: [PATCH 9/9] Added !isEmpty check before call phaseStartDate and phaseEndDate --- .../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 5d7af55ffe..65aac9c5f9 100644 --- a/src/shared/components/challenge-listing/Tooltips/ProgressBarTooltip/index.jsx +++ b/src/shared/components/challenge-listing/Tooltips/ProgressBarTooltip/index.jsx @@ -101,13 +101,13 @@ function Tip(props) { const submissionPhase = allPhases.find(phase => phase.name === 'Submission') || {}; const checkpointPhase = allPhases.find(phase => phase.name === 'Checkpoint Submission') || {}; - if (registrationPhase) { + if (!_.isEmpty(registrationPhase)) { steps.push({ date: phaseStartDate(registrationPhase), name: 'Start', }); } - if (checkpointPhase) { + if (!_.isEmpty(checkpointPhase)) { steps.push({ date: phaseEndDate(checkpointPhase), name: 'Checkpoint', @@ -119,7 +119,7 @@ function Tip(props) { date: phaseEndDate(iterativeReviewPhase), name: 'Iterative Review', }); - } else if (submissionPhase) { + } else if (!_.isEmpty(submissionPhase)) { steps.push({ date: phaseEndDate(submissionPhase), name: 'Submission', diff --git a/src/shared/utils/challenge-listing/sort.js b/src/shared/utils/challenge-listing/sort.js index 0f8d77a159..80b6d695d9 100644 --- a/src/shared/utils/challenge-listing/sort.js +++ b/src/shared/utils/challenge-listing/sort.js @@ -3,7 +3,7 @@ */ import moment from 'moment'; -import { find, sumBy } from 'lodash'; +import { find, sumBy, isEmpty } from 'lodash'; import { phaseStartDate, phaseEndDate } from './helper'; export const SORTS = { @@ -59,7 +59,7 @@ export default { const registrationPhase = find(challenge.phases, p => p.name === 'Registration') || {}; const submissionPhase = find(challenge.phases, p => p.name === 'Submission') || {}; // registration phase exists - if (registrationPhase) { + if (!isEmpty(registrationPhase)) { return moment(phaseStartDate(registrationPhase)); } // registration phase doesnt exist, This is possibly a F2F or TSK. Take submission phase