Skip to content
This repository was archived by the owner on Jun 10, 2019. It is now read-only.

Display featured jobs on Jobs page, above search results #985

Merged
merged 9 commits into from
Jul 13, 2018
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions src/scenes/home/jobs/featuredJob/featuredJob.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* Note: these styles are copied to match the ziprecruiter styles that are being dynamically inserted on our page (see jobs.js) */

.job {
padding: 15px 0px;
}

.link {
text-decoration: none;
color: #1a0dab;
font-size: 17px;
float: left;
margin-right: 3px;
margin-bottom: 1px;
}

.details {
font-size: 13px;
color: #999999;
margin: 3px 0;
clear: both;
}

.detailsContainer {
float: left;
margin-right: 15px;
}

.detail {
margin-left: 4px;
}

.remote {
composes: detail;
font-style: italic;
}

.description {
clear: both;
font-size: 14px;
color: #545454;
line-height: 1.4;
word-wrap: break-word;
}
65 changes: 65 additions & 0 deletions src/scenes/home/jobs/featuredJob/featuredJob.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import React from 'react';
import PropTypes from 'prop-types';
import FontAwesomeIcon from '@fortawesome/react-fontawesome';
import { faMapMarkerAlt, faBuilding, faCloudUploadAlt } from '@fortawesome/fontawesome-free-solid';
import OutboundLink from 'shared/components/outboundLink/outboundLink';
import styles from './featuredJob.css';

const FeaturedJob = ({
title,
source,
sourceUrl,
city,
state,
country,
description,
remote
}) => (
<div>
<div className={styles.job}>
<div>
<OutboundLink href={sourceUrl} analyticsEventLabel={`[FeaturedJob] ${sourceUrl}`}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌 ty for thinking of analytics

<span className={styles.link}>{title}</span>
</OutboundLink>
</div>
<div className={styles.details}>
<div className={styles.detailsContainer}>
<FontAwesomeIcon icon={faBuilding} size="sm" style={{ color: '#afafaf' }} />
<span className={styles.detail}>{source}</span>
</div>
<div className={styles.detailsContainer}>
<FontAwesomeIcon icon={faMapMarkerAlt} size="sm" style={{ color: '#afafaf' }} />
<span className={styles.detail}>{city},</span>
<span className={styles.detail}>{state},</span>
<span className={styles.detail}>{country}</span>
</div>
{remote &&
<div className={styles.detailsContainer}>
<FontAwesomeIcon icon={faCloudUploadAlt} size="sm" style={{ color: '#afafaf' }} />
<span className={styles.remote}>Remote</span>
</div>
}
</div>
<div className={styles.description}>
{description}
</div>
</div>
</div >
);

FeaturedJob.propTypes = {
title: PropTypes.string.isRequired,
source: PropTypes.string.isRequired,
sourceUrl: PropTypes.string.isRequired,
city: PropTypes.string.isRequired,
state: PropTypes.string.isRequired,
country: PropTypes.string.isRequired,
description: PropTypes.string.isRequired,
remote: PropTypes.bool
};

FeaturedJob.defaultProps = {
remote: false
};

export default FeaturedJob;
50 changes: 50 additions & 0 deletions src/scenes/home/jobs/featuredJobs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[
{
"title": "Software Engineer (Mock Data)",
"source": "Microsoft",
"sourceUrl": "https://www.microsoft.com",
"city": "Redmond",
"state": "Washington",
"country": "United States",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
"status": "inactive",
"remote": false,
"tags": [
"C#",
"ASP.Net",
"DevOps"
]
},
{
"title": "QA Engineer (Mock Data)",
"source": "Apple",
"sourceUrl": "https://www.apple.com",
"city": "San Francisco",
"state": "California",
"country": "United States",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ",
"status": "inactive",
"remote": true,
"tags": [
"C#",
"ASP.Net",
"DevOps"
]
},
{
"title": "DevOps Engineeer (Mock Data)",
"source": "GitHub",
"sourceUrl": "https://www.github.com",
"city": "Austin",
"state": "Texas",
"country": "United States",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
"status": "inactive",
"remote": false,
"tags": [
"C#",
"ASP.Net",
"DevOps"
]
}
]
20 changes: 20 additions & 0 deletions src/scenes/home/jobs/jobs.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* Note: these styles are copied to match the ziprecruiter styles that are inserted on our page */

