From 2578f6faaef5839556600acd8cade80920e1c72a Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Fri, 5 Mar 2021 11:11:42 +0200 Subject: [PATCH 1/7] fix #5422 --- src/shared/components/Gigs/LoginModal/index.jsx | 2 +- src/shared/components/Gigs/ReferralModal/index.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/components/Gigs/LoginModal/index.jsx b/src/shared/components/Gigs/LoginModal/index.jsx index 978cc6bdea..cab74421dd 100644 --- a/src/shared/components/Gigs/LoginModal/index.jsx +++ b/src/shared/components/Gigs/LoginModal/index.jsx @@ -40,7 +40,7 @@ function LoginModal({ retUrl, onCancel }) { LOGIN -

Not a member? Register here.

+

Not a member? It is free to register!

); diff --git a/src/shared/components/Gigs/ReferralModal/index.jsx b/src/shared/components/Gigs/ReferralModal/index.jsx index 912ac39602..02a39e7c39 100644 --- a/src/shared/components/Gigs/ReferralModal/index.jsx +++ b/src/shared/components/Gigs/ReferralModal/index.jsx @@ -105,7 +105,7 @@ function ReferralModal({ LOGIN -

Not a member? Register here.

+

Not a member? It is free to register!

)} From 76aba7edf77f43e806c12b0b4ab27415e3ded104 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Fri, 5 Mar 2021 11:52:35 +0200 Subject: [PATCH 2/7] fix #5413 --- .../tco/Leaderboard/ChallengeHistoryModal/index.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shared/containers/tco/Leaderboard/ChallengeHistoryModal/index.jsx b/src/shared/containers/tco/Leaderboard/ChallengeHistoryModal/index.jsx index 0680acbe4f..165c8c4a7a 100644 --- a/src/shared/containers/tco/Leaderboard/ChallengeHistoryModal/index.jsx +++ b/src/shared/containers/tco/Leaderboard/ChallengeHistoryModal/index.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useEffect } from 'react'; import ChallengeHistoryModal from 'components/Leaderboard/ChallengeHistoryModal'; import PT from 'prop-types'; import actions from 'actions/leaderboard'; @@ -14,9 +14,9 @@ function ChallengeHistoryModalContainer({ isCopilot, isAlgo, }) { - if (!challenges && !loading) { + useEffect(() => { getChallengesHistory(dataUrl, competitor); - } + }, [competitor]); return ( Date: Fri, 5 Mar 2021 12:08:14 +0200 Subject: [PATCH 3/7] ci: on qa --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 15009f5042..b6243f518d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -290,7 +290,7 @@ workflows: filters: branches: only: - - free + - tco-leaderboard-fix # This is beta env for production soft releases - "build-prod-beta": context : org-global From d1235a37061bffd5cb2551d06fa590478ea8ca6e Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Mon, 8 Mar 2021 16:39:45 +0200 Subject: [PATCH 4/7] Add &mode=signUp to reg link --- src/shared/components/Gigs/GigApply/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/components/Gigs/GigApply/index.jsx b/src/shared/components/Gigs/GigApply/index.jsx index 614f96fb97..5fe0ffb14e 100644 --- a/src/shared/components/Gigs/GigApply/index.jsx +++ b/src/shared/components/Gigs/GigApply/index.jsx @@ -289,7 +289,7 @@ export default function GigApply(props) {
Login
-

Not a member? Register here.

+

Not a member? Register here.

