Commit 7c73735b authored by Audrey Hamelers's avatar Audrey Hamelers

Merge branch 'dev' into 'master'

Dev

Closes #852

See merge request !182
parents 7a03a230 a7403d92
Pipeline #12873 passed with stages
in 48 seconds
......@@ -198,7 +198,7 @@ class MetaSec extends React.Component {
<DL>
<dt>Claimed:</dt>
<dd>
Helpdesk
{claiming.givenNames}
{currentUser.id === claiming.id && (
<Action
onClick={async () =>
......
......@@ -89,6 +89,10 @@ class Metrics extends React.Component {
prop: 'external_qa',
text: 'External QA',
},
{
prop: 'xml_tagging',
text: 'Manuscripts tagged',
},
]
const nextShow = show === INIT_SHOW ? allMetrics.length : INIT_SHOW
......
......@@ -161,6 +161,7 @@ export const METRICS = gql`
published
ncbi_ready_median
external_qa
xml_tagging
}
}
`
import { compose } from 'recompose'
import config from 'config'
import { withFormik } from 'formik'
import { graphql } from 'react-apollo'
import createHistory from 'history/createBrowserHistory'
......@@ -7,6 +8,18 @@ import mutations from './mutations'
import redirectPath from './redirect'
import userHelper from '../helpers/userHelper'
const handleSSO = (search, jwt) => {
if (search && search.includes('?auth_client=')) {
const domain = search.split(/=(.+)/)[1]
const europepmcDomains = config['pubsweet-client']['europepmc-domains']
if (europepmcDomains.includes(domain)) {
window.location = `https://${domain}/accounts/plus_verify?token=${jwt}`
return true
}
}
return false
}
const handleSubmit = (values, { props, setSubmitting, setErrors }) =>
props
.epmc_signinUser({ variables: { input: values } })
......@@ -14,6 +27,9 @@ const handleSubmit = (values, { props, setSubmitting, setErrors }) =>
if (!errors) {
userHelper.setToken(data.epmc_signinUser.token)
const { search } = props.location
if (handleSSO(search, data.epmc_signinUser.token)) {
return
}
let path = ''
if (search && search.includes('?next=')) {
path = search.split(/=(.+)/)[1]
......
......@@ -45,7 +45,7 @@ const CreateInfo = ({ currentStep }) => (
<H3>What file formats can I use?</H3>
<p>
{`For the manuscript text, only Microsoft Word or PDF files can be used. For figures, tables, and supplementary files, check `}
<Link to="/user-guide/allowedfiles">
<Link target="_blank" to="/user-guide/allowedfiles">
our list of acceptable file types
</Link>
.
......@@ -69,7 +69,11 @@ const CreateInfo = ({ currentStep }) => (
{`The embargo period lets us know the delay from the time the manuscript is published in the journal until it can be published in Europe PMC. The embargo periods listed are those allowed by your funder. `}
</p>
<p>
{`If you’re not sure which embargo period to choose, or if there is a conflict between the period required by your journal and those allowed by your funder, please contact the Helpdesk.`}
{`If you’re not sure which embargo period to choose, check your funder's requirements with the `}
<A href="http://sherpa.ac.uk/fact/" target="_blank">
SHERPA/FACT tool
</A>
{`, or if there is a conflict between the period required by your journal and those allowed by your funder, please contact the Helpdesk.`}
</p>
</div>
)}
......
......@@ -261,7 +261,10 @@ class Submit extends React.Component {
onClick={() =>
this.setState({
editing: sec.edit,
currentStep: i,
currentStep:
(sections.length === 4 && i) ||
(i < 2 && i) ||
i - 1,
})
}
style={{
......
......@@ -175,25 +175,24 @@ const submitSections = (
title: 'Funding',
content: (
<div>
{fundingGroup && fundingGroup.length > 0 && (
<p>
<B>Grants: </B>
{fundingGroup.map((f, t) => (
{fundingGroup &&
fundingGroup.length > 0 &&
fundingGroup.map((f, t) => (
<span key={f.awardId}>
{`${f.fundingSource} ${f.awardId}`}
{t !== fundingGroup.length - 1 && ', '}
</span>
))}
</p>
)}
{(releaseDelay || typeof releaseDelay === 'number') && (
<p>
<B>Embargo: </B>
{`${releaseDelay} month${
{(releaseDelay || typeof releaseDelay === 'number') &&
`${releaseDelay} month${
parseInt(releaseDelay, 10) === 1 ? '' : 's'
}`}
</p>
)}
</div>
),
edit: (
......@@ -206,7 +205,7 @@ const submitSections = (
),
error:
(currentUser.admin ||
(selectedReviewer.id && submitter.user.id === selectedReviewer.id)) &&
(selectedReviewer.id && currentUser.id === selectedReviewer.id)) &&
(!fundingGroup || fundingGroup.length === 0 || !releaseDelay) ? (
<ErrorMessage>
<Icon color="currentColor" size={2}>
......
......@@ -163,6 +163,13 @@ module.exports = {
},
appName: 'Europe PMC plus',
},
'europepmc-domains': [
'europepmc.org',
'test.europepmc.org',
'beta.europepmc.org',
'dev.europepmc.org',
'staging.europepmc.org',
],
},
'epmc-email': {
url: process.env.PUBSWEET_EMAIL_URL || 'http://localhost:3000/',
......
{
"name": "xpub-epmc",
"version": "1.3.2",
"version": "1.3.3",
"private": true,
"description": "xpub configured for Europe PMC Plus manuscript submission system",
"license": "MIT",
......
......@@ -133,10 +133,12 @@ function getFiles(tmpPath, manuscript) {
function createManifest(tmpPath, manuscript) {
const articleIds = manuscript['meta,articleIds']
const pmcId = articleIds.find(id => id.pubIdType === 'pmcid')
const pmcId =
articleIds && articleIds.find(id => id.pubIdType === 'pmcid')
? articleIds.find(id => id.pubIdType === 'pmcid').id.substring(3)
: 0
const pmId = articleIds.find(id => id.pubIdType === 'pmid')
const pmId =
articleIds && articleIds.find(id => id.pubIdType === 'pmid')
? articleIds.find(id => id.pubIdType === 'pmid').id
: 0
const createdDate = moment(manuscript.created).format('YYYY-MM-DD')
......
......@@ -1777,18 +1777,6 @@
<xsl:variable name="id">
<xsl:value-of select="@id"/>
</xsl:variable>
<xsl:variable name="graphic-type">
<xsl:choose>
<xsl:when test="substring-after(child::graphic/@xlink:href, '.') = 'gif'">
<xsl:value-of select="'animation'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'graphic'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="filename" select="substring-before(concat(child::graphic/@xlink:href, '.'), '.')"/>
<xsl:variable name="graphics" select="substring-before(substring-after($filelist, concat($filename,':')), ';')"/>
<div id="{$id}" class="fig-inline-img-set">
<div class="elife-fig-image-caption-wrapper">
<div>
......@@ -1798,12 +1786,13 @@
<xsl:text> even</xsl:text>
</xsl:if>
</xsl:attribute>
<!--<div class="fig-inline-img">
<img data-img="[graphic-{$filename}-small]" src="{concat($graphics, '-500.jpg')}" class="figure-expand" alt="{$caption}"/>
</div>-->
<xsl:for-each select="child::graphic">
<xsl:variable name="filename" select="substring-before(concat(@xlink:href, '.'), '.')"/>
<xsl:variable name="graphics" select="substring-before(substring-after($filelist, concat($filename,':')), ';')"/>
<a href="{$graphics}" target="_blank" class="figure-expand" title="{$caption} - Click to open full size">
<img data-img="[graphic-{$filename}-medium]" src="{$graphics}" alt="{$caption}"/>
</a>
</xsl:for-each>
</div>
<xsl:apply-templates/>
</div>
......@@ -2194,41 +2183,7 @@
</li>
</xsl:template>
<xsl:template match="ref/element-citation">
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="child::article-title">
<xsl:apply-templates select="child::article-title/node()"/>
</xsl:when>
<xsl:when test="child::source">
<xsl:apply-templates select="child::source/node()"/>
</xsl:when>
<xsl:when test="child::comment">
<xsl:apply-templates select="child::comment/node()"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="title-type">
<xsl:choose>
<xsl:when test="child::article-title">
<xsl:value-of select="'article-title'"/>
</xsl:when>
<xsl:when test="child::source">
<xsl:value-of select="'source'"/>
</xsl:when>
<xsl:when test="child::comment">
<xsl:value-of select="'comment'"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<div class="reflink-main">
<!-- call authors template -->
<xsl:if test="person-group[@person-group-type = 'author'] | collab">
<span class="authors">
<xsl:for-each select="person-group[@person-group-type = 'author']">
<xsl:template match="ref//person-group" mode="list-ref-people">
<xsl:for-each select="name | collab">
<xsl:if test="position() != 1">
<xsl:text>, </xsl:text>
......@@ -2239,23 +2194,8 @@
<xsl:variable name="surname" select="surname"/>
<xsl:variable name="suffix" select="suffix"/>
<xsl:variable name="fullname">
<!--<xsl:choose>
<xsl:when test="string($suffix) != ''">
<xsl:value-of select="concat($surname, ' ', $givenname, ' ', $suffix)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($surname, ' ', $givenname)"/>
</xsl:otherwise>
</xsl:choose>-->
<xsl:value-of select="concat($surname, ' ', $givenname)"/>
</xsl:variable>
<!--<xsl:variable name="hrefvalue"
select="concat('http://scholar.google.com/scholar?q=&quot;author:', $fullname, '&quot;')"/>
<span class="elife-reflink-author">
<a href="{$hrefvalue}" target="_blank">
<xsl:value-of select="$fullname"/>
</a>
</span>-->
<span class="reflink-author">
<xsl:value-of select="$fullname"/>
</span>
......@@ -2273,6 +2213,16 @@
<xsl:value-of select="."/>
</xsl:for-each>
<xsl:choose>
<xsl:when test="@person-group-type = 'editor'">
<xsl:if test="etal">
<xsl:text>, et al</xsl:text>
</xsl:if>
<xsl:text>, editor</xsl:text>
<xsl:if test="count(child::*[self::name | self::collab | self::etal]) > 1">
<xsl:text>s</xsl:text>
</xsl:if>
<xsl:text>. </xsl:text>
</xsl:when>
<xsl:when test="etal">
<xsl:text>, et al. </xsl:text>
</xsl:when>
......@@ -2280,7 +2230,40 @@
<xsl:text>. </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<xsl:template match="ref/element-citation">
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="child::article-title">
<xsl:apply-templates select="child::article-title/node()"/>
</xsl:when>
<xsl:when test="child::source">
<xsl:apply-templates select="child::source/node()"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="title-type">
<xsl:choose>
<xsl:when test="child::article-title">
<xsl:value-of select="'article-title'"/>
</xsl:when>
<xsl:when test="child::source">
<xsl:value-of select="'source'"/>
</xsl:when>
<xsl:when test="child::comment">
<xsl:value-of select="'comment'"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<div class="reflink-main">
<!-- call authors template -->
<xsl:if test="person-group[@person-group-type = 'author'] | collab">
<span class="authors">
<xsl:apply-templates select="person-group[@person-group-type = 'author']" mode="list-ref-people"/>
</span>
</xsl:if>
......@@ -2298,7 +2281,7 @@
and comma separate
-->
<xsl:variable name="class">
<xsl:if test="@publication-type">
<xsl:if test="@publication-type = 'journal'">
<xsl:value-of select="'elife-reflink-details-journal'"/>
</xsl:if>
</xsl:variable>
......@@ -2333,7 +2316,16 @@
<xsl:if test="child::lpage">
<xsl:value-of select="'lpage|'"/>
</xsl:if>
<xsl:if test="child::person-group[@person-group-type = 'editor'] and @publication-type='book'">
<xsl:value-of select="'book-editor|'"/>
</xsl:if>
</xsl:variable>
<xsl:if test="contains($includes, 'book-editor|')">
<span>
<xsl:text>In: </xsl:text>
<xsl:apply-templates select="person-group[@person-group-type = 'editor']" mode="list-ref-people"/>
</span>
</xsl:if>
<xsl:if test="contains($includes, 'source|')">
<span>
<xsl:if test="$class != ''">
......@@ -2836,8 +2828,9 @@
<xsl:template match="ref-list/title"/>
<xsl:template match="
ref//label | ref//year | ref//article-title | ref//fpage | ref//volume | ref//issue | ref//source | ref//pub-id |
ref//lpage | ref//comment | ref//supplement | ref//person-group[@person-group-type = 'editor'] | ref//edition | ref//publisher-loc |
ref//publisher-name | ref//ext-link"/>
ref//lpage | ref//supplement | ref//person-group[@person-group-type = 'editor'] | ref//edition | ref//publisher-loc |
ref//lpage | ref//supplement | ref//edition | ref//publisher-loc |
ref//publisher-name"/>
<xsl:template match="person-group[@person-group-type = 'author'] | collab"/>
<xsl:template match="media/label"/>
<xsl:template match="sub-article//article-title"/>
......
......@@ -48,7 +48,7 @@ class Audit extends EpmcBaseModel {
CASE WHEN xml_review=0 THEN 0 ELSE xml_review_within_10_days*100/xml_review END xml_review_within_10_days_perc,
xml_review_within_3_days,
CASE WHEN xml_review=0 THEN 0 ELSE xml_review_within_3_days*100/xml_review END xml_review_within_3_days_perc,
published, ncbi_ready_median, COALESCE (external_qa, 0) external_qa
published, ncbi_ready_median, COALESCE (external_qa, 0) external_qa, xml_tagging
FROM
(SELECT TO_CHAR(date_trunc('month', current_date AT TIME ZONE 'Europe/London') + -1*n * INTERVAL '1 month', 'YYYYMM') mth,
TO_CHAR(date_trunc('month', current_date AT TIME ZONE 'Europe/London') + -1*n * INTERVAL '1 month', 'Mon YYYY') display_mth,
......@@ -82,6 +82,28 @@ GROUP BY TO_CHAR(date_trunc('month', current_date AT TIME ZONE 'Europe/London')
AND a.created AT TIME ZONE 'Europe/London' BETWEEN DATE_TRUNC('month', current_date AT TIME ZONE 'Europe/London') + -12 * INTERVAL '1 month' and DATE_TRUNC('month', current_date AT TIME ZONE 'Europe/London')
GROUP BY TO_CHAR(date_trunc('month', a.created AT TIME ZONE 'Europe/London') , 'YYYYMM')
) qa ON a.mth = qa.mth
-- Sum of count of XMLs uploaded by tagger first time only (no corrected XMLs) + count of re-tagging notes added by admin
-- Helpdesk need to add a note containing the word 're-tag' or 'retag' (case-insensitive) for each re-tagging
FULL OUTER JOIN (
SELECT TO_CHAR(date_trunc('month', tag.created AT TIME ZONE 'Europe/London') , 'YYYYMM') mth, count(*) xml_tagging
FROM
(SELECT a.manuscript_id, min(a.created) created
FROM audit.audit_log a, public.team t
WHERE t.role_name='tagger'
AND a.user_id=t.user_id
AND a.created AT TIME ZONE 'Europe/London' BETWEEN DATE_TRUNC('month', current_date AT TIME ZONE 'Europe/London') + -12 * INTERVAL '1 month' and DATE_TRUNC('month', current_date AT TIME ZONE 'Europe/London')
AND a.changes->>'type' = 'PMC'
GROUP BY a.manuscript_id
UNION
SELECT a.manuscript_id, a.created
FROM audit.audit_log a, public.team t
WHERE t.role_name='admin'
AND a.user_id=t.user_id
AND a.created AT TIME ZONE 'Europe/London' BETWEEN DATE_TRUNC('month', current_date AT TIME ZONE 'Europe/London') + -12 * INTERVAL '1 month' and DATE_TRUNC('month', current_date AT TIME ZONE 'Europe/London')
AND changes::text ~* '(re-|re)tag'
AND changes->>'notes_type'='userMessage') tag
GROUP BY TO_CHAR(date_trunc('month', tag.created AT TIME ZONE 'Europe/London') , 'YYYYMM')
) tagging ON a.mth = tagging.mth
order by a.mth desc`,
)
......
......@@ -554,6 +554,7 @@ const Manuscript = {
}
if (input.status === 'xml-complete') {
input.ncbiState = null
input.formState = null
if (
(originalMan['meta,articleIds'] &&
originalMan['meta,articleIds'].some(
......
......@@ -35,4 +35,5 @@ type Metrics implements Object {
published: Int
ncbi_ready_median: Float
external_qa: Int
xml_tagging: Int
}
Markdown is supported
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