diff --git a/components/application/activities.js b/components/application/activities.js index af80d31b..01605a97 100644 --- a/components/application/activities.js +++ b/components/application/activities.js @@ -73,6 +73,11 @@ const config = new RouteConfig([ path: 'doi', icon: 'barcode', }, + { + test: /\/orcid/, + path: 'orcid', + icon: 'orcid', + }, { test: /\/usrn/, path: 'usrn', diff --git a/components/statsCard/statsCard.jsx b/components/statsCard/statsCard.jsx new file mode 100644 index 00000000..d783d3f7 --- /dev/null +++ b/components/statsCard/statsCard.jsx @@ -0,0 +1,66 @@ +import React from 'react' +import { Icon } from '@oacore/design/lib/elements' +import { classNames } from '@oacore/design/lib/utils' + +import styles from './styles.module.css' +import { Button } from '../../../design' +import { formatNumber } from '../../utils/helpers' +import Actions from '../actions' + +import { Card } from 'design' + +const StatsCard = ({ + title, + description, + action, + tooltip, + statUrl, + statList, + statLoading, + noticeable, + checkBillingType, +}) => ( + +
+
+ + {title} + + + } + /> +
+
+ + {description} + +
+
+ {statLoading ? ( +
+
+
+ ) : ( +
+ {formatNumber(statList.length)} +
+ )} +
+
+ {!checkBillingType && ( + + )} +
+ +) + +export default StatsCard diff --git a/components/statsCard/styles.module.css b/components/statsCard/styles.module.css new file mode 100644 index 00000000..3501942a --- /dev/null +++ b/components/statsCard/styles.module.css @@ -0,0 +1,67 @@ +.card-wrapper { + width: 100%; +} + +.header-wrapper { + display: flex; + justify-content: space-between; +} + +.card-description { + margin-bottom: unset; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: 16px; + color: #666; + letter-spacing: 0.021px; +} + +.loading-container { + position: relative; + width: 100%; + height: 36px; + margin: 16px 0; + overflow: hidden; + background-color: #f2f2f2; + border-radius: 2px; +} + +.loading-container-outputs { + position: relative; + width: 100%; + height: 36px; + margin: 26px 0; + overflow: hidden; + background-color: #f2f2f2; + border-radius: 2px; +} + +.loading-stroke { + position: absolute; + top: 0; + left: -100%; + width: 100%; + height: 100%; + background-color: #e5e5e5; + animation: loading 5s linear infinite; +} + +.footer-wrapper { + display: flex; + align-items: center; + justify-content: space-between; +} + +.sub-footer { + margin: 28px 0; + font-size: 48px; + font-style: normal; + font-weight: 500; + line-height: 32px; + color: #8bc34a; +} + +.sub-footer-red { + color: #ff5f52; +} diff --git a/package-lock.json b/package-lock.json index 428546e7..31cb9280 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", "@babel/runtime": "^7.20.13", "@mdi/svg": "^5.8.55", - "@oacore/design": "5.0.1", + "@oacore/design": "5.0.19", "@octokit/rest": "^19.0.5", "@sentry/browser": "^5.27.2", "@sentry/node": "^5.29.0", @@ -2615,9 +2615,9 @@ } }, "node_modules/@oacore/design": { - "version": "5.0.1", - "resolved": "https://npm.pkg.github.com/download/@oacore/design/5.0.1/fc74844ace23eed01bd6e5b1c3450aedb0efe8f6", - "integrity": "sha512-bQVRs9rZ/D04IZmrk2rSM+UWKSFHh+kS0kXyC6qwRnfV/nrMtjVR5uNthHS4hCtgUWMya+ceDHysba8tjU+KzA==", + "version": "5.0.19", + "resolved": "https://npm.pkg.github.com/download/@oacore/design/5.0.19/5fee87fb50214a2fe01d13854a6118a171530fc0", + "integrity": "sha512-t4YbIoa4c91OFT6RRaqs6yfrnJ0hxs122R1ula4pZczWQgJMN6XxwtYvEe1VgAhTO+mvwtYlWFrRtkCc8fPTVA==", "hasInstallScript": true, "license": "UNLICENSED", "dependencies": { @@ -20314,9 +20314,9 @@ } }, "@oacore/design": { - "version": "5.0.1", - "resolved": "https://npm.pkg.github.com/download/@oacore/design/5.0.1/fc74844ace23eed01bd6e5b1c3450aedb0efe8f6", - "integrity": "sha512-bQVRs9rZ/D04IZmrk2rSM+UWKSFHh+kS0kXyC6qwRnfV/nrMtjVR5uNthHS4hCtgUWMya+ceDHysba8tjU+KzA==", + "version": "5.0.19", + "resolved": "https://npm.pkg.github.com/download/@oacore/design/5.0.19/5fee87fb50214a2fe01d13854a6118a171530fc0", + "integrity": "sha512-t4YbIoa4c91OFT6RRaqs6yfrnJ0hxs122R1ula4pZczWQgJMN6XxwtYvEe1VgAhTO+mvwtYlWFrRtkCc8fPTVA==", "requires": { "@babel/runtime": "^7.12.1", "@mdi/svg": "^5.8.55", diff --git a/package.json b/package.json index 5ad4d7d0..7390fca9 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", "@babel/runtime": "^7.20.13", "@mdi/svg": "^5.8.55", - "@oacore/design": "5.0.1", + "@oacore/design": "5.0.19", "@octokit/rest": "^19.0.5", "@sentry/browser": "^5.27.2", "@sentry/node": "^5.29.0", diff --git a/pages/data-providers/[data-provider-id]/orcid.jsx b/pages/data-providers/[data-provider-id]/orcid.jsx new file mode 100644 index 00000000..3d84cb4b --- /dev/null +++ b/pages/data-providers/[data-provider-id]/orcid.jsx @@ -0,0 +1,9 @@ +import React from 'react' + +import OrcidPageTemplate from '../../../templates/orcid' + +import { withGlobalStore } from 'store' + +const OrcidPage = ({ store, ...props }) => + +export default withGlobalStore(OrcidPage) diff --git a/store/activities.js b/store/activities.js index cc69a465..ac9a083d 100644 --- a/store/activities.js +++ b/store/activities.js @@ -39,6 +39,11 @@ const config = [ path: 'doi', icon: 'barcode', }, + { + id: 'orcid', + path: 'orcid', + icon: 'orcid', + }, { id: 'plugins', path: 'plugins', diff --git a/templates/orcid/index.jsx b/templates/orcid/index.jsx new file mode 100644 index 00000000..3a391f06 --- /dev/null +++ b/templates/orcid/index.jsx @@ -0,0 +1,63 @@ +import React, { useState } from 'react' +import { classNames } from '@oacore/design/lib/utils' +import { observer } from 'mobx-react-lite' + +import styles from './styles.module.css' +import texts from '../../texts/orcid/orcid.yml' +import ShowMoreText from '../../components/showMore' +import DashboardHeader from '../../components/dashboard-header' +import StatsCard from '../../components/statsCard/statsCard' + +import orcid from 'texts/orcid' + +const OrcidPageTemplate = observer( + ({ tag: Tag = 'main', className, ...restProps }) => { + const [showMore, setShowMore] = useState(false) + + const toggleShowMore = () => { + setShowMore(!showMore) + } + + const statsCardsArray = Object.values(orcid.statsCards) + + return ( + + + } + /> +
+
+ {statsCardsArray.map((card) => ( + + ))} +
+
+
+ ) + } +) +export default OrcidPageTemplate diff --git a/templates/orcid/styles.module.css b/templates/orcid/styles.module.css new file mode 100644 index 00000000..9d21be9d --- /dev/null +++ b/templates/orcid/styles.module.css @@ -0,0 +1,14 @@ +.main { + padding-top: var(--component-padding-y, 1rem); +} + +.main-wrapper { + margin: 0 var(--component-spacer-x, 1rem) var(--component-spacer-y, 1.5rem); +} + +.cards-wrapper { + display: flex; + justify-content: space-between; + width: 100%; + gap: 30px; +} diff --git a/texts/navigation.yml b/texts/navigation.yml index 5c044980..ce1f362f 100644 --- a/texts/navigation.yml +++ b/texts/navigation.yml @@ -10,6 +10,7 @@ items: deposit-compliance: OA compliance rights-retention-strategy: RRS Policy doi: DOI + orcid: ORCID plugins: Plugins usrn: USRN fair: FAIR diff --git a/texts/orcid/index.js b/texts/orcid/index.js new file mode 100644 index 00000000..31ba34c6 --- /dev/null +++ b/texts/orcid/index.js @@ -0,0 +1,23 @@ +import orcid from './orcid.yml' +import sourceMessages from '../issues/messages.yml' + +const messages = {} + +Object.values(sourceMessages).forEach((msg) => { + messages[msg.type] = msg + Object.values(msg.matches ?? {}).forEach((type) => { + messages[type] = msg + }) +}) + +const articleTemplate = Object.keys(orcid.article).reduce( + (a, key) => Object.assign(a, { [key]: Object.values(orcid.article[key]) }), + {} +) + +export default { + ...orcid, + actions: Object.values(orcid.actions), + article: articleTemplate, + messages, +} diff --git a/texts/orcid/orcid.yml b/texts/orcid/orcid.yml new file mode 100644 index 00000000..8fb41fe6 --- /dev/null +++ b/texts/orcid/orcid.yml @@ -0,0 +1,125 @@ +title: Open Researcher and Contributor IDentifier (ORCID) + +description: The ORCID is a nonproprietary alphanumeric code to uniquely identify authors and contributors of scholarly communication as well as ORCID's website and services to look up authors and their bibliographic output. + +statsCards: + - title: Papers with an ORCID + description: within your repository collection + action: Review + tooltip: "" + - title: Papers without an ORCID + description: within your repository collection + action: Review + tooltip: Number of authors at your institution with an ORCID. + noticeable: true + - title: Unique ORCIDs + description: number of authors at your institution with an ORCID + action: Review + tooltip: Number of outputs without an ORCID within the repository collection. + - title: ORCIDs found in other repositories + description: "" + action: Review + tooltip: CORE has discovered more ORCIDs which are not listed in the repository. + +# UPDATEEE +upload: + default: + subTitle: Drag and drop your file here or + action: + title: upload + success: + title: RRS found + action: + title: Upload new file + fail: + title: RRS wasn’t found + description: RRS statement not found in this paper. + action: + title: Upload new file + noSupport: + title: This format is not supported + sizeTitle: File is too big + action: Upload new file + subInfo: + format: | + Supported formats: pdf, doc + size: | + Maximum size: 10MB + + + +table: + title: Outputs with RRS statements found in your repository + subTitle: In the list below you can review and approve all detected RRS statements. + + +helpInfo: + actionBtn: Hide description + description: | + The below list contains the list of papers in your repository for which CORE has automatically detected the presence of RRS statements. We recommend that you review the automatically extracted RRS statements to check if they are correct. You will be then able to download a .csv file which contains these reviewed RRS statements, for instance for the purposes of importing this information into your repository. The RRS identification runs on your full texts, CORE cannot detect RRS statements from papers CORE doesn’t have access to. + + * “**Review RRS**”: click on the Review RRS link. A pop-up will show up displaying the automatically extracted RRS statement. Review it and click on correct or wrong. + + * “**Status**”: this indicates whether the RRS statement has been reviewed and found correct or wrong. RRS statements that have not been reviewed will be indicated by a question mark. + show: Show description + hide: Hide description + +statusActions: + - title: Deny + button: WRONG + key: 1 + - title: Accept + button: Correct + key: 2 + +actions: + - title: Open in CORE + key: coreUrl + - title: Open in the repository + key: outputUrl + +article: + fields: + - name: Author + key: authors + findBy: name + - name: Type + key: documentType + - name: Publication Date + key: publishedDate + - name: Deposited date + key: depositedDate + - name: DOI + key: doi + - name: OAI + key: oai + - name: Abstract + key: abstract + actions: + - title: Open in CORE + key: coreUrl + generatedUrl: https://core.ac.uk/outputs/{{id}} + - title: Open in the repository + key: outputUrl + visibility: + - title: Live in core + disabled: false + icon: eye + extraText: Click to disable + - title: Taken down + disabled: true + icon: eye-off + extraText: Click to enable + +statusModal: + title: Rights retention statements + link: Open full text in the CORE reader + buttonsY: + title: Correct + buttonsN: + title: WRONG + actions: + - title: Accept + key: 1 + - title: Deny + key: 0