Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 8b13ce0

Browse files
authored
Merge pull request #507 from topcoder-platform/dev
[PROD] Next Release
2 parents 7c097b8 + 286496e commit 8b13ce0

File tree

18 files changed

+333
-144
lines changed

18 files changed

+333
-144
lines changed

local/login-locally/package-lock.json

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/assets/images/icon-earth-x.svg

-13
This file was deleted.

src/assets/images/icon-person.svg

+11
Loading

src/assets/images/trusted-logos.svg

+3
Loading

src/routes/CreateNewTeam/components/NoMatchingProfilesResultCard/index.jsx

+27-40
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import PT from "prop-types";
88
import { useDispatch, useSelector } from "react-redux";
99
import { addSearchedRole } from "../../actions";
1010
import "./styles.module.scss";
11-
import IconEarthX from "../../../../assets/images/icon-earth-x.svg";
11+
import IconPerson from "../../../../assets/images/icon-person.svg";
1212
import Curve from "../../../../assets/images/curve.svg";
1313
import Button from "components/Button";
1414
import { formatMoney } from "utils/format";
1515

16-
function NoMatchingProfilesResultCard({ role }) {
16+
function NoMatchingProfilesResultCard({ role, onSubmit }) {
1717
const { addedRoles } = useSelector((state) => state.searchedRoles);
1818

1919
const alreadyAdded = useMemo(() => {
@@ -35,62 +35,48 @@ function NoMatchingProfilesResultCard({ role }) {
3535
if (role.jobTitle && role.jobTitle.length) {
3636
name = role.jobTitle;
3737
}
38-
dispatch(
39-
addSearchedRole({
40-
searchId,
41-
name,
42-
rates: role.rates,
43-
imageUrl: role.imageUrl,
44-
})
45-
);
46-
}, [dispatch, role]);
38+
if (!alreadyAdded) {
39+
dispatch(
40+
addSearchedRole({
41+
searchId,
42+
isCustomRole: true,
43+
name,
44+
rates: role.rates,
45+
imageUrl: role.imageUrl,
46+
})
47+
);
48+
}
49+
onSubmit();
50+
}, [dispatch, role, alreadyAdded]);
4751

4852
return (
4953
<div styleName="result-card">
5054
<div styleName="heading">
51-
<IconEarthX />
52-
<h3>Dang. No matching talent (yet)</h3>
55+
<IconPerson />
56+
<h3>locating available custom talent</h3>
5357
<Curve styleName="curve" />
54-
<IconEarthX styleName="transparent-icon" />
5558
</div>
5659
<div styleName="content">
57-
<h4 styleName="job-title">
58-
{role.jobTitle && role.jobTitle.length
59-
? role.jobTitle
60-
: "What happens next"}
61-
</h4>
60+
<h4 styleName="job-title">What happens next</h4>
6261
<p styleName="info-txt">
63-
We did not find a perfect match to your requirements, but we'd like to
64-
dig a little deeper into our community. We’ll start right away, and
65-
this may take up to two weeks. You can modify your criteria, or
66-
continue this search. If you choose to continue, we will reach out
67-
soon with next steps.
62+
We routinely place great people with the skills you’ve asked for.
63+
Right now, we don’t have anyone available. However, our database is
64+
dynamic and updated often. Please continue below so we can finalize
65+
your talent request and alert you when a great candidate becomes
66+
available.
6867
</p>
69-
{role.rates && role.name ? (
70-
<div styleName="niche-rate-box">
71-
<p>Estimate for this role</p>
72-
<p styleName="cost">{formatMoney(role.rates[0].global)}</p>
73-
<p>/Week</p>
74-
</div>
75-
) : (
76-
<div styleName="niche-rate-box">
77-
<p>Estimate for this role</p>
78-
<p styleName="cost">$1,200</p>
79-
<p>/Week</p>
80-
</div>
81-
)}
8268
<div styleName="button-group">
8369
<Link to="/taas/createnewteam">
8470
<Button styleName="left" type="secondary">
85-
Modify Search Criteria
71+
Modify Search
8672
</Button>
8773
</Link>
8874
<Button
8975
onClick={addRole}
90-
disabled={!role.roleSearchRequestId || alreadyAdded}
76+
disabled={!role.roleSearchRequestId}
9177
type="primary"
9278
>
93-
{alreadyAdded ? "Added" : "Continue this search"}
79+
Request talent
9480
</Button>
9581
</div>
9682
</div>
@@ -100,6 +86,7 @@ function NoMatchingProfilesResultCard({ role }) {
10086

10187
NoMatchingProfilesResultCard.propTypes = {
10288
role: PT.object,
89+
onSubmit: PT.func,
10390
};
10491

10592
export default NoMatchingProfilesResultCard;

src/routes/CreateNewTeam/components/NoMatchingProfilesResultCard/styles.module.scss

+1-42
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
padding: 30px 0 60px 0;
1616
margin-bottom: 14px;
1717
color: #fff;
18-
background-image: linear-gradient(225deg, #555555 0%, #2a2a2a 100%);
18+
background-image: linear-gradient(90deg, #F45500 0%, #FF940F 100%);
1919
position: relative;
2020
text-align: center;
2121
border-radius: 8px 8px 0 0;
@@ -59,38 +59,6 @@
5959
width: 80%;
6060
text-align: center;
6161
}
62-
.niche-rate-box {
63-
margin-top: 32px;
64-
background-color: #fbfbfb;
65-
padding: 30px;
66-
border: 1px solid #f4f4f4;
67-
border-radius: 6px;
68-
width: 196px;
69-
p:first-child {
70-
@include font-barlow;
71-
margin-top: 4px;
72-
font-size: 16px;
73-
line-height: 20px;
74-
font-weight: 600;
75-
text-align: center;
76-
text-transform: uppercase;
77-
}
78-
p:last-child {
79-
@include font-roboto;
80-
color: #555555;
81-
font-size: 14px;
82-
line-height: 22px;
83-
text-align: center;
84-
}
85-
.cost {
86-
@include font-barlow-condensed;
87-
margin-top: 8px;
88-
font-size: 48px;
89-
line-height: 50px;
90-
font-weight: 500;
91-
text-align: center;
92-
}
93-
}
9462

9563
.button-group {
9664
margin-top: 62px;
@@ -110,12 +78,3 @@
11078
bottom: -70px;
11179
width: 100%;
11280
}
113-
114-
.transparent-icon {
115-
position: absolute;
116-
top: -40px;
117-
right: 10px;
118-
opacity: 12%;
119-
height: 142px;
120-
width: 142px;
121-
}

src/routes/CreateNewTeam/components/ResultCard/index.jsx

-3
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,7 @@ function ResultCard({
245245
</div>
246246
</div>
247247
<div styleName="timeline-info">
248-
<IconTeamMeetingChat />
249248
<div>
250-
<p>Interviews can start within</p>
251-
<h6>{timeToInterview}h</h6>
252249
</div>
253250
</div>
254251
</div>

src/routes/CreateNewTeam/components/SearchContainer/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function SearchContainer({
7777
currentRole={currentRole}
7878
/>
7979
);
80-
return <NoMatchingProfilesResultCard role={matchingRole} />;
80+
return <NoMatchingProfilesResultCard role={matchingRole} onSubmit={onSubmit}/>;
8181
};
8282

8383
const progressBarPercentage = useMemo(

src/routes/CreateNewTeam/components/SubmitContainer/index.jsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ function SubmitContainer({
109109

110110
position.roleSearchRequestId = key;
111111
position.roleName = addedRoles.find((role) => role.searchId === key).name;
112-
112+
const role = addedRoles.find((role) => role.searchId === key);
113+
position.roleName = role.name;
114+
position.isCustomRole = role.isCustomRole;
113115
positions.push(position);
114116
}
115117
teamObject.positions = positions;
@@ -143,6 +145,9 @@ function SubmitContainer({
143145
navigate("/taas/myteams/createnewteam/create-taas-payment");
144146
} else {
145147
setMsg(true);
148+
teamObject.positions = _.map(teamObject.positions, (p) =>
149+
_.omit(p, "isCustomRole")
150+
);
146151
postTeamRequest(teamObject)
147152
.then(() => {
148153
setTimeout(() => {
@@ -176,7 +181,10 @@ function SubmitContainer({
176181
currentRole={currentRole}
177182
/>
178183
) : (
179-
<NoMatchingProfilesResultCard role={matchingRole} />
184+
<NoMatchingProfilesResultCard
185+
role={matchingRole}
186+
onSubmit={() => setAddAnotherOpen(true)}
187+
/>
180188
)}
181189
<div styleName="right-side">
182190
<AddedRolesAccordion addedRoles={addedRoles} />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* useLoadSkills hook
3+
*/
4+
import { useEffect, useState } from "react";
5+
import { flatten, partition } from "lodash";
6+
import { useData } from "hooks/useData";
7+
import { getSkills } from "services/skills";
8+
import { getRoles } from "services/roles";
9+
10+
/**
11+
* Hook which loads all skills and roles, then partitions skills based
12+
* on whether any role requires the given skill.
13+
*
14+
* @returns [skills, error] tuple with `skills` array and `error` object
15+
*/
16+
export const useLoadSkills = () => {
17+
const [skills, skillsError] = useData(getSkills);
18+
const [roles, rolesError] = useData(getRoles);
19+
const [partedSkills, setPartedSkills] = useState();
20+
21+
useEffect(() => {
22+
if (skills && roles) {
23+
const requiredSkills = new Set();
24+
roles.forEach((role) => {
25+
role.listOfSkills.forEach((skill) => {
26+
requiredSkills.add(skill);
27+
});
28+
});
29+
setPartedSkills(() =>
30+
flatten(partition(skills, (skill) => requiredSkills.has(skill.name)))
31+
);
32+
}
33+
}, [skills, roles]);
34+
35+
return [partedSkills, skillsError || rolesError];
36+
};

src/routes/CreateNewTeam/pages/CreateTaasPayment/PaymentForm/index.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ const PaymentForm = ({ calculatedAmount }) => {
142142
} else if (payload.paymentIntent.status === "succeeded") {
143143
toastr.success("Payment is successful");
144144
// setRequestLoading(true);
145+
teamObject.positions = _.map(teamObject.positions, p=> _.omit(p, 'isCustomRole'))
145146
postTeamRequest(teamObject)
146147
.then((res) => {
147148
setProjectId(_.get(res, "data.projectId"));

0 commit comments

Comments
 (0)