Commit 3a647172 authored by Nitin Jadhav's avatar Nitin Jadhav
Browse files

Merge branch 'feature/iframe-trarget' into 'master'

feature: iframe-trarget

See merge request !40
parents 1addf171 83f8cd45
Pipeline #156651 passed with stages
in 6 minutes
......@@ -8,7 +8,7 @@ export function EBIHome() {
{/* Supports iframe resizing on ebi.ac.uk/careers/jobs */}
<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script>
</Helmet>
<Home showLocations={false} jobLocation="EMBL-EBI Hinxton" />
<Home showLocations={false} jobLocation="EMBL-EBI Hinxton" isIframe="true" />
</>
);
}
......@@ -8,7 +8,7 @@ import React, { useCallback, useState } from "react";
import { useFetchJobsList } from "services/useFetchJobsList";
import "./Home.scss";
export function Home({ showLocations = true, jobLocation }) {
export function Home({ showLocations = true, jobLocation, isIframe = false }) {
const [filters, setFilters] = useState(getInitialFilters());
const {
......@@ -53,7 +53,7 @@ export function Home({ showLocations = true, jobLocation }) {
showLocations={showLocations}
/>
<JobList jobs={jobs} loading={loading} />
<JobList jobs={jobs} loading={loading} isIframe={isIframe} />
</section>
</>
)}
......
......@@ -5,7 +5,7 @@ import { formatISODate, parseISODateFromTimeHtml } from "helpers/date-helpers";
import { stripHtml } from "helpers/helpers";
import "./JobList.scss";
export function JobList({ jobs, loading }) {
export function JobList({ jobs, loading, isIframe = false }) {
if (loading) {
return <VFLoaderBox />;
}
......@@ -13,7 +13,7 @@ export function JobList({ jobs, loading }) {
return (
<div className="vf-content">
{jobs.map((job) => (
<JobList.JobListItem key={job.id} job={job} />
<JobList.JobListItem key={job.id} job={job} isIframe={isIframe} />
))}
{!jobs.length && <p>No matching jobs found.</p>}
<hr className="vf-divider" />
......@@ -25,7 +25,7 @@ export function JobList({ jobs, loading }) {
);
}
JobList.JobListItem = function JobListItem({ job }) {
JobList.JobListItem = function JobListItem({ job, isIframe = false }) {
const strippedText = stripHtml(job.field_jobs_description);
return (
<article
......@@ -35,6 +35,7 @@ JobList.JobListItem = function JobListItem({ job }) {
<h3 className="job-title vf-summary__title">
<Link
to={`/position/${job.field_jobs_reference_number}`}
target={isIframe ? '_parent' : '_self' }
className="vf-summary__link"
>
{job.title}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment