Skip to content

Commit f21c1de

Browse files
Merge pull request #5483 from topcoder-platform/gig-mkt-ab
Gig mkt ab
2 parents 8dcdb17 + 0758251 commit f21c1de

File tree

18 files changed

+400
-40
lines changed

18 files changed

+400
-40
lines changed

.circleci/config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,8 @@ workflows:
281281
context : org-global
282282
filters:
283283
branches:
284-
only:
284+
only:
285285
- free
286-
287286
# This is alternate dev env for parallel testing
288287
- "build-qa":
289288
context : org-global

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ ARG SENDGRID_API_KEY
7373
ARG GROWSURF_API_KEY
7474
ARG GROWSURF_CAMPAIGN_ID
7575

76+
# Optimizely
77+
ARG OPTIMIZELY_SDK_KEY
78+
7679
################################################################################
7780
# Setting of environment variables in the Docker image.
7881

@@ -133,6 +136,9 @@ ENV GROWSURF_API_KEY=$GROWSURF_API_KEY
133136
ENV GROWSURF_CAMPAIGN_ID=$GROWSURF_CAMPAIGN_ID
134137
ENV GSHEETS_API_KEY=$GSHEETS_API_KEY
135138

139+
# Optimizely
140+
ENV OPTIMIZELY_SDK_KEY=$OPTIMIZELY_SDK_KEY
141+
136142
################################################################################
137143
# Testing and build of the application inside the container.
138144

build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ docker build -t $TAG \
4949
--build-arg GROWSURF_API_KEY=$GROWSURF_API_KEY \
5050
--build-arg GROWSURF_CAMPAIGN_ID=$GROWSURF_CAMPAIGN_ID \
5151
--build-arg GSHEETS_API_KEY=$GSHEETS_API_KEY \
52+
--build-arg OPTIMIZELY_SDK_KEY=$OPTIMIZELY_SDK_KEY \
5253
--build-arg COMMUNITY_APP_URL=$COMMUNITY_APP_URL .
5354

5455
# Copies "node_modules" from the created image, if necessary for caching.

config/custom-environment-variables.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,7 @@ module.exports = {
109109
TOKEN_CACHE_TIME: 'TOKEN_CACHE_TIME',
110110
},
111111
GSHEETS_API_KEY: 'GSHEETS_API_KEY',
112+
OPTIMIZELY: {
113+
SDK_KEY: 'OPTIMIZELY_SDK_KEY',
114+
},
112115
};

