From 7cc6663d5c04ec1186d0c9486f37b67da47e1f07 Mon Sep 17 00:00:00 2001 From: Michael Baghel <31278895+mbaghel@users.noreply.github.com> Date: Tue, 14 Sep 2021 22:28:39 -0400 Subject: [PATCH 01/11] feat: Ordering of Skills in Skill Select list. Issue #498 --- local/login-locally/package-lock.json | 5 +++ package-lock.json | 6 ++-- .../CreateNewTeam/hooks/useLoadSkills.js | 36 +++++++++++++++++++ .../CreateNewTeam/pages/InputSkills/index.jsx | 5 ++- 4 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 local/login-locally/package-lock.json create mode 100644 src/routes/CreateNewTeam/hooks/useLoadSkills.js diff --git a/local/login-locally/package-lock.json b/local/login-locally/package-lock.json new file mode 100644 index 00000000..35fdb913 --- /dev/null +++ b/local/login-locally/package-lock.json @@ -0,0 +1,5 @@ +{ + "name": "login-locally", + "version": "1.0.0", + "lockfileVersion": 1 +} diff --git a/package-lock.json b/package-lock.json index d0d5c0df..4239388b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4819,9 +4819,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001146", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001146.tgz", - "integrity": "sha512-VAy5RHDfTJhpxnDdp2n40GPPLp3KqNrXz1QqFv4J64HvArKs8nuNMOWkB3ICOaBTU/Aj4rYAo/ytdQDDFF/Pug==", + "version": "1.0.30001257", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001257.tgz", + "integrity": "sha512-JN49KplOgHSXpIsVSF+LUyhD8PUp6xPpAXeRrrcBh4KBeP7W864jHn6RvzJgDlrReyeVjMFJL3PLpPvKIxlIHA==", "dev": true }, "capture-exit": { diff --git a/src/routes/CreateNewTeam/hooks/useLoadSkills.js b/src/routes/CreateNewTeam/hooks/useLoadSkills.js new file mode 100644 index 00000000..86b0f695 --- /dev/null +++ b/src/routes/CreateNewTeam/hooks/useLoadSkills.js @@ -0,0 +1,36 @@ +/** + * useLoadSkills hook + */ +import { useEffect, useState } from "react"; +import { flatten, partition } from "lodash"; +import { useData } from "hooks/useData"; +import { getSkills } from "services/skills"; +import { getRoles } from "services/roles"; + +/** + * Hook which loads all skills and roles, then partitions skills based + * on whether any role requires the given skill. + * + * @returns [skills, error] tuple with `skills` array and `error` object + */ +export const useLoadSkills = () => { + const [skills, skillsError] = useData(getSkills); + const [roles, rolesError] = useData(getRoles); + const [partedSkills, setPartedSkills] = useState(); + + useEffect(() => { + if (skills && roles) { + const requiredSkills = new Set(); + roles.forEach((role) => { + role.listOfSkills.forEach((skill) => { + requiredSkills.add(skill); + }); + }); + setPartedSkills(() => + flatten(partition(skills, (skill) => requiredSkills.has(skill.name))) + ); + } + }, [skills, roles]); + + return [partedSkills, skillsError || rolesError]; +}; diff --git a/src/routes/CreateNewTeam/pages/InputSkills/index.jsx b/src/routes/CreateNewTeam/pages/InputSkills/index.jsx index 516c057b..83ac07a9 100644 --- a/src/routes/CreateNewTeam/pages/InputSkills/index.jsx +++ b/src/routes/CreateNewTeam/pages/InputSkills/index.jsx @@ -7,13 +7,12 @@ */ import React, { useCallback, useState } from "react"; import { useDispatch } from "react-redux"; -import { useData } from "hooks/useData"; import { setIsLoading } from "../../actions"; import SkillsList from "./components/SkillsList"; -import { getSkills } from "services/skills"; import LoadingIndicator from "components/LoadingIndicator"; import SkillListPopup from "../../components/SkillListPopup"; import SearchAndSubmit from "../../components/SearchAndSubmit"; +import { useLoadSkills } from "../../hooks/useLoadSkills"; function InputSkills() { const dispatch = useDispatch(); @@ -26,7 +25,7 @@ function InputSkills() { const [popupSelectedSkills, setPopupSelectedSkills] = useState([]); const [popupOpen, setPopupOpen] = useState(false); const [isPopupLoading, setIsPopupLoading] = useState(false); - const [skills, loadingError] = useData(getSkills); + const [skills, loadingError] = useLoadSkills(); const toggleSkill = useCallback( (skill) => { From 4a27e8cd2e1482cedb6dc3d2c8afa6eca8e2db73 Mon Sep 17 00:00:00 2001 From: yoution Date: Wed, 15 Sep 2021 22:47:58 +0800 Subject: [PATCH 02/11] fix: taas-intake #504,#408,#497 --- src/assets/images/icon-earth-x.svg | 13 ------ src/assets/images/icon-person.svg | 11 +++++ src/constants/index.js | 2 +- .../NoMatchingProfilesResultCard/index.jsx | 40 +++++------------ .../styles.module.scss | 43 +------------------ .../components/ResultCard/index.jsx | 4 +- .../components/SearchContainer/index.jsx | 2 +- .../components/SubmitContainer/index.jsx | 2 +- .../pages/CreateTaasPayment/index.jsx | 11 +++-- 9 files changed, 34 insertions(+), 94 deletions(-) delete mode 100644 src/assets/images/icon-earth-x.svg create mode 100644 src/assets/images/icon-person.svg diff --git a/src/assets/images/icon-earth-x.svg b/src/assets/images/icon-earth-x.svg deleted file mode 100644 index 40037611..00000000 --- a/src/assets/images/icon-earth-x.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - F087A2AF-1A0A-4B0C-9EFD-323859E6F7A9 - - - - - - - - - - \ No newline at end of file diff --git a/src/assets/images/icon-person.svg b/src/assets/images/icon-person.svg new file mode 100644 index 00000000..9f3fa5a5 --- /dev/null +++ b/src/assets/images/icon-person.svg @@ -0,0 +1,11 @@ + + + 6689786D-49B2-4268-925B-3437502831F5 + + + + + + + + \ No newline at end of file diff --git a/src/constants/index.js b/src/constants/index.js index ab58e3cf..721448e9 100644 --- a/src/constants/index.js +++ b/src/constants/index.js @@ -391,7 +391,7 @@ export const MAX_ALLOWED_INTERVIEWS = 3; /** * Custom role names to remove from RoleList component */ -export const CUSTOM_ROLE_NAMES = ["custom", "niche"]; +export const CUSTOM_ROLE_NAMES = ["custom", "niche", "custom role"]; /** * Minimal Resource Booking duration (weeks) diff --git a/src/routes/CreateNewTeam/components/NoMatchingProfilesResultCard/index.jsx b/src/routes/CreateNewTeam/components/NoMatchingProfilesResultCard/index.jsx index 7a834283..a323c9e0 100644 --- a/src/routes/CreateNewTeam/components/NoMatchingProfilesResultCard/index.jsx +++ b/src/routes/CreateNewTeam/components/NoMatchingProfilesResultCard/index.jsx @@ -8,12 +8,12 @@ import PT from "prop-types"; import { useDispatch, useSelector } from "react-redux"; import { addSearchedRole } from "../../actions"; import "./styles.module.scss"; -import IconEarthX from "../../../../assets/images/icon-earth-x.svg"; +import IconPerson from "../../../../assets/images/icon-person.svg"; import Curve from "../../../../assets/images/curve.svg"; import Button from "components/Button"; import { formatMoney } from "utils/format"; -function NoMatchingProfilesResultCard({ role }) { +function NoMatchingProfilesResultCard({ role, onSubmit }) { const { addedRoles } = useSelector((state) => state.searchedRoles); const alreadyAdded = useMemo(() => { @@ -43,54 +43,35 @@ function NoMatchingProfilesResultCard({ role }) { imageUrl: role.imageUrl, }) ); + onSubmit() }, [dispatch, role]); return (
- -

