Skip to content

Commit 0aa2768

Browse files
CORE-4431 (#775)
* feat: CORE-4429 open pdf in new tab * CORE-4429 babel config * update dependencies * [CORE-4431] docs-membership (#773) * [CORE-4431] docs-membership (#774) Co-authored-by: Eka <[email protected]>
1 parent a6deabd commit 0aa2768

File tree

17 files changed

+83
-25
lines changed

17 files changed

+83
-25
lines changed

babel.config.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,29 @@ module.exports = (api) => {
66
'@babel/preset-env',
77
{
88
useBuiltIns: 'usage',
9-
corejs: 3,
9+
corejs: '3',
1010
},
1111
],
1212
'@babel/react',
1313
]
1414
const plugins = [
15+
'@babel/plugin-proposal-export-default-from',
1516
[
1617
'@babel/plugin-proposal-decorators',
1718
{
1819
legacy: true,
1920
},
2021
],
2122
'@babel/plugin-proposal-class-properties',
23+
'@babel/plugin-syntax-dynamic-import',
24+
'@babel/plugin-proposal-optional-chaining',
2225
'@babel/plugin-proposal-nullish-coalescing-operator',
26+
[
27+
'@babel/plugin-transform-runtime',
28+
{
29+
corejs: 3,
30+
},
31+
],
2332
]
2433

2534
return {

components/markdown.jsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import Link from './link'
99
// pure text but renders own TextRenderer componet instead
1010
const MarkdownLink = ({ href, title, children }) => (
1111
<Link href={href} passHref>
12-
<a title={title}>{children}</a>
12+
<a target={href.includes('.pdf') ? '_blank' : '_self'} title={title}>
13+
{children}
14+
</a>
1315
</Link>
1416
)
1517

components/outreach-materials/index.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const format2name = (type) =>
2323
}[type])
2424

2525
const format2action = (type) =>
26-
['gdoc', 'gslides'].includes(type) ? 'Open' : 'Download'
26+
['gdoc', 'gslides', 'pdf'].includes(type) ? 'Open' : 'Download'
2727

2828
const ResourceLink = ({
2929
id,
@@ -51,6 +51,7 @@ const ResourceLink = ({
5151
data-format={format.toLowerCase()}
5252
data-action={action}
5353
data-label={label}
54+
target="_blank"
5455
{...props}
5556
{...restProps}
5657
>

data/faq.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,10 @@ sections:
443443
question: |
444444
Can I use the CORE API for commercial purposes?
445445
answer: |
446-
Yes, you can use the CORE API for commercial purposes, (Terms & Conditions) apply.
447-
We provide 30 Day Free Trial for Institution and Enterprise.
448-
We will ask you for your circumstances during the registration process and we might
449-
contact you afterwards to clarify any points and assess your eligibility for a free licence.
446+
Yes, you can use the CORE API for commercial purposes, (Terms & Conditions) apply.
447+
We provide 30 Day Free Trial for Institution and Enterprise.
448+
We will ask you for your circumstances during the registration process and we might
449+
contact you afterwards to clarify any points and assess your eligibility for a free licence.
450450
If your circumstances change, please let us know.
451451
- slug: can-I-use-the-CORE-dataset-for-commercial-purposes
452452
question: |

data/membership.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ header:
1010
- caption: download our flyer
1111
url: /resources/core-leaflet-Glasgow-A3.pdf
1212
variant: text
13-
download: true
13+
target: _blank
1414

1515
content:
1616
- &dashboard

data/services/api.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ header:
1717
- caption: Download our flyer
1818
variant: text
1919
url: /resources/core-api-flyer.pdf
20-
download: true
20+
target: _blank
2121

2222

2323
features:

data/services/dataset.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ header:
1616
- caption: Download our flyer
1717
variant: text
1818
url: /resources/core-dataset-flyer.pdf
19-
download: true
19+
target: _blank
2020

2121
features:
2222
- title: All the data in one single place

data/services/fastsync.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ header:
1717
- caption: Download our flyer
1818
variant: text
1919
url: /resources/core-api-flyer.pdf
20-
download: true
20+
target: _blank
2121

2222

2323
features:

data/services/recommender.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ header:
2121
- caption: Download our flyer
2222
variant: text
2323
url: /resources/core_flyer_recomender.pdf
24-
download: true
24+
target: _blank
2525

2626

2727

data/sponsorship.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ header:
99
- caption: download our flyer
1010
url: /resources/flyer-CORE-Sponsorship.pdf
1111
variant: text
12-
download: true
12+
target: _blank
1313

1414
content:
1515
- &website

design-v2/components/hero/index.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const Hero = ({
3333
{actions.map((action) => (
3434
<Button
3535
href={action.url}
36+
target={action.target}
3637
variant={action.variant}
3738
key={action.caption}
3839
download={action.download}

netlify-cms.config.yml

+42
Original file line numberDiff line numberDiff line change
@@ -1132,3 +1132,45 @@ collections:
11321132
widget: markdown
11331133
required: false
11341134
label: Fields description
1135+
1136+
- name: docs-membership
1137+
1138+
media_folder: '/images/docs-membership'
1139+
1140+
create: false
1141+
delete: false
1142+
1143+
label: 📘 Documentation membership
1144+
label_singular: section
1145+
description: >
1146+
Documentation membership page for Dashboard and About
1147+
files:
1148+
- name: meta
1149+
label: ℹ️ Metadata (title, description, headline)
1150+
file: docs-membership/meta.yml
1151+
fields:
1152+
- name: title
1153+
widget: string
1154+
label: Title
1155+
hint: >
1156+
Displayed in the browser as a tab name and in Google, when
1157+
the page appears in the search results.
1158+
- name: tagline
1159+
widget: text
1160+
label: Description
1161+
hint: >
1162+
Description of the page, not visible on the page but will be shown
1163+
in search engines when the page appers in results. Important
1164+
to have good performance in search engines.
1165+
- name: header
1166+
label: Header(title,description,image)
1167+
file: docs-membership/header.yml
1168+
fields:
1169+
- name: title
1170+
widget: string
1171+
hint: >
1172+
The title of the page. Displayed on the page below header.
1173+
- name: id
1174+
widget: string
1175+
label: id
1176+
hint: id of the block. Must match anchor link url

package-lock.json

+9-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
"@babel/core": "^7.12.3",
1414
"@babel/plugin-proposal-class-properties": "^7.12.1",
1515
"@babel/plugin-proposal-decorators": "^7.12.1",
16+
"@babel/plugin-proposal-export-default-from": "^7.12.1",
1617
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5",
18+
"@babel/plugin-transform-runtime": "^7.19.6",
19+
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
1720
"@babel/polyfill": "^7.12.1",
1821
"@babel/preset-env": "^7.12.1",
1922
"@babel/preset-react": "^7.12.5",

templates/documentation/dataset/index.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ const DatasetPageTemplate = ({
100100
key={action.caption}
101101
variant="contained"
102102
href={action.url}
103+
target={action.target}
103104
className={styles.button}
104105
>
105106
{action.caption}

templates/membership/index.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ const MembershipPageTemplate = ({ data }) => (
9292
{data.header.actions.map((action) => (
9393
<Button
9494
href={action.url}
95+
target={action.target}
9596
variant={action.variant}
9697
key={action.caption}
9798
download={action.download}

templates/sponsorships/index.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const SponsorshipPageTemplate = ({ data }) => (
2525
{data.header.actions.map((action) => (
2626
<Button
2727
href={action.url}
28+
target={action.target}
2829
variant={action.variant}
2930
key={action.caption}
3031
download={action.download}

0 commit comments

Comments
 (0)