From c68f815bba5029e48cbbc3c09ee5b9afc5e841b2 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Wed, 10 Mar 2021 11:04:47 +0200 Subject: [PATCH 5/7] Gig call tweaks and utm codes --- src/shared/actions/recruitCRM.js | 3 ++- src/shared/components/Gigs/GigApply/index.jsx | 3 ++- src/shared/components/Gigs/GigDetails/index.jsx | 2 +- src/shared/components/Gigs/LoginModal/index.jsx | 2 +- src/shared/components/Gigs/ReferralModal/index.jsx | 2 +- src/shared/utils/gigs.js | 2 ++ 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/shared/actions/recruitCRM.js b/src/shared/actions/recruitCRM.js index 0cd9290b51..1b9b127f25 100644 --- a/src/shared/actions/recruitCRM.js +++ b/src/shared/actions/recruitCRM.js @@ -1,6 +1,7 @@ import { redux } from 'topcoder-react-utils'; import Service from 'services/recruitCRM'; import _ from 'lodash'; +import { getCustomField } from 'utils/gigs'; /** * Jobs page fetch init @@ -60,7 +61,7 @@ function normalizeRecruitPayload(job, payload) { `Date Available: ${new Date(payload.availFrom).toDateString()}`, `Heard About Gig: ${payload.reffereal}`, `Why fit: ${payload.whyFit}`, - `Able to work during timezone? ${payload.timezoneConfirm.filter(s => s.value).map(s => s.label).join(',')}`, + `Able to work during timezone? ${payload.timezoneConfirm.filter(s => s.value).map(() => getCustomField(job.custom_fields, 'Timezone')).join(',')}`, `Am I ok to work the duration? ${payload.durationConfirm.filter(s => s.value).map(s => s.label).join(',')}`, `Notes: ${payload.notes}`, ]; diff --git a/src/shared/components/Gigs/GigApply/index.jsx b/src/shared/components/Gigs/GigApply/index.jsx index 5fe0ffb14e..9d3cc63dfa 100644 --- a/src/shared/components/Gigs/GigApply/index.jsx +++ b/src/shared/components/Gigs/GigApply/index.jsx @@ -121,6 +121,7 @@ export default function GigApply(props) { errorMsg={formErrors.email} value={formData.email} required + readonly /> Login -

Not a member? Register here.

+

Not a member? Register here.

diff --git a/src/shared/components/Gigs/GigDetails/index.jsx b/src/shared/components/Gigs/GigDetails/index.jsx index 1eca1ab48d..c6faae5040 100644 --- a/src/shared/components/Gigs/GigDetails/index.jsx +++ b/src/shared/components/Gigs/GigDetails/index.jsx @@ -108,7 +108,7 @@ export default function GigDetails(props) {
- Timezone + Working Hours {getCustomField(job.custom_fields, 'Timezone')}
diff --git a/src/shared/components/Gigs/LoginModal/index.jsx b/src/shared/components/Gigs/LoginModal/index.jsx index cab74421dd..7bc255789b 100644 --- a/src/shared/components/Gigs/LoginModal/index.jsx +++ b/src/shared/components/Gigs/LoginModal/index.jsx @@ -40,7 +40,7 @@ function LoginModal({ retUrl, onCancel }) { LOGIN -

Not a member? It is free to register!

+

Not a member? It is free to register!

); diff --git a/src/shared/components/Gigs/ReferralModal/index.jsx b/src/shared/components/Gigs/ReferralModal/index.jsx index 02a39e7c39..25820d8c44 100644 --- a/src/shared/components/Gigs/ReferralModal/index.jsx +++ b/src/shared/components/Gigs/ReferralModal/index.jsx @@ -105,7 +105,7 @@ function ReferralModal({ LOGIN -

Not a member? It is free to register!

+

Not a member? It is free to register!

)} diff --git a/src/shared/utils/gigs.js b/src/shared/utils/gigs.js index fa08f36579..3c9ba53a8c 100644 --- a/src/shared/utils/gigs.js +++ b/src/shared/utils/gigs.js @@ -10,8 +10,10 @@ import _ from 'lodash'; */ export function getSalaryType(data) { switch (data.id) { + case 1: return 'monthly'; case 2: return 'annual'; case 3: return 'week'; + case 4: return 'daily'; case 5: return 'hourly'; default: return 'n/a'; } From aaaf59651e464828dcd7bf6b7a928e4859e5d1f2 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Thu, 11 Mar 2021 11:29:17 +0200 Subject: [PATCH 6/7] implement #5424 --- src/shared/components/Contentful/Route.jsx | 31 ++++++++++++++++++++-- src/shared/routes/index.jsx | 1 + 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/shared/components/Contentful/Route.jsx b/src/shared/components/Contentful/Route.jsx index 8085e1ccc0..8af288d58f 100644 --- a/src/shared/components/Contentful/Route.jsx +++ b/src/shared/components/Contentful/Route.jsx @@ -10,9 +10,10 @@ import LoadingIndicator from 'components/LoadingIndicator'; import MetaTags from 'components/MetaTags'; import PT from 'prop-types'; import React from 'react'; -import { Route, Switch } from 'react-router-dom'; +import { Route, Switch, Redirect } from 'react-router-dom'; import Viewport from 'components/Contentful/Viewport'; import PasswordScreen from 'components/Contentful/PasswordScreen'; +import { isomorphy } from 'topcoder-react-utils'; // Concatenates a base and segment and handles optional trailing slashes const buildUrl = (base, segment) => `${_.trimEnd(base, '/')}/${_.trim(segment, '/')}`; @@ -117,6 +118,29 @@ ChildRoutesLoader.propTypes = { url: PT.string.isRequired, }; +function RedirectWithStatus({ from, to, status }) { + return ( + { + if (to[0] !== '/' && isomorphy.isClientSide()) { + window.location.href = to; + return null; + } + // there is no `staticContext` on the client, so + // we need to guard against that here + if (staticContext) staticContext.status = status; + return ; + }} + /> + ); +} + +RedirectWithStatus.propTypes = { + from: PT.string.isRequired, + to: PT.string.isRequired, + status: PT.number.isRequired, +}; + export default function ContentfulRoute(props) { const { baseUrl, @@ -145,7 +169,10 @@ export default function ContentfulRoute(props) { render={(data) => { const { fields } = Object.values(data.entries.items)[0]; const url = path || buildUrl(baseUrl, fields.url); - return ( + const redirectToUrl = _.trim(fields.redirectToUrl); + return redirectToUrl ? ( + + ) : ( From e92c162a91de67c0dd5e9f0f0e3d3aa0be8bcd30 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Thu, 11 Mar 2021 11:33:17 +0200 Subject: [PATCH 7/7] ci: on test --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4fe405c05b..06298a767c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -283,7 +283,7 @@ workflows: filters: branches: only: - - gigwork-updates + - route-redirects # This is alternate dev env for parallel testing - "build-qa": context : org-global