Dang. No matching talent (yet)

+ +

locating available custom talent

-

- {role.jobTitle && role.jobTitle.length - ? role.jobTitle - : "What happens next"} + What happens next

- We did not find a perfect match to your requirements, but we'd like to - dig a little deeper into our community. We’ll start right away, and - this may take up to two weeks. You can modify your criteria, or - continue this search. If you choose to continue, we will reach out - soon with next steps. + We routinely place great people with the skills you’ve asked for. Right now, we don’t have anyone available. However, our database is dynamic and updated often. Please continue below so we can finalize your talent request and alert you when a great candidate becomes available.

- {role.rates && role.name ? ( -
-

Estimate for this role

-

{formatMoney(role.rates[0].global)}

-

/Week

-
- ) : ( -
-

Estimate for this role

-

$1,200

-

/Week

-
- )}
@@ -100,6 +81,7 @@ function NoMatchingProfilesResultCard({ role }) { NoMatchingProfilesResultCard.propTypes = { role: PT.object, + onSubmit: PT.func, }; export default NoMatchingProfilesResultCard; diff --git a/src/routes/CreateNewTeam/components/NoMatchingProfilesResultCard/styles.module.scss b/src/routes/CreateNewTeam/components/NoMatchingProfilesResultCard/styles.module.scss index 8c4765b7..008b04f7 100644 --- a/src/routes/CreateNewTeam/components/NoMatchingProfilesResultCard/styles.module.scss +++ b/src/routes/CreateNewTeam/components/NoMatchingProfilesResultCard/styles.module.scss @@ -15,7 +15,7 @@ padding: 30px 0 60px 0; margin-bottom: 14px; color: #fff; - background-image: linear-gradient(225deg, #555555 0%, #2a2a2a 100%); + background-image: linear-gradient(90deg, #F45500 0%, #FF940F 100%); position: relative; text-align: center; border-radius: 8px 8px 0 0; @@ -59,38 +59,6 @@ width: 80%; text-align: center; } - .niche-rate-box { - margin-top: 32px; - background-color: #fbfbfb; - padding: 30px; - border: 1px solid #f4f4f4; - border-radius: 6px; - width: 196px; - p:first-child { - @include font-barlow; - margin-top: 4px; - font-size: 16px; - line-height: 20px; - font-weight: 600; - text-align: center; - text-transform: uppercase; - } - p:last-child { - @include font-roboto; - color: #555555; - font-size: 14px; - line-height: 22px; - text-align: center; - } - .cost { - @include font-barlow-condensed; - margin-top: 8px; - font-size: 48px; - line-height: 50px; - font-weight: 500; - text-align: center; - } - } .button-group { margin-top: 62px; @@ -110,12 +78,3 @@ bottom: -70px; width: 100%; } - -.transparent-icon { - position: absolute; - top: -40px; - right: 10px; - opacity: 12%; - height: 142px; - width: 142px; -} diff --git a/src/routes/CreateNewTeam/components/ResultCard/index.jsx b/src/routes/CreateNewTeam/components/ResultCard/index.jsx index 50ebef44..8957bd6d 100644 --- a/src/routes/CreateNewTeam/components/ResultCard/index.jsx +++ b/src/routes/CreateNewTeam/components/ResultCard/index.jsx @@ -245,10 +245,8 @@ function ResultCard({
-
-

Interviews can start within

-
{timeToInterview}h
+ (NEED TO DEVELOP TEXT W/ ANNIKA)
diff --git a/src/routes/CreateNewTeam/components/SearchContainer/index.jsx b/src/routes/CreateNewTeam/components/SearchContainer/index.jsx index 291de894..bd481eb3 100644 --- a/src/routes/CreateNewTeam/components/SearchContainer/index.jsx +++ b/src/routes/CreateNewTeam/components/SearchContainer/index.jsx @@ -77,7 +77,7 @@ function SearchContainer({ currentRole={currentRole} /> ); - return ; + return ; }; const progressBarPercentage = useMemo( diff --git a/src/routes/CreateNewTeam/components/SubmitContainer/index.jsx b/src/routes/CreateNewTeam/components/SubmitContainer/index.jsx index 934275b6..3c18064e 100644 --- a/src/routes/CreateNewTeam/components/SubmitContainer/index.jsx +++ b/src/routes/CreateNewTeam/components/SubmitContainer/index.jsx @@ -176,7 +176,7 @@ function SubmitContainer({ currentRole={currentRole} /> ) : ( - + setAddAnotherOpen(true)}/> )}
diff --git a/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx b/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx index bca64103..b3c1c63e 100644 --- a/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx +++ b/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx @@ -5,6 +5,7 @@ import { Elements } from "@stripe/react-stripe-js"; import { loadStripe } from "@stripe/stripe-js"; import { ThemeProvider } from "@material-ui/styles"; import { toastr } from "react-redux-toastr"; +import { isCustomRole } from "utils/helpers"; import PaymentForm from "./PaymentForm"; import PageHeader from "components/PageHeader"; @@ -58,7 +59,9 @@ const CreateTassPayment = () => { durationWeeks, availability, }); - amount.push({ rate, numberOfResources }); + if (!isCustomRole(role)) { + amount.push({ rate, numberOfResources }); + } }); setValue(temp); @@ -109,15 +112,15 @@ const CreateTassPayment = () => {

{data.name}

    -
  • + {!isCustomRole(data) &&
  • {data.numberOfResources} x ${data.rate}/ Week -
  • + }
  • {data.durationWeeks} Week Duration
  • {data.availability}

- ${data.numberOfResources * data.rate} + ${isCustomRole(data) ? '0' : data.numberOfResources * data.rate}


From 7ba14278c5a6a155d74105d56c6ce4781758c86a Mon Sep 17 00:00:00 2001 From: Michael Baghel <31278895+mbaghel@users.noreply.github.com> Date: Wed, 15 Sep 2021 12:01:40 -0400 Subject: [PATCH 03/11] feat: Add Trusted By on checkout page. Issue #479 --- src/assets/images/trusted-logos.svg | 3 +++ .../pages/CreateTaasPayment/index.jsx | 19 +++++++++++++------ .../CreateTaasPayment/styles.module.scss | 17 +++++++++++++++++ 3 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 src/assets/images/trusted-logos.svg diff --git a/src/assets/images/trusted-logos.svg b/src/assets/images/trusted-logos.svg new file mode 100644 index 00000000..7fd53faa --- /dev/null +++ b/src/assets/images/trusted-logos.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx b/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx index bca64103..c0c24932 100644 --- a/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx +++ b/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx @@ -12,6 +12,7 @@ import { calculateAmount } from "services/teams"; import Progress from "../../components/Progress"; import theme from "./theme"; import FallbackIcon from "../../../../assets/images/icon-role-fallback.svg"; +import TrustedLogos from "../../../../assets/images/trusted-logos.svg"; import "./styles.module.scss"; const stripePromise = loadStripe(process.env.STRIPE_PUBLIC_KEY); @@ -160,12 +161,18 @@ const CreateTassPayment = () => { - +
+ +
+
Trusted By
+ +
+
); }; diff --git a/src/routes/CreateNewTeam/pages/CreateTaasPayment/styles.module.scss b/src/routes/CreateNewTeam/pages/CreateTaasPayment/styles.module.scss index 23516d0d..14ee4892 100644 --- a/src/routes/CreateNewTeam/pages/CreateTaasPayment/styles.module.scss +++ b/src/routes/CreateNewTeam/pages/CreateTaasPayment/styles.module.scss @@ -167,3 +167,20 @@ } } } + +.trusted { + background-color: #FFF; + border-radius: 8px; + padding: 12px 10px 15px 10px; + width: 250px; + + h6 { + @include font-barlow; + font-weight: 600; + text-align: center; + color: #9D41C9; + font-size: 16px; + margin-bottom: 10px; + text-transform: uppercase; + } +} From a9a5cc7ba1889f58451f42344331aaf69a7c195b Mon Sep 17 00:00:00 2001 From: yoution Date: Thu, 16 Sep 2021 16:34:31 +0800 Subject: [PATCH 04/11] fix: issue #504 --- src/constants/index.js | 2 +- .../NoMatchingProfilesResultCard/index.jsx | 32 +++++++++++-------- .../pages/CreateTaasPayment/index.jsx | 17 ++++++---- 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/src/constants/index.js b/src/constants/index.js index 721448e9..ab58e3cf 100644 --- a/src/constants/index.js +++ b/src/constants/index.js @@ -391,7 +391,7 @@ export const MAX_ALLOWED_INTERVIEWS = 3; /** * Custom role names to remove from RoleList component */ -export const CUSTOM_ROLE_NAMES = ["custom", "niche", "custom role"]; +export const CUSTOM_ROLE_NAMES = ["custom", "niche"]; /** * Minimal Resource Booking duration (weeks) diff --git a/src/routes/CreateNewTeam/components/NoMatchingProfilesResultCard/index.jsx b/src/routes/CreateNewTeam/components/NoMatchingProfilesResultCard/index.jsx index a323c9e0..40a2e913 100644 --- a/src/routes/CreateNewTeam/components/NoMatchingProfilesResultCard/index.jsx +++ b/src/routes/CreateNewTeam/components/NoMatchingProfilesResultCard/index.jsx @@ -35,16 +35,18 @@ function NoMatchingProfilesResultCard({ role, onSubmit }) { if (role.jobTitle && role.jobTitle.length) { name = role.jobTitle; } - dispatch( - addSearchedRole({ - searchId, - name, - rates: role.rates, - imageUrl: role.imageUrl, - }) - ); - onSubmit() - }, [dispatch, role]); + if (!alreadyAdded) { + dispatch( + addSearchedRole({ + searchId, + name, + rates: role.rates, + imageUrl: role.imageUrl, + }) + ); + } + onSubmit(); + }, [dispatch, role, alreadyAdded]); return (
@@ -54,11 +56,13 @@ function NoMatchingProfilesResultCard({ role, onSubmit }) {
-

- What happens next -

+

What happens next

- We routinely place great people with the skills you’ve asked for. Right now, we don’t have anyone available. However, our database is dynamic and updated often. Please continue below so we can finalize your talent request and alert you when a great candidate becomes available. + We routinely place great people with the skills you’ve asked for. + Right now, we don’t have anyone available. However, our database is + dynamic and updated often. Please continue below so we can finalize + your talent request and alert you when a great candidate becomes + available.

diff --git a/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx b/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx index b3c1c63e..8ea90cc0 100644 --- a/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx +++ b/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx @@ -5,7 +5,6 @@ import { Elements } from "@stripe/react-stripe-js"; import { loadStripe } from "@stripe/stripe-js"; import { ThemeProvider } from "@material-ui/styles"; import { toastr } from "react-redux-toastr"; -import { isCustomRole } from "utils/helpers"; import PaymentForm from "./PaymentForm"; import PageHeader from "components/PageHeader"; @@ -59,7 +58,8 @@ const CreateTassPayment = () => { durationWeeks, availability, }); - if (!isCustomRole(role)) { + // not custome role + if (role.imageUrl) { amount.push({ rate, numberOfResources }); } }); @@ -112,15 +112,20 @@ const CreateTassPayment = () => {

{data.name}

    - {!isCustomRole(data) &&
  • - {data.numberOfResources} x ${data.rate}/ Week -
  • } + {data.imageUrl && ( +
  • + {data.numberOfResources} x ${data.rate}/ Week +
  • + )}
  • {data.durationWeeks} Week Duration
  • {data.availability}

- ${isCustomRole(data) ? '0' : data.numberOfResources * data.rate} + $ + {!data.imageUrl + ? "0" + : data.numberOfResources * data.rate}


From ef3ba9faf15e3399fec450243485c176b67a70ad Mon Sep 17 00:00:00 2001 From: yoution Date: Thu, 21 Oct 2021 11:07:04 +0800 Subject: [PATCH 05/11] fix: issue #516 --- .../CreateNewTeam/pages/InputJobDescription/index.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/CreateNewTeam/pages/InputJobDescription/index.jsx b/src/routes/CreateNewTeam/pages/InputJobDescription/index.jsx index 0307083d..f6a49dad 100644 --- a/src/routes/CreateNewTeam/pages/InputJobDescription/index.jsx +++ b/src/routes/CreateNewTeam/pages/InputJobDescription/index.jsx @@ -31,11 +31,11 @@ function InputJobDescription() { }, []); const searchObject = useMemo(() => { - if (jobTitle && jobTitle.length) { - return { jobTitle, skills: selectedSkills }; + if (jobTitle && jobTitle.length && jdString) { + return { jobTitle, skills: selectedSkills, jobDescription: jdString }; } - return { skills: selectedSkills }; - }, [jobTitle, selectedSkills]); + return { skills: selectedSkills, jobDescription: jdString }; + }, [jobTitle, selectedSkills, jdString]); const onClick = useCallback(() => { setLoadingSkills(true); From 11e7d96e2d14a1925a25dcc74149e912bef12959 Mon Sep 17 00:00:00 2001 From: Maksym Mykhailenko Date: Sat, 23 Oct 2021 13:42:00 +0300 Subject: [PATCH 06/11] remove marketing text ref issue #408 --- src/routes/CreateNewTeam/components/ResultCard/index.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/routes/CreateNewTeam/components/ResultCard/index.jsx b/src/routes/CreateNewTeam/components/ResultCard/index.jsx index 8957bd6d..64cb8cb8 100644 --- a/src/routes/CreateNewTeam/components/ResultCard/index.jsx +++ b/src/routes/CreateNewTeam/components/ResultCard/index.jsx @@ -246,7 +246,6 @@ function ResultCard({
- (NEED TO DEVELOP TEXT W/ ANNIKA)
From 36236d80188ed7455bd5df0686f727459d7ec2b1 Mon Sep 17 00:00:00 2001 From: yoution Date: Sat, 23 Oct 2021 20:17:02 +0800 Subject: [PATCH 07/11] fix: issue #504 --- .../CreateTaasPayment/PaymentRule/index.jsx | 83 +++++++++++++++++++ .../PaymentRule/styles.module.scss | 64 ++++++++++++++ .../pages/CreateTaasPayment/index.jsx | 56 ++++++++----- .../CreateTaasPayment/styles.module.scss | 4 + 4 files changed, 185 insertions(+), 22 deletions(-) create mode 100644 src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentRule/index.jsx create mode 100644 src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentRule/styles.module.scss diff --git a/src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentRule/index.jsx b/src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentRule/index.jsx new file mode 100644 index 00000000..1156d214 --- /dev/null +++ b/src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentRule/index.jsx @@ -0,0 +1,83 @@ +import React, { useState } from "react"; +import cn from "classnames"; +import { useDispatch, useSelector } from "react-redux"; +import { navigate } from "@reach/router"; +import _ from "lodash"; +import { toastr } from "react-redux-toastr"; +import { postTeamRequest } from "services/teams"; +import Button from "components/Button"; +import Checkbox from "components/Checkbox"; +import Spinner from "components/CenteredSpinner"; +import { clearSearchedRoles } from "../../../actions"; + +import "./styles.module.scss"; + +const PaymentRule = ({ calculatedAmount }) => { + const [processing, setProcessing] = useState(false); + const [isChecked, setIsChecked] = useState(false); + const [clicked, setClicked] = useState(true); + const [projectId, setProjectId] = useState(null); + const dispatch = useDispatch(); + const { teamObject } = useSelector((state) => state.searchedRoles); + + const handlePostTeam = async (e) => { + setProcessing(true); + postTeamRequest(teamObject) + .then((res) => { + const projectId = _.get(res, "data.projectId"); + dispatch(clearSearchedRoles()); + navigate(`/taas/myteams/${projectId}`); + }) + .catch((err) => { + toastr.error("Error Requesting Team", err.message); + }) + .finally(() => { + setProcessing(false); + }); + }; + + return ( +
+
Our commitment to you
+
+ We will do everything we can to find the talent you need within the + Topcoder Community. +
+
Your commitment to us
+
+ You will only post genuine job opportunities, and will be responsive and + communicative with the candidates provided. You recognize the + freelancers in the Topcoder Community are real people making big + decisions based on your engagement with them. +
+
+ setIsChecked(!isChecked)} + /> +
+ +
+ ); +}; + +export default PaymentRule; diff --git a/src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentRule/styles.module.scss b/src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentRule/styles.module.scss new file mode 100644 index 00000000..bd21f64d --- /dev/null +++ b/src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentRule/styles.module.scss @@ -0,0 +1,64 @@ +@import "styles/include"; + +.commitment-container { + display: flex; + flex-direction: column; + margin: 0 10px 20px;; + + label { + margin-top: 10px; + font-size: 12px; + line-height: 15px; + span:last-child { + width: 15px; + height: 15px; + &:after { + left: 5px; + top: 2px ; + width: 4px ; + height: 9px ; + border-width: 0 2px 2px 0; + } + } + } + + + button[disabled] { + background-color: #e9e9e9; + color: #fff; + opacity: 1; + filter: none; + } + button { + margin-top: 10px; + display: flex; + width: 100%; + justify-content: center; + &.processing { + pointer-events: none; + } + .spinner { + margin-top: 3px; + margin-right: 5px; + } + } +} +.commitment-title { + @include font-barlow; + + margin-bottom: 2px; + font-weight: 600; + color: #2A2A2A; + font-size: 16px; + line-height: 20px; + text-transform: uppercase; +} + +.commitment-content { + @include font-roboto; + + color: #2A2A2A; + font-size: 14px; + line-height: 22px; + margin-bottom: 10px; +} diff --git a/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx b/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx index d14ff38f..0605abba 100644 --- a/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx +++ b/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx @@ -1,5 +1,6 @@ import React, { useState, useEffect, useCallback } from "react"; import _ from "lodash"; +import cn from "classnames"; import { useSelector } from "react-redux"; import { Elements } from "@stripe/react-stripe-js"; import { loadStripe } from "@stripe/stripe-js"; @@ -7,6 +8,7 @@ import { ThemeProvider } from "@material-ui/styles"; import { toastr } from "react-redux-toastr"; import PaymentForm from "./PaymentForm"; +import PaymentRule from "./PaymentRule"; import PageHeader from "components/PageHeader"; import { calculateAmount } from "services/teams"; import Progress from "../../components/Progress"; @@ -134,34 +136,44 @@ const CreateTassPayment = () => { ))} -

Deposit & Refund Terms

-
    -
  • This is a refundable deposit payment.
  • -
  • - Topcoder will find you qualified candidates within 2 weeks, or - your money back. -
  • -
  • - If we find you talent that meets your needs, this deposit will - be credited towards your payment. -
  • -
  • - If we are only able to partially fill your talent order, we - will refund any portion we cannot fulfill. -
  • -
  • - Future payments can be processed on this credit card or you - can arrange invoicing. -
  • -
+ {calculatedAmount ? ( + <> +

Deposit & Refund Terms

+
    +
  • This is a refundable deposit payment.
  • +
  • + Topcoder will find you qualified candidates within 2 + weeks, or your money back. +
  • +
  • + If we find you talent that meets your needs, this deposit + will be credited towards your payment. +
  • +
  • + If we are only able to partially fill your talent order, + we will refund any portion we cannot fulfill. +
  • +
  • + Future payments can be processed on this credit card or + you can arrange invoicing. +
  • +
+ + ) : null} -
+

${calculatedAmount}

Total Deposit


- + {calculatedAmount ? ( + + ) : ( + + )}
diff --git a/src/routes/CreateNewTeam/pages/CreateTaasPayment/styles.module.scss b/src/routes/CreateNewTeam/pages/CreateTaasPayment/styles.module.scss index 14ee4892..26a76d13 100644 --- a/src/routes/CreateNewTeam/pages/CreateTaasPayment/styles.module.scss +++ b/src/routes/CreateNewTeam/pages/CreateTaasPayment/styles.module.scss @@ -138,6 +138,10 @@ min-height: 570px; margin-left: 15px; + &.show-rule { + min-height: auto; + } + hr { background-color: #aaaaaa; height: 1px; From cc7d45253fd417915b535ac1e7f3189d3831f604 Mon Sep 17 00:00:00 2001 From: Maksym Mykhailenko Date: Sun, 24 Oct 2021 10:26:01 +0300 Subject: [PATCH 08/11] remove unused prop --- .../CreateNewTeam/pages/CreateTaasPayment/PaymentRule/index.jsx | 2 +- src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentRule/index.jsx b/src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentRule/index.jsx index 1156d214..7d2602ad 100644 --- a/src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentRule/index.jsx +++ b/src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentRule/index.jsx @@ -12,7 +12,7 @@ import { clearSearchedRoles } from "../../../actions"; import "./styles.module.scss"; -const PaymentRule = ({ calculatedAmount }) => { +const PaymentRule = () => { const [processing, setProcessing] = useState(false); const [isChecked, setIsChecked] = useState(false); const [clicked, setClicked] = useState(true); diff --git a/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx b/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx index 0605abba..dcd0cd6b 100644 --- a/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx +++ b/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx @@ -172,7 +172,7 @@ const CreateTassPayment = () => { {calculatedAmount ? ( ) : ( - + )} From a2107a64c6aa090c7598a51b7ad2f0cbe32f73fb Mon Sep 17 00:00:00 2001 From: yoution Date: Mon, 25 Oct 2021 21:10:49 +0800 Subject: [PATCH 09/11] fix: issue #525 --- .../components/NoMatchingProfilesResultCard/index.jsx | 1 + .../CreateNewTeam/components/SubmitContainer/index.jsx | 4 +++- .../CreateNewTeam/pages/CreateTaasPayment/index.jsx | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/routes/CreateNewTeam/components/NoMatchingProfilesResultCard/index.jsx b/src/routes/CreateNewTeam/components/NoMatchingProfilesResultCard/index.jsx index 40a2e913..20b6ee5f 100644 --- a/src/routes/CreateNewTeam/components/NoMatchingProfilesResultCard/index.jsx +++ b/src/routes/CreateNewTeam/components/NoMatchingProfilesResultCard/index.jsx @@ -39,6 +39,7 @@ function NoMatchingProfilesResultCard({ role, onSubmit }) { dispatch( addSearchedRole({ searchId, + isCustomRole: true, name, rates: role.rates, imageUrl: role.imageUrl, diff --git a/src/routes/CreateNewTeam/components/SubmitContainer/index.jsx b/src/routes/CreateNewTeam/components/SubmitContainer/index.jsx index 3c18064e..3f436fd9 100644 --- a/src/routes/CreateNewTeam/components/SubmitContainer/index.jsx +++ b/src/routes/CreateNewTeam/components/SubmitContainer/index.jsx @@ -109,7 +109,9 @@ function SubmitContainer({ position.roleSearchRequestId = key; position.roleName = addedRoles.find((role) => role.searchId === key).name; - + const role = addedRoles.find((role) => role.searchId === key) + position.roleName = role.name; + position.isCustomRole = role.isCustomRole positions.push(position); } teamObject.positions = positions; diff --git a/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx b/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx index dcd0cd6b..4f4e7d26 100644 --- a/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx +++ b/src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx @@ -57,12 +57,12 @@ const CreateTassPayment = () => { imageUrl, name, rate, + isCustomRole: role.isCustomRole, numberOfResources, durationWeeks, availability, }); - // not custome role - if (role.imageUrl) { + if (!role.isCustomRole) { amount.push({ rate, numberOfResources }); } }); @@ -115,7 +115,7 @@ const CreateTassPayment = () => {

{data.name}

    - {data.imageUrl && ( + {!data.isCustomRole && (
  • {data.numberOfResources} x ${data.rate}/ Week
  • @@ -126,7 +126,7 @@ const CreateTassPayment = () => {

$ - {!data.imageUrl + {data.isCustomRole ? "0" : data.numberOfResources * data.rate}

From 60b4291ed8a5a9229d0652d6018e9bd0f5a91ce8 Mon Sep 17 00:00:00 2001 From: yoution Date: Tue, 26 Oct 2021 21:29:21 +0800 Subject: [PATCH 10/11] fix: issue #504 --- .../CreateNewTeam/pages/CreateTaasPayment/PaymentForm/index.jsx | 1 + .../CreateNewTeam/pages/CreateTaasPayment/PaymentRule/index.jsx | 1 + 2 files changed, 2 insertions(+) diff --git a/src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentForm/index.jsx b/src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentForm/index.jsx index c34c7b1c..17c17188 100644 --- a/src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentForm/index.jsx +++ b/src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentForm/index.jsx @@ -142,6 +142,7 @@ const PaymentForm = ({ calculatedAmount }) => { } else if (payload.paymentIntent.status === "succeeded") { toastr.success("Payment is successful"); // setRequestLoading(true); + teamObject.positions = _.map(teamObject.positions, p=> _.omit(p, 'isCustomRole')) postTeamRequest(teamObject) .then((res) => { setProjectId(_.get(res, "data.projectId")); diff --git a/src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentRule/index.jsx b/src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentRule/index.jsx index 7d2602ad..bf4268e0 100644 --- a/src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentRule/index.jsx +++ b/src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentRule/index.jsx @@ -22,6 +22,7 @@ const PaymentRule = () => { const handlePostTeam = async (e) => { setProcessing(true); + teamObject.positions = _.map(teamObject.positions, p=> _.omit(p, 'isCustomRole')) postTeamRequest(teamObject) .then((res) => { const projectId = _.get(res, "data.projectId"); From 4d9c2e841c9bd762dae4a8d8e20bf5c2b4d6d6e9 Mon Sep 17 00:00:00 2001 From: yoution Date: Wed, 27 Oct 2021 12:42:18 +0800 Subject: [PATCH 11/11] fix: issue #529 --- .../components/SubmitContainer/index.jsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/routes/CreateNewTeam/components/SubmitContainer/index.jsx b/src/routes/CreateNewTeam/components/SubmitContainer/index.jsx index 3f436fd9..0d9835ae 100644 --- a/src/routes/CreateNewTeam/components/SubmitContainer/index.jsx +++ b/src/routes/CreateNewTeam/components/SubmitContainer/index.jsx @@ -109,9 +109,9 @@ function SubmitContainer({ position.roleSearchRequestId = key; position.roleName = addedRoles.find((role) => role.searchId === key).name; - const role = addedRoles.find((role) => role.searchId === key) + const role = addedRoles.find((role) => role.searchId === key); position.roleName = role.name; - position.isCustomRole = role.isCustomRole + position.isCustomRole = role.isCustomRole; positions.push(position); } teamObject.positions = positions; @@ -145,6 +145,9 @@ function SubmitContainer({ navigate("/taas/myteams/createnewteam/create-taas-payment"); } else { setMsg(true); + teamObject.positions = _.map(teamObject.positions, (p) => + _.omit(p, "isCustomRole") + ); postTeamRequest(teamObject) .then(() => { setTimeout(() => { @@ -178,7 +181,10 @@ function SubmitContainer({ currentRole={currentRole} /> ) : ( - setAddAnotherOpen(true)}/> + setAddAnotherOpen(true)} + /> )}