Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
embl.org
html-sites
embl-jobs-pages
Commits
83f8cd45
Commit
83f8cd45
authored
May 14, 2021
by
Ken Hawkins
Browse files
feature: iframe-trarget
If the parent page is intended as an iframe, the links should target _parent
parent
1addf171
Pipeline
#156036
passed with stages
in 4 minutes and 38 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
src/components/home/EBIHome.js
src/components/home/EBIHome.js
+1
-1
src/components/home/Home.js
src/components/home/Home.js
+2
-2
src/components/job-list/JobList.jsx
src/components/job-list/JobList.jsx
+4
-3
No files found.
src/components/home/EBIHome.js
View file @
83f8cd45
...
...
@@ -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
"
/>
<
/
>
);
}
src/components/home/Home.js
View file @
83f8cd45
...
...
@@ -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
>
<
/
>
)}
...
...
src/components/job-list/JobList.jsx
View file @
83f8cd45
...
...
@@ -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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment