@@ -19,6 +19,8 @@ import { getQuery, updateQuery } from 'utils/url';
1919import { withOptimizely } from '@optimizely/react-sdk' ;
2020import './jobLisingStyles.scss' ;
2121
22+ const cookies = require ( 'browser-cookies' ) ;
23+
2224const CONTENT_PREVIEW_LENGTH = 175 ;
2325const GIGS_PER_PAGE = 10 ;
2426// Sort by dropdown
@@ -47,7 +49,7 @@ class RecruitCRMJobsContainer extends React.Component {
4749 this . onFilter = this . onFilter . bind ( this ) ;
4850 this . onLocation = this . onLocation . bind ( this ) ;
4951 this . onSort = this . onSort . bind ( this ) ;
50- this . onHotlistApply = this . onHotlistApply . bind ( this ) ;
52+ this . onHotlistClick = this . onHotlistClick . bind ( this ) ;
5153 }
5254
5355 componentDidMount ( ) {
@@ -121,9 +123,14 @@ class RecruitCRMJobsContainer extends React.Component {
121123 } ) ;
122124 }
123125
124- onHotlistApply ( ) {
126+ onHotlistClick ( job ) {
125127 const { optimizely } = this . props ;
126128 optimizely . track ( 'Hotlist ads click' ) ;
129+ cookies . set ( '_tc.hcl' , JSON . stringify ( {
130+ slug : job . slug ,
131+ } ) , {
132+ expires : 0 ,
133+ } ) ;
127134 }
128135
129136 render ( ) {
@@ -151,7 +158,8 @@ class RecruitCRMJobsContainer extends React.Component {
151158 // optimizely decide
152159 let decision = { enabled : true } ;
153160 if ( isomorphy . isClientSide ( ) ) {
154- decision = optimizely . decide ( 'gig_listing_hotlist' ) ;
161+ // decision = optimizely.decide('gig_listing_hotlist');
162+ decision = optimizely . decide ( 'gig_listing_hotlist_center' ) ;
155163 }
156164 let jobsToDisplay = jobs ;
157165 // build hotlist of jobs if present
@@ -244,7 +252,7 @@ class RecruitCRMJobsContainer extends React.Component {
244252 < div styleName = "hotlist-items" >
245253 {
246254 hotlistJobs . map ( ( hjob , indx ) => ( indx <= 1 ? (
247- < Link styleName = { `hotlist-item-${ indx + 1 } ` } to = { `${ config . GIGS_PAGES_PATH } /${ hjob . slug } ` } key = { `hotlist-item-${ indx + 1 } ` } onClick = { this . onHotlistApply } >
255+ < Link styleName = { `hotlist-item-${ indx + 1 } ` } to = { `${ config . GIGS_PAGES_PATH } /${ hjob . slug } ` } key = { `hotlist-item-${ indx + 1 } ` } onClick = { ( ) => this . onHotlistClick ( hjob ) } >
248256 < div styleName = "location" > < IconBlackLocation /> { hjob . country } </ div >
249257 < h5 styleName = "job-title" > { hjob . name } </ h5 >
250258 < div styleName = "job-money" > ${ hjob . min_annual_salary } - { hjob . max_annual_salary } / { getSalaryType ( hjob . salary_type ) } </ div >
@@ -272,7 +280,7 @@ class RecruitCRMJobsContainer extends React.Component {
272280 </ div >
273281 ) : null
274282 }
275- < Link styleName = { `hotlist-item-button-${ indx + 1 } ` } to = { `${ config . GIGS_PAGES_PATH } /${ hjob . slug } ` } onClick = { this . onHotlistApply } > Apply Now</ Link >
283+ < Link styleName = { `hotlist-item-button-${ indx + 1 } ` } to = { `${ config . GIGS_PAGES_PATH } /${ hjob . slug } ` } onClick = { ( ) => this . onHotlistClick ( hjob ) } > Apply Now</ Link >
276284 </ div >
277285 ) ) )
278286 }
0 commit comments