config/default.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,4 +426,7 @@ module.exports = {
426426
DEBOUNCE_ON_CHANGE_TIME: 150,
427427
},
428428
ENABLE_RECOMMENDER: true,
429+
OPTIMIZELY: {
430+
SDK_KEY: '7V4CJhurXT3Y3bnzv1hv1',
431+
},
429432
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
},
3838
"dependencies": {
3939
"@hapi/joi": "^16.1.4",
40+
"@optimizely/react-sdk": "^2.5.0",
4041
"@topcoder-platform/tc-auth-lib": "topcoder-platform/tc-auth-lib#1.0.4",
4142
"aos": "^2.3.4",
4243
"atob": "^2.1.1",
1.95 KB
Loading
1.52 KB
Loading
1.88 KB
Loading

src/server/services/recruitCRM.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const JOB_FIELDS_RESPONSE = [
2626
'salary_type',
2727
'max_annual_salary',
2828
'job_description_text',
29+
'job_status',
2930
];
3031
const CANDIDATE_FIELDS_RESPONSE = [
3132
'id',

src/shared/components/GUIKit/JobListCard/index.jsx

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,24 @@ import React from 'react';
66
import PT from 'prop-types';
77
import { config, Link } from 'topcoder-react-utils';
88
import { getSalaryType, getCustomField } from 'utils/gigs';
9+
import { withOptimizely } from '@optimizely/react-sdk';
910
import './style.scss';
1011
import IconBlackDuration from 'assets/images/icon-black-duration.svg';
1112
import IconBlackLocation from 'assets/images/icon-black-location.svg';
1213
import IconBlackPayment from 'assets/images/icon-black-payment.svg';
1314
import iconBlackSkills from 'assets/images/icon-skills.png';
15+
import newTag from 'assets/images/gig-work/tag-new.png';
16+
import hotTag from 'assets/images/gig-work/tag-hot.png';
17+
import dolarsTag from 'assets/images/gig-work/tag-dolars.png';
1418

15-
export default function JobListCard({
19+
const TAGS = {
20+
New: newTag,
21+
Hot: hotTag,
22+
$$$: dolarsTag,
23+
};
24+
function JobListCard({
1625
job,
26+
optimizely,
1727
}) {
1828
const duration = getCustomField(job.custom_fields, 'Duration');
1929
let skills = getCustomField(job.custom_fields, 'Technologies Required');
@@ -25,10 +35,17 @@ export default function JobListCard({
2535
skills = skills.join(', ');
2636
}
2737
}
38+
const tag = getCustomField(job.custom_fields, 'Job Tag');
39+
const onHotlistApply = () => {
40+
optimizely.track('View Details Click');
41+
};
2842

2943
return (
3044
<div styleName="container">
31-
<Link to={`${config.GIGS_PAGES_PATH}/${job.slug}`} styleName="gig-name">{job.name}</Link>
45+
{
46+
tag !== 'n/a' && <img src={TAGS[tag]} alt="gig-job-tag" styleName="gig-tag" />
47+
}
48+
<Link to={`${config.GIGS_PAGES_PATH}/${job.slug}`} styleName="gig-name" onClick={onHotlistApply}>{job.name}</Link>
3249
<div styleName="job-infos">
3350
<div styleName="icon-val">
3451
<img src={iconBlackSkills} alt="skills-icon" /> {skills}
@@ -43,7 +60,7 @@ export default function JobListCard({
4360
<IconBlackDuration /> {/^\d+$/.test(duration) ? `${duration} Weeks` : duration}
4461
</div>
4562
<div styleName="row-btn">
46-
<Link styleName="primary-green-md" to={`${config.GIGS_PAGES_PATH}/${job.slug}`}>VIEW DETAILS</Link>
63+
<Link styleName="primary-green-md" to={`${config.GIGS_PAGES_PATH}/${job.slug}`} onClick={onHotlistApply}>VIEW DETAILS</Link>
4764
</div>
4865
</div>
4966
</div>
@@ -56,4 +73,7 @@ JobListCard.defaultProps = {
5673

5774
JobListCard.propTypes = {
5875
job: PT.shape().isRequired,
76+
optimizely: PT.shape().isRequired,
5977
};
78+
79+
export default withOptimizely(JobListCard);

src/shared/components/GUIKit/JobListCard/style.scss

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,23 @@
77
display: flex;
88
flex-direction: column;
99
color: #2a2a2a;
10-
padding: 25px 35px;
10+
padding: 25px 35px 25px 44px;
1111
margin-bottom: 15px;
12+
position: relative;
1213

1314
@include gui-kit-headers;
1415
@include gui-kit-content;
1516
@include roboto-regular;
1617

18+
.gig-tag {
19+
position: absolute;
20+
top: -1px;
21+
left: 10px;
22+
width: 24px;
23+
height: 56px;
24+
border-radius: 0;
25+
}
26+
1727
.gig-name,
1828
.gig-name:visited,
1929
.gig-name:active,
@@ -50,18 +60,38 @@
5060

5161
&:first-child {
5262
width: 250px;
63+
64+
@media (max-width: 1280px) {
65+
width: auto;
66+
margin-right: 20px;
67+
}
5368
}
5469

5570
&:nth-child(2) {
5671
width: 204px;
72+
73+
@media (max-width: 1280px) {
74+
width: auto;
75+
margin-right: 20px;
76+
}
5777
}
5878

5979
&:nth-child(3) {
6080
width: 263px;
81+
82+
@media (max-width: 1280px) {
83+
width: auto;
84+
margin-right: 20px;
85+
}
6186
}
6287

6388
&:nth-child(4) {
6489
width: 255px;
90+
91+
@media (max-width: 1280px) {
92+
width: auto;
93+
margin-right: 20px;
94+
}
6595
}
6696

6797
&:last-child {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default function GigDetails(props) {
6666
return (
6767
<div styleName="container">
6868
{
69-
job.error || job.enable_job_application_form !== 1 ? (
69+
job.error || job.job_status.id !== 1 || job.enable_job_application_form !== 1 ? (
7070
<div styleName="error">
7171
{ job.error ? <SadFace /> : null }
7272
<h3>{ job.error ? 'Gig does not exist' : 'This Gig has been Fulfilled'}</h3>

src/shared/containers/Gigs/RecruitCRMJobApply.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ import PT from 'prop-types';
1010
import React from 'react';
1111
import { connect } from 'react-redux';
1212
import { isValidEmail } from 'utils/tc';
13+
import { withOptimizely } from '@optimizely/react-sdk';
1314
import techSkills from './techSkills';
1415

16+
1517
const countries = require('i18n-iso-countries');
1618
countries.registerLocale(require('i18n-iso-countries/langs/en.json'));
1719

@@ -120,12 +122,13 @@ class RecruitCRMJobApplyContainer extends React.Component {
120122
}
121123

122124
onApplyClick() {
123-
const { applyForJob, job } = this.props;
125+
const { applyForJob, job, optimizely } = this.props;
124126
const { formData } = this.state;
125127
this.validateForm();
126128
this.setState((state) => {
127129
if (_.isEmpty(state.formErrors)) {
128130
applyForJob(job, formData);
131+
optimizely.track('Submit Application Form');
129132
}
130133
});
131134
}
@@ -269,6 +272,7 @@ RecruitCRMJobApplyContainer.propTypes = {
269272
application: PT.shape(),
270273
searchCandidates: PT.func.isRequired,
271274
recruitProfile: PT.shape(),
275+
optimizely: PT.shape().isRequired,
272276
};
273277

274278
function mapStateToProps(state, ownProps) {
@@ -312,4 +316,4 @@ function mapDispatchToActions(dispatch) {
312316
export default connect(
313317
mapStateToProps,
314318
mapDispatchToActions,
315-
)(RecruitCRMJobApplyContainer);
319+
)(withOptimizely(RecruitCRMJobApplyContainer));

0 commit comments

Comments
 (0)