+}) => {
+ const router = useRouter()
+
+ const uploadText = router.pathname.includes('sdg')
+ ? text.upload.sdgFail
+ : text.upload.fail
+
+ const defaultText = router.pathname.includes('sdg')
+ ? text.upload.sdgDefault
+ : text.upload.default
+
+ return (
+
+
+
+ {!rrsPdfLoading ? (
+ <>
+
+
{uploadText.title}
+ >
+ ) : (
+
{defaultText.title}
+ )}
-
{fileName}
- ) : (
-
-
- {text.upload.fail.description}
-
-
+ {rrsPdfLoading ? (
+
+ ) : (
+
+
+ {uploadText.description}
+
+
+
+ )}
+
+
- )}
-
-
-
-)
+ )
+}
export default UploadFail
diff --git a/data/retention.yml b/data/retention.yml
index 7be70e49..b410a6f2 100644
--- a/data/retention.yml
+++ b/data/retention.yml
@@ -33,6 +33,23 @@ upload:
Maximum size: 10MB
+ sdgSuccess:
+ title: SDG labels found
+ description: "Found SDG labels:"
+ image: /images/success.svg
+ action:
+ title: Upload new file
+ sdgFail:
+ title: SDG labels not found
+ description: SDG labels not found in this paper.
+ image: /images/fail.svg
+ action:
+ title: Upload new file
+ sdgDefault:
+ title: Identify SDG in your paper
+ subTitle: Drag and drop your file here
+ action:
+ title: Browse files
purpose:
title: Why it’s important
image: /images/services/work.svg
diff --git a/data/sdg.yml b/data/sdg.yml
new file mode 100644
index 00000000..f84a819e
--- /dev/null
+++ b/data/sdg.yml
@@ -0,0 +1,43 @@
+header:
+ title: Classification of research papers according to United Nations Sustainable Development Goals
+ image: /images/services/goals.svg
+ description: The Sustainable Development Goals or Global Goals are a collection of 17 interlinked global goals designed to be a "blueprint to achieve a better and more sustainable future for all". The SDGs were set up in 2015 by the United Nations General Assembly and are intended to be achieved by 2030.
+ subTitle: CORE labs
+
+upload:
+ default:
+ title: Identify SDG in your paper
+ subTitle: Drag and drop your file here
+ action:
+ title: Browse files
+ success:
+ title: SDG labels found
+ description: "Found SDG labels:"
+ image: /images/success.svg
+ action:
+ title: Upload new file
+ fail:
+ title: SDG labels not found
+ description: SDG labels not found in this paper.
+ image: /images/fail.svg
+ action:
+ title: Upload new file
+ noSupport:
+ title: This format is not supported
+ sizeTitle: File is too big
+ image: /images/fail.svg
+ action: Upload new file
+ subInfo:
+ format: |
+ Supported formats: pdf, doc
+ size: |
+ Maximum size: 10MB
+
+
+purpose:
+ title: How it work
+ image: /images/services/openUniversity.svg
+ description: |
+ The new CORE SDG Dashboard module allows institutions to gain rapid insights into the current mapping of their research outputs to the 17 UN SDG goals, significantly reducing the manual effort required to map research outputs to global sustainability objectives.
+
+ On the video below you can see how SDG insights tab in the CORE dashboard works (using the example of Open Research Online Repository (Open University).
diff --git a/env.config.js b/env.config.js
index eeaea989..ba39ddbc 100644
--- a/env.config.js
+++ b/env.config.js
@@ -5,7 +5,7 @@ const local = {
}
const development = {
- API_URL: 'https://api-dev.core.ac.uk/internal',
+ API_URL: 'https://api.core.ac.uk/internal',
}
const production = {
diff --git a/pages/labs/sdg.jsx b/pages/labs/sdg.jsx
new file mode 100644
index 00000000..4cfd8ee0
--- /dev/null
+++ b/pages/labs/sdg.jsx
@@ -0,0 +1,13 @@
+import React from 'react'
+
+import textData from '../../data/sdg.yml'
+import { Page } from '../../components'
+import SdgPageTemplate from '../../templates/sdg'
+
+const SdgPage = () => (
+
+
+
+)
+
+export default SdgPage
diff --git a/public/images/icons/allSdg.svg b/public/images/icons/allSdg.svg
new file mode 100644
index 00000000..eea128fe
--- /dev/null
+++ b/public/images/icons/allSdg.svg
@@ -0,0 +1,21 @@
+
diff --git a/public/images/icons/belowWater.svg b/public/images/icons/belowWater.svg
new file mode 100644
index 00000000..a1d7fc7d
--- /dev/null
+++ b/public/images/icons/belowWater.svg
@@ -0,0 +1,29 @@
+
diff --git a/public/images/icons/climate.svg b/public/images/icons/climate.svg
new file mode 100644
index 00000000..d31a7443
--- /dev/null
+++ b/public/images/icons/climate.svg
@@ -0,0 +1,26 @@
+
diff --git a/public/images/icons/communities.svg b/public/images/icons/communities.svg
new file mode 100644
index 00000000..09f24aa2
--- /dev/null
+++ b/public/images/icons/communities.svg
@@ -0,0 +1,49 @@
+
diff --git a/public/images/icons/economic.svg b/public/images/icons/economic.svg
new file mode 100644
index 00000000..6d92793a
--- /dev/null
+++ b/public/images/icons/economic.svg
@@ -0,0 +1,42 @@
+
diff --git a/public/images/icons/education.svg b/public/images/icons/education.svg
new file mode 100644
index 00000000..fa007d3a
--- /dev/null
+++ b/public/images/icons/education.svg
@@ -0,0 +1,32 @@
+
diff --git a/public/images/icons/energy.svg b/public/images/icons/energy.svg
new file mode 100644
index 00000000..19fb1179
--- /dev/null
+++ b/public/images/icons/energy.svg
@@ -0,0 +1,48 @@
+
diff --git a/public/images/icons/genderEquality.svg b/public/images/icons/genderEquality.svg
new file mode 100644
index 00000000..9e324b34
--- /dev/null
+++ b/public/images/icons/genderEquality.svg
@@ -0,0 +1,28 @@
+
diff --git a/public/images/icons/goal.svg b/public/images/icons/goal.svg
new file mode 100644
index 00000000..816e9034
--- /dev/null
+++ b/public/images/icons/goal.svg
@@ -0,0 +1,36 @@
+
diff --git a/public/images/icons/health.svg b/public/images/icons/health.svg
new file mode 100644
index 00000000..dfd32516
--- /dev/null
+++ b/public/images/icons/health.svg
@@ -0,0 +1,36 @@
+
diff --git a/public/images/icons/hunger.svg b/public/images/icons/hunger.svg
new file mode 100644
index 00000000..3debd8d3
--- /dev/null
+++ b/public/images/icons/hunger.svg
@@ -0,0 +1,25 @@
+
diff --git a/public/images/icons/inequalitie.svg b/public/images/icons/inequalitie.svg
new file mode 100644
index 00000000..197adf5c
--- /dev/null
+++ b/public/images/icons/inequalitie.svg
@@ -0,0 +1,37 @@
+
diff --git a/public/images/icons/infrastructure.svg b/public/images/icons/infrastructure.svg
new file mode 100644
index 00000000..8f7ce285
--- /dev/null
+++ b/public/images/icons/infrastructure.svg
@@ -0,0 +1,48 @@
+
diff --git a/public/images/icons/land.svg b/public/images/icons/land.svg
new file mode 100644
index 00000000..74f014cb
--- /dev/null
+++ b/public/images/icons/land.svg
@@ -0,0 +1,29 @@
+
diff --git a/public/images/icons/peace.svg b/public/images/icons/peace.svg
new file mode 100644
index 00000000..1a0b3e9b
--- /dev/null
+++ b/public/images/icons/peace.svg
@@ -0,0 +1,56 @@
+
diff --git a/public/images/icons/poverty.svg b/public/images/icons/poverty.svg
new file mode 100644
index 00000000..4c470cc6
--- /dev/null
+++ b/public/images/icons/poverty.svg
@@ -0,0 +1,32 @@
+
diff --git a/public/images/icons/production.svg b/public/images/icons/production.svg
new file mode 100644
index 00000000..661cf3a8
--- /dev/null
+++ b/public/images/icons/production.svg
@@ -0,0 +1,48 @@
+
diff --git a/public/images/icons/water.svg b/public/images/icons/water.svg
new file mode 100644
index 00000000..3664b501
--- /dev/null
+++ b/public/images/icons/water.svg
@@ -0,0 +1,35 @@
+
diff --git a/public/images/services/goals.svg b/public/images/services/goals.svg
new file mode 100644
index 00000000..2aebbefb
--- /dev/null
+++ b/public/images/services/goals.svg
@@ -0,0 +1,47 @@
+
diff --git a/public/images/services/openUniversity.svg b/public/images/services/openUniversity.svg
new file mode 100644
index 00000000..451a09d3
--- /dev/null
+++ b/public/images/services/openUniversity.svg
@@ -0,0 +1,30 @@
+
diff --git a/templates/rights-retention/index.jsx b/templates/rights-retention/index.jsx
index 5a43ae4e..5c306a1a 100644
--- a/templates/rights-retention/index.jsx
+++ b/templates/rights-retention/index.jsx
@@ -9,7 +9,7 @@ import FileUpload from '../../components/pdf-upload'
const RightsRetentionPageTemplate = ({ data }) => {
const [uloadResult, setUploadResult] = useState('')
const [rrsPdfLoading, setRrsPdfLoading] = useState(false)
- const uploadPdf = async (file, dataProviderId) => {
+ const uploadPdf = async (file) => {
setRrsPdfLoading(true)
try {
const url = new URL(
@@ -18,7 +18,6 @@ const RightsRetentionPageTemplate = ({ data }) => {
)
const fd = new FormData()
fd.set('file', file)
- fd.set('dataProviderId', dataProviderId)
const response = await fetch(url, {
method: 'POST',
diff --git a/templates/sdg/index.jsx b/templates/sdg/index.jsx
new file mode 100644
index 00000000..b11a79fc
--- /dev/null
+++ b/templates/sdg/index.jsx
@@ -0,0 +1,202 @@
+import React, { useState } from 'react'
+
+import { Layout, Section } from '../../design-v2/components'
+import styles from './styles.module.scss'
+import { Markdown, Video } from '../../components'
+import FileUpload from '../../components/pdf-upload'
+import all from '../../public/images/icons/allSdg.svg'
+import poverty from '../../public/images/icons/poverty.svg'
+import hunger from '../../public/images/icons/hunger.svg'
+import health from '../../public/images/icons/health.svg'
+import education from '../../public/images/icons/education.svg'
+import water from '../../public/images/icons/water.svg'
+import energy from '../../public/images/icons/energy.svg'
+import economy from '../../public/images/icons/economic.svg'
+import infrastructure from '../../public/images/icons/infrastructure.svg'
+import inequality from '../../public/images/icons/inequalitie.svg'
+import communities from '../../public/images/icons/communities.svg'
+import climate from '../../public/images/icons/climate.svg'
+import underWater from '../../public/images/icons/belowWater.svg'
+import peace from '../../public/images/icons/peace.svg'
+import goal from '../../public/images/icons/goal.svg'
+import equal from '../../public/images/icons/genderEquality.svg'
+import land from '../../public/images/icons/land.svg'
+import production from '../../public/images/icons/production.svg'
+
+const sdgTypes = [
+ {
+ id: 'all',
+ title: 'All',
+ icon: all,
+ color: '#B75400',
+ },
+ {
+ id: 'SDG01',
+ title: 'No Poverty',
+ icon: poverty,
+ color: '#E5243B',
+ },
+ {
+ id: 'SDG02',
+ title: 'Zero Hunger',
+ icon: hunger,
+ color: '#DDA63A',
+ },
+ {
+ id: 'SDG03',
+ title: 'Good Health and Well-being',
+ icon: health,
+ color: '#4C9F38',
+ },
+ {
+ id: 'SDG04',
+ title: 'Quality Education',
+ icon: education,
+ color: '#C5192D',
+ },
+ {
+ id: 'SDG05',
+ title: 'Gender Equality',
+ icon: equal,
+ color: '#FF3A21',
+ },
+ {
+ id: 'SDG06',
+ title: 'Clean Water and Sanitation',
+ icon: water,
+ color: '#26BDE2',
+ },
+ {
+ id: 'SDG07',
+ title: 'Affordable and Clean Energy',
+ icon: energy,
+ color: '#FCC30B',
+ },
+ {
+ id: 'SDG08',
+ title: 'Decent Work and Economic Growth',
+ icon: economy,
+ color: '#A21942',
+ },
+ {
+ id: 'SDG09',
+ title: 'Industry, Innovation and Infrastructure',
+ icon: infrastructure,
+ color: '#FD6925',
+ },
+ {
+ id: 'SDG10',
+ title: 'Reduced Inequality',
+ icon: inequality,
+ color: '#DD1367',
+ },
+ {
+ id: 'SDG11',
+ title: 'Sustainable Cities and Communities',
+ icon: communities,
+ color: '#FD9D24',
+ },
+ {
+ id: 'SDG12',
+ title: 'Responsible Consumption and Production',
+ icon: production,
+ color: '#BF8B2E',
+ },
+ {
+ id: 'SDG13',
+ title: 'Climate Action',
+ icon: climate,
+ color: '#3F7E44',
+ },
+ {
+ id: 'SDG14',
+ title: 'Life Below Water',
+ icon: underWater,
+ color: '#0A97D9',
+ },
+ {
+ id: 'SDG15',
+ title: 'Life on Land',
+ icon: land,
+ color: '#56C02B',
+ },
+ {
+ id: 'SDG16',
+ title: 'Peace, Justice and Strong Institutions',
+ icon: peace,
+ color: '#00689D',
+ },
+ {
+ id: 'SDG17',
+ title: 'Partnerships for the Goals',
+ icon: goal,
+ color: '#19486A',
+ },
+]
+
+const SdgPageTemplate = ({ data }) => {
+ const [uloadResult, setUploadResult] = useState('')
+ const [rrsPdfLoading, setRrsPdfLoading] = useState(false)
+ const uploadPdf = async (file) => {
+ setRrsPdfLoading(true)
+ try {
+ const url = new URL('/internal/sdg-upload-file', process.env.API_URL)
+ const fd = new FormData()
+ fd.set('file', file)
+
+ const response = await fetch(url, {
+ method: 'POST',
+ credentials: 'same-origin',
+ body: fd,
+ })
+
+ if (!response.ok) throw new Error('Network response was not ok')
+
+ const result = await response.json()
+ setUploadResult(result)
+ } catch (error) {
+ console.error(error)
+ } finally {
+ setRrsPdfLoading(false)
+ }
+ }
+
+ return (
+
+
+
+
+
+
+
+
+ {data.purpose?.title}
+ {data.purpose?.description}
+
+
+
+
+ )
+}
+
+export default SdgPageTemplate
diff --git a/templates/sdg/styles.module.scss b/templates/sdg/styles.module.scss
new file mode 100644
index 00000000..efd3983d
--- /dev/null
+++ b/templates/sdg/styles.module.scss
@@ -0,0 +1,58 @@
+$grid-responsive-for-sections: repeat(auto-fit, minmax(300px, 1fr));
+
+.header {
+ display: flex;
+ justify-content: space-between;
+ gap: 20px;
+ .card-wrapper {
+ width: 70%;
+ }
+ .img-wrapper {
+ width: 400px;
+ img {
+ width: 100%;
+ height: 100%;
+ }
+ }
+ .description {
+ max-width: 70ch;
+ font-size: 1.3rem;
+ color: var(--gray-700);
+ margin-bottom: 3rem;
+ }
+ .title {
+ position: relative;
+ max-width: 25ch;
+ margin-top: 9px;
+ }
+ @media (max-width: 992px) {
+ flex-wrap: wrap-reverse;
+ justify-content: center;
+ }
+}
+
+.demo {
+ border-radius: 2px;
+ background: #8bc34a;
+ padding: 3px 7px;
+ color: #fff;
+ font-size: 16px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: 24px;
+ letter-spacing: 0.026px;
+}
+
+.how-it-works {
+ display: grid;
+ grid-template-columns: $grid-responsive-for-sections;
+ align-items: center;
+
+ .content {
+ .button {
+ float: right;
+ margin-top: 2rem;
+ margin-right: 10px;
+ }
+ }
+}