.featuredJobsContainer {
width: 100%;
float: left;
clear: both;
}

.featuredJobs {
font-family: Arial, Helvetica, sans-serif;
margin: 30px 0px 10px;
width: 100%;
max-width: 768px;
}

.contact {
margin: 30px 0 0 0;
align-self: flex-start;
font-size: 1rem;
}
40 changes: 37 additions & 3 deletions src/scenes/home/jobs/jobs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React, { Component } from 'react';
import Section from 'shared/components/section/section';
import FeaturedJob from './featuredJob/featuredJob';
import FeaturedJobsData from './featuredJobs.json';
import styles from './jobs.css';

const zipRecruiterScript = document.createElement('script');

Expand Down Expand Up @@ -29,11 +32,42 @@ class Jobs extends Component {
};
tryRunInit();
}

render() {
const featuredJobs = FeaturedJobsData
.filter(x => x.status === 'active')
.map(job => (
<FeaturedJob
key={`${Math.random()} + ${job.name} + ${job.sourceUrl}`}
title={job.title}
source={job.source}
sourceUrl={job.sourceUrl}
city={job.city}
state={job.state}
country={job.country}
description={job.description}
status={job.status}
remote={job.remote}
/>
));

return (
<Section title="Open Positions" theme="white">
<div id="zipsearch_container" />
</Section>
<div>
<Section title="Featured Jobs" theme="whiteCondensed">
<div className={styles.featuredJobsContainer}>
<div className={styles.featuredJobs}>
{featuredJobs}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should do

{FeaturedJobsData.length() > 0 ? featuredJobs : <div>some default content expressed a lack of featured jobs and how to get one featured</div>}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. We should probably have a contact link somewhere here. It should display whether or not there are any featured jobs exist. Can start off with an email link to @ksmacleod99 for now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kylemh As long as we have the contact link (explaining how to get a featured job), we can probably go live with this sooner (without any featured jobs yet). Test out the waters and see if we get anyone contacting us.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. You've got the structure in place for jobs when they come in.

I'd say create the default, see what traffic - if any - we get towards that feature.

Back-end can look at the JSON in this PR as an example to prepare for, and the ticket can be ✅

Copy link
Member Author

@jjhampton jjhampton Jun 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kylemh I also went ahead and set the three 'mock' Jobs in the JSON file as "status": "inactive", so they won't display on the page. I think back-end PR is actually nearing completion (to serve up API data), but I can leave the mock JSON data in there until then as a guide.

</div>
</div>
<p className={styles.contact}>
Are you hiring? <a href="mailto:[email protected]">Contact</a> us to post your job opening with Operation Code!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use the ExternalLink component here? Then it will be good to go.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed to use the OutboundLink component in latest commit, also updated email contact address (sending them to Kelly since she'll be coordinating this, confirmed usage with her already).

</p>
</Section>
<Section title="Search All Jobs" theme="white">
<div id="zipsearch_container" />
</Section>
</div>

);
}
}
Expand Down
9 changes: 9 additions & 0 deletions src/shared/components/section/section.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
background-color: #FFF;
}

.condensed {
min-height: 0;
}

.whiteCondensed {
composes: white;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woah - never knew about this! thanks for showing me something new.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, there's a couple other places we've been using composes w/ CSS Modules in the app - it's a nice way of composing multiple classes together to create a new one, so you only need to apply one CSS class to an element instead of multiple ones (which is sometimes seen w/ patterns like BEM).

composes: condensed;
}

.content {
display: flex;
flex-flow: column;
Expand Down