Skip to content

Commit 622586b

Browse files
committed
qa fixes #5429
1 parent 69cedb5 commit 622586b

File tree

4 files changed

+62
-14
lines changed

4 files changed

+62
-14
lines changed
Lines changed: 12 additions & 0 deletions
Loading

src/shared/components/Gigs/GigApply/index.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import './style.scss';
2020
import bigCheckmark from 'assets/images/big-checkmark.png';
2121
import SadFace from 'assets/images/sad-face-icon.svg';
2222
import BackArrowGig from 'assets/images/back-arrow-gig-apply.svg';
23+
import CheckmarkGreen from 'assets/images/checkmark-green.svg';
2324

2425
export default function GigApply(props) {
2526
const {
@@ -96,10 +97,10 @@ export default function GigApply(props) {
9697
<div styleName="form-wrap">
9798
{!_.isEmpty(recruitProfile)
9899
&& (
99-
<p styleName="info-text">
100-
<strong>It looks like you have applied to a gig previously. Perfect!&#10003;</strong><br />
101-
We have most of your information. Is there anything you would like to update to your Gig Work Profile?
102-
</p>
100+
<div styleName="info-text">
101+
<h6>It looks like you have applied to a gig previously. Perfect!<CheckmarkGreen /></h6>
102+
<p>We have most of your information. Is there anything you would like to update to your Gig Work Profile?</p>
103+
</div>
103104
)}
104105
<h4>PERSONAL INFORMATION</h4>
105106
{_.isEmpty(recruitProfile)

src/shared/components/Gigs/GigApply/style.scss

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,21 @@
150150

151151
.info-text {
152152
font-size: 16px;
153-
margin-top: 35px;
153+
margin-top: 55px;
154+
155+
h6 {
156+
font-family: Barlow, sans-serif;
157+
font-size: 16px;
158+
line-height: 20px;
159+
font-weight: 600;
160+
margin-bottom: 8px;
161+
display: flex;
162+
align-items: center;
163+
164+
svg {
165+
margin-left: 5px;
166+
}
167+
}
154168
}
155169

156170
.form-section {

src/shared/containers/Gigs/RecruitCRMJobApply.jsx

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,27 +45,48 @@ class RecruitCRMJobApplyContainer extends React.Component {
4545
this.validateForm = this.validateForm.bind(this);
4646
}
4747

48+
// eslint-disable-next-line consistent-return
4849
componentDidMount() {
4950
const { formData } = this.state;
5051
const { user, recruitProfile, searchCandidates } = this.props;
51-
this.setState({
52-
formData: _.merge(formData, user),
53-
});
54-
if (user && !recruitProfile) {
55-
searchCandidates(user.email);
52+
if (user) {
53+
if (!recruitProfile) searchCandidates(user.email);
54+
else {
55+
const { country, skills } = formData;
56+
const recruitSkills = recruitProfile.skill.split(',').map(s => s.toLowerCase());
57+
return this.setState({
58+
formData: _.merge(formData, user, {
59+
phone: recruitProfile.contact_number,
60+
country: _.map(
61+
country,
62+
c => ({
63+
label: c.label,
64+
selected: c.label.toLowerCase() === recruitProfile.locality.toLowerCase(),
65+
}),
66+
),
67+
skills: skills.map(s => ({
68+
label: s.label,
69+
selected: recruitSkills.includes(s.label.toLowerCase()),
70+
})),
71+
payExpectation: recruitProfile.salary_expectation,
72+
}),
73+
});
74+
}
75+
this.setState({
76+
formData: _.merge(formData, user),
77+
});
5678
}
5779
}
5880

5981
componentDidUpdate(prevProps) {
60-
const { recruitProfile } = this.props;
82+
const { recruitProfile, user } = this.props;
6183
if (recruitProfile !== prevProps.recruitProfile && !_.isEmpty(recruitProfile)) {
6284
// when recruit profile loaded
6385
const { formData } = this.state;
6486
const { country, skills } = formData;
6587
const recruitSkills = recruitProfile.skill.split(',').map(s => s.toLowerCase());
6688
const updatedForm = {
67-
formData: {
68-
...formData,
89+
formData: _.merge(formData, user, {
6990
phone: recruitProfile.contact_number,
7091
country: _.map(
7192
country,
@@ -79,7 +100,7 @@ class RecruitCRMJobApplyContainer extends React.Component {
79100
selected: recruitSkills.includes(s.label.toLowerCase()),
80101
})),
81102
payExpectation: recruitProfile.salary_expectation,
82-
},
103+
}),
83104
};
84105
// eslint-disable-next-line react/no-did-update-set-state
85106
this.setState(updatedForm);

0 commit comments

Comments
 (0)