Skip to content

Gig tags #5505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ workflows:
filters:
branches:
only:
- free
- gig-tags
# This is stage env for production QA releases
- "build-prod-staging":
context : org-global
Expand Down
19 changes: 14 additions & 5 deletions src/shared/containers/Gigs/RecruitCRMJobs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ class RecruitCRMJobsContainer extends React.Component {
}
// Sort controlled by sortBy state
jobsToDisplay = jobsToDisplay.sort((a, b) => {
// sort tags first no matter the sortBy
const tagA = getCustomField(a.custom_fields, 'Job Tag');
const tagB = getCustomField(b.custom_fields, 'Job Tag');
if (tagB !== 'n/a' && tagA === 'n/a') return Number.MAX_VALUE;
if (tagB === 'n/a' && tagA !== 'n/a') return -Number.MIN_VALUE;
// sort featured gigs first no matter the sortBy
const featuredA = getCustomField(a.custom_fields, 'Featured');
const featuredB = getCustomField(b.custom_fields, 'Featured');
if (featuredB !== 'n/a' && featuredA === 'n/a') return Number.MAX_VALUE;
if (featuredB === 'n/a' && featuredA !== 'n/a') return -Number.MIN_VALUE;
return new Date(b[sortBy]) - new Date(a[sortBy]);
});
// Calc pages
Expand Down Expand Up @@ -248,6 +248,15 @@ class RecruitCRMJobsContainer extends React.Component {
<div styleName="location"><IconBlackLocation /> {hjob.country}</div>
<h5 styleName="job-title">{hjob.name}</h5>
<div styleName="job-money">${hjob.min_annual_salary} - {hjob.max_annual_salary} / {getSalaryType(hjob.salary_type)}</div>
{
getCustomField(hjob.custom_fields, 'Hotlist excerpt') !== 'n/a' ? (
<div styleName="job-desc">
{
`${getCustomField(hjob.custom_fields, 'Hotlist excerpt').substring(0, CONTENT_PREVIEW_LENGTH)}${getCustomField(hjob.custom_fields, 'Hotlist excerpt').length > CONTENT_PREVIEW_LENGTH ? '...' : ''}`
}
</div>
) : null
}
</Link>
) : (
<div styleName={`hotlist-item-${indx + 1}`} to={`${config.GIGS_PAGES_PATH}/${hjob.slug}`} key={`hotlist-item-${indx + 1}`}>
Expand Down