Skip to content
Snippets Groups Projects
Commit ea9d47ed authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

Merge branch 'hindawi-theme' of gitlab.coko.foundation:xpub/xpub-faraday into hindawi-theme

parents d5ed1e16 2da42f6b
No related branches found
No related tags found
1 merge request!43Sprint #19
...@@ -27,7 +27,14 @@ const LinkOrcid = app => { ...@@ -27,7 +27,14 @@ const LinkOrcid = app => {
clientSecret, clientSecret,
}, },
(accessToken, refreshToken, params, profile, done) => { (accessToken, refreshToken, params, profile, done) => {
profile = { orcid: params.orcid, name: params.name } profile = {
orcid: params.orcid,
name: params.name,
accessToken,
refreshToken,
scope: params.scope,
expiry: params.expires_in,
}
return done(null, profile) return done(null, profile)
}, },
), ),
...@@ -53,7 +60,7 @@ const LinkOrcid = app => { ...@@ -53,7 +60,7 @@ const LinkOrcid = app => {
const linkOrcidHandler = models => async (req, res) => { const linkOrcidHandler = models => async (req, res) => {
const user = await models.User.find(userId) const user = await models.User.find(userId)
user.orcid = req.user.orcid user.orcid = req.user
await user.save() await user.save()
res.redirect(successPath) res.redirect(successPath)
} }
......
...@@ -37,7 +37,7 @@ const ReviewerInviteDecision = ({ ...@@ -37,7 +37,7 @@ const ReviewerInviteDecision = ({
reviewerEmail, reviewerEmail,
}) => ( }) => (
<RootContainer bordered> <RootContainer bordered>
<Title>Hindawi Invitation</Title> <Title>Reviewer Invitation</Title>
<Subtitle>{agree === 'true' ? agreeText : declineText}</Subtitle> <Subtitle>{agree === 'true' ? agreeText : declineText}</Subtitle>
<Email>{reviewerEmail}</Email> <Email>{reviewerEmail}</Email>
{agree === 'true' && ( {agree === 'true' && (
......
...@@ -105,9 +105,13 @@ const Step0 = ({ journal, handleSubmit, initialValues, error }) => ...@@ -105,9 +105,13 @@ const Step0 = ({ journal, handleSubmit, initialValues, error }) =>
<Row> <Row>
<Text secondary small> <Text secondary small>
This account information will be processed by us in accordance with This account information will be processed by us in accordance with
our Privacy Policy for the purpose of registering your Faraday account our Privacy Policy for the purpose of registering your account and
and allowing you to use the services available via the Faraday allowing you to use the services available via the platform. Please
platform. Please read our Privacy Policy for further information. read our{' '}
<ActionLink to="https://www.hindawi.com/privacy/">
Privacy Policy{' '}
</ActionLink>{' '}
for further information.
</Text> </Text>
</Row> </Row>
......
import React from 'react' import React from 'react'
import { get } from 'lodash'
import styled from 'styled-components' import styled from 'styled-components'
import { th } from '@pubsweet/ui-toolkit' import { th } from '@pubsweet/ui-toolkit'
...@@ -14,24 +15,50 @@ import { ...@@ -14,24 +15,50 @@ import {
withFetching, withFetching,
} from 'pubsweet-component-faraday-ui' } from 'pubsweet-component-faraday-ui'
const OrcidTooltip = () => ( const ORCIDLinkTooltip = () => (
<Text secondary> <Text secondary>
ORCID provides a persistent identifier an ORCID iD that distinguishes Hindawi is collecting your ORCID iD so we can ensure your work is
you from other researchers and a mechanism for linking your research outputs recognised. When you click the Authorize button, we will ask you to share
and activities to your iD. Learn more at{' '} your iD using an authenticated process: either by{' '}
<ActionLink to="https://orcid.org/help">orcid.org</ActionLink> <ActionLink to="https://support.orcid.org/knowledgebase/topics/141838">
{' '}
registering for an ORCID iD{' '}
</ActionLink>{' '}
or, if you already have one, to{' '}
<ActionLink to="https://support.orcid.org/knowledgebase/topics/141838">
sign into your ORCID account{' '}
</ActionLink>, then granting us permission to get your ORCID iD. We do this
to ensure that you are correctly identified and securely connecting your
ORCID iD.
</Text> </Text>
) )
const LinkOrcID = ({ orcid = '', unlinkOrcid, id, ...rest }) => ( const ORCIDDisplayTooltip = () => (
<Text secondary>
To acknowledge that you have used your iD and that it has been
authenticated, we display the ORCID iD icon alongside your name on our
website/in our publications/in our database etc. Learn more in{' '}
<ActionLink to="https://orcid.org/blog/2013/02/22/how-should-orcid-id-be-displayed">
{' '}
How should an ORCID iD be displayed
</ActionLink>.
</Text>
)
const LinkOrcID = ({ orcid = {}, unlinkOrcid, id, ...rest }) => (
<ShadowedBox mt={2}> <ShadowedBox mt={2}>
<Row alignItems="center"> <Row alignItems="center">
<Item alignItems="center"> <Item alignItems="center">
<Label>ORCiD Account </Label> <Label>ORCID iD </Label>
<IconTooltip content={OrcidTooltip} iconSize={2} interactive primary /> <IconTooltip
content={get(orcid, 'orcid') ? ORCIDDisplayTooltip : ORCIDLinkTooltip}
iconSize={2}
interactive
primary
/>
</Item> </Item>
<Item justify="flex-end"> <Item justify="flex-end">
{orcid ? ( {orcid.orcid ? (
<OpenModal <OpenModal
confirmText="Unlink" confirmText="Unlink"
onConfirm={unlinkOrcid} onConfirm={unlinkOrcid}
...@@ -47,16 +74,22 @@ const LinkOrcID = ({ orcid = '', unlinkOrcid, id, ...rest }) => ( ...@@ -47,16 +74,22 @@ const LinkOrcID = ({ orcid = '', unlinkOrcid, id, ...rest }) => (
</Item> </Item>
</Row> </Row>
{orcid && ( {orcid.orcid && (
<Row> <Row>
<Item> <Item>
<Text> <Text>
<Img <a
alt="orcid_logo" href="https://orcid.org"
src="https://orcid.org/sites/default/files/images/orcid_16x16.png" rel="noopener noreferrer"
/> target="_blank"
<ActionLink to={`https://orcid.org/${orcid}`}> >
{`https://orcid.org/${orcid}`} <Img
alt="ORCID Logo"
src="https://orcid.org/sites/default/files/images/orcid_16x16.png"
/>
</a>
<ActionLink to={`https://orcid.org/${orcid.orcid}`}>
{`https://orcid.org/${orcid.orcid}`}
</ActionLink> </ActionLink>
</Text> </Text>
</Item> </Item>
......
...@@ -85,7 +85,7 @@ export default compose( ...@@ -85,7 +85,7 @@ export default compose(
}) => { }) => {
setFetching(true) setFetching(true)
setModalError('') setModalError('')
saveUserDetails(user.id, { orcid: '' }) saveUserDetails(user.id, { orcid: {} })
.then(() => { .then(() => {
setFetching(false) setFetching(false)
hideModal() hideModal()
......
...@@ -130,7 +130,7 @@ module.exports = { ...@@ -130,7 +130,7 @@ module.exports = {
}, },
], ],
user: { user: {
orcid: Joi.string().allow(''), orcid: Joi.object(),
name: Joi.string(), name: Joi.string(),
username: Joi.string(), username: Joi.string(),
isConfirmed: Joi.boolean(), isConfirmed: Joi.boolean(),
......
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