diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 33097693851bcb04f27744d87ead64ca55f2fd58..09bdbbe4c98dd31348bef6fa4c4b94212841944b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,7 +51,8 @@ test: push:qa: image: docker:latest stage: push - when: manual + only: + - develop variables: NODE_ENV: test script: @@ -73,6 +74,9 @@ push:qa: push:staging: image: docker:latest when: manual + only: + - develop + - master stage: push variables: NODE_ENV: production @@ -96,6 +100,9 @@ push:production:review: image: docker:latest stage: push when: manual + only: + - develop + - master variables: NODE_ENV: production script: @@ -117,7 +124,8 @@ push:production:review: deploy:qa: image: pubsweet/deployer:latest stage: deploy - when: manual + only: + - develop variables: PACKAGE_NAME: xpub-faraday IMAGE_REPO: $CI_ECR_URL @@ -134,6 +142,9 @@ deploy:staging: image: pubsweet/deployer:latest stage: deploy when: manual + only: + - develop + - master variables: PACKAGE_NAME: xpub-faraday IMAGE_REPO: $CI_ECR_URL @@ -150,6 +161,9 @@ deploy:production:review: image: pubsweet/deployer:latest stage: deploy when: manual + only: + - develop + - master variables: PACKAGE_NAME: xpub-faraday IMAGE_REPO: $REVIEW_ECR diff --git a/packages/component-faraday-ui/src/ManuscriptCard.js b/packages/component-faraday-ui/src/ManuscriptCard.js index c0834e3b7345ea14a6a3f80ed999d850c98f52a8..f06c5557a6e8a5d442d6b230df00cc92b76b9370 100644 --- a/packages/component-faraday-ui/src/ManuscriptCard.js +++ b/packages/component-faraday-ui/src/ManuscriptCard.js @@ -34,7 +34,7 @@ const ManuscriptCard = ({ id: fragmentId, submitted = null, } = fragment - const { title = 'No title', journal = '', type = '' } = metadata + const { title = 'No title', journal, type = '' } = metadata return ( <Root data-test-id={`fragment-${fragmentId}`} onClick={onCardClick}> <MainContainer> @@ -59,7 +59,11 @@ const ManuscriptCard = ({ </DateParser> )} <Text>{manuscriptType.label || type}</Text> - <Text ml={1}>{journal}</Text> + {journal && ( + <Text journal ml={1}> + {journal} + </Text> + )} </Row> <Row alignItems="center" justify="flex-start" mb={1}> <H4>Handling editor</H4> diff --git a/packages/component-faraday-ui/src/Text.js b/packages/component-faraday-ui/src/Text.js index 6e7d8887c44f9599c32aedeb3d5cdb28266b4c91..d8092434a6dc7f35fa449cd1ad801d5344e0ea26 100644 --- a/packages/component-faraday-ui/src/Text.js +++ b/packages/component-faraday-ui/src/Text.js @@ -38,6 +38,16 @@ const textHelper = props => { } ` } + if (has(props, 'journal')) { + return css` + color: ${th('colorSecondary')}; + font-family: ${th('fontReading')}; + &:before { + content: '•'; + padding-right: ${th('gridUnit')}; + } + ` + } return css` color: ${th('colorText')}; font-family: ${th('fontReading')}; diff --git a/packages/component-faraday-ui/src/manuscriptDetails/ManuscriptHeader.js b/packages/component-faraday-ui/src/manuscriptDetails/ManuscriptHeader.js index 9d74fedae84e13591df8e49af4631407235f85c0..267ab5774524680b6d9e435f0a48efe8d7185ca1 100644 --- a/packages/component-faraday-ui/src/manuscriptDetails/ManuscriptHeader.js +++ b/packages/component-faraday-ui/src/manuscriptDetails/ManuscriptHeader.js @@ -47,7 +47,9 @@ const ManuscriptHeader = ({ </DateParser> )} <Text>{manuscriptType.label || type}</Text> - <Text ml={1}>{journal}</Text> + <Text journal ml={1}> + {journal} + </Text> </Row> <Row alignItems="center" justify="flex-start" mb={1}> <H4>Editor in Chief</H4> diff --git a/packages/component-faraday-ui/src/manuscriptDetails/ManuscriptMetadata.js b/packages/component-faraday-ui/src/manuscriptDetails/ManuscriptMetadata.js index 214588cdbb9ab854fbfe5d6298de569e6abda953..e0511b97b0a7070469d2779023ead0e017deb310 100644 --- a/packages/component-faraday-ui/src/manuscriptDetails/ManuscriptMetadata.js +++ b/packages/component-faraday-ui/src/manuscriptDetails/ManuscriptMetadata.js @@ -17,18 +17,18 @@ const ManuscriptMetadata = ({ {!!abstract && ( <Item mb={1}> <ContextualBox label="Abstract" startExpanded transparent> - <Text dangerouslySetInnerHTML={{ __html: abstract }} mb={1} mt={1} /> + <Text mb={1} mt={1}> + {abstract} + </Text> </ContextualBox> </Item> )} {conflicts.hasConflicts === 'yes' && ( <Item mb={1}> <ContextualBox label="Conflict of Interest" transparent> - <Text - dangerouslySetInnerHTML={{ __html: get(conflicts, 'message', '') }} - mb={1} - mt={1} - /> + <Text mb={1} mt={1}> + {get(conflicts, 'message', '')} + </Text> </ContextualBox> </Item> )} diff --git a/packages/component-faraday-ui/src/modals/MultiAction.js b/packages/component-faraday-ui/src/modals/MultiAction.js index 696e7935e917e77e61a25d87608e5cbed2fcd762..a1beeaf592edb16b9df1a02bdab80e24027c9fab 100644 --- a/packages/component-faraday-ui/src/modals/MultiAction.js +++ b/packages/component-faraday-ui/src/modals/MultiAction.js @@ -4,7 +4,7 @@ import { th } from '@pubsweet/ui-toolkit' import { H2, Button, Spinner } from '@pubsweet/ui' import { compose, setDisplayName, withHandlers } from 'recompose' -import { IconButton, Text } from '../' +import { IconButton, Text, Row } from '../' const MultiAction = ({ title, @@ -27,7 +27,7 @@ const MultiAction = ({ {modalError} </Text> )} - <Buttons isFetching={isFetching}> + <Row mt={1}> {isFetching ? ( <Spinner size={3} /> ) : ( @@ -38,7 +38,7 @@ const MultiAction = ({ </Button> </Fragment> )} - </Buttons> + </Row> </Root> ) @@ -90,11 +90,4 @@ const Root = styled.div` margin-bottom: ${th('gridUnit')}; } ` - -const Buttons = styled.div` - display: flex; - justify-content: ${props => (props.isFetching ? 'center' : 'space-evenly')}; - margin-top: calc(${th('gridUnit')} * 3); - width: 70%; -` // #endregion diff --git a/packages/component-helper-service/src/services/email/templates/partials/footer.hbs b/packages/component-helper-service/src/services/email/templates/partials/footer.hbs index f461fdbaac1bb855f475c3590062cb7b269086b2..ef8f0564bbff2ccc106691d9fd99f6cca224af45 100644 --- a/packages/component-helper-service/src/services/email/templates/partials/footer.hbs +++ b/packages/component-helper-service/src/services/email/templates/partials/footer.hbs @@ -4,7 +4,7 @@ <p class="Unsubscribe--senderName" style="font-family:Arial, Helvetica, sans-serif;font-size:12px;line-height:20px">Hindawi Limited</p> <p style="font-family:Arial, Helvetica, sans-serif;font-size:12px;line-height:20px"> <span class="Unsubscribe--senderAddress">3rd Floor, Adam House, 1 Fitzroy Square</span>, - <span class="Unsubscribe--senderCity">LONDON</span>, + <span class="Unsubscribe--senderCity">London</span>, <span class="Unsubscribe--senderState">United Kingdom</span> <span class="Unsubscribe--senderZip">W1T 5HF</span> </p> diff --git a/packages/component-user-manager/src/routes/users/emails/emailCopy.js b/packages/component-user-manager/src/routes/users/emails/emailCopy.js index 45d558e60775cb66e8c7a3ee837b4ea186d9b659..c40c10aa08f47066fd02901c03814b86c73a9344 100644 --- a/packages/component-user-manager/src/routes/users/emails/emailCopy.js +++ b/packages/component-user-manager/src/routes/users/emails/emailCopy.js @@ -2,7 +2,7 @@ const getEmailCopy = ({ emailType }) => { let paragraph switch (emailType) { case 'user-forgot-password': - paragraph = `You have requested a to reset your password. In order to reset your password please click on the following link:` + paragraph = `You have requested to reset your password. In order to reset your password please click the link below.` break default: throw new Error(`The ${emailType} email type is not defined.`) diff --git a/packages/component-user-manager/src/routes/users/emails/notifications.js b/packages/component-user-manager/src/routes/users/emails/notifications.js index 20694fbc40149a28431fa66621085f8bf04cb76d..344b5c7acd0a51bef1b1cee98e4958df0c458252 100644 --- a/packages/component-user-manager/src/routes/users/emails/notifications.js +++ b/packages/component-user-manager/src/routes/users/emails/notifications.js @@ -1,6 +1,7 @@ const config = require('config') const forgotPath = config.get('forgot-password.url') +const { name: journalName, staffEmail } = config.get('journal') const unsubscribeSlug = config.get('unsubscribe.url') @@ -12,6 +13,7 @@ module.exports = { async sendNotifications({ user, baseUrl }) { const email = new Email({ type: 'system', + fromEmail: `${journalName} <${staffEmail}>`, content: { ctaLink: services.createUrl(baseUrl, forgotPath, { email: user.email, @@ -28,14 +30,12 @@ module.exports = { const sendForgotPasswordEmail = ({ email, baseUrl, user }) => { email.toUser = { email: user.email, - name: user.name, } email.content.subject = 'Forgot Password' email.content.unsubscribeLink = services.createUrl(baseUrl, unsubscribeSlug, { id: user.id, }) - email.content.signatureName = 'Hindawi Submission System' const { html, text } = email.getBody({ body: getEmailCopy({ diff --git a/packages/component-user-manager/src/routes/users/forgotPassword.js b/packages/component-user-manager/src/routes/users/forgotPassword.js index 6ae4f87953355169f4de9440580e9976525622e7..4d0eed77b30d5592f22219c69eb1c06246aeeaa6 100644 --- a/packages/component-user-manager/src/routes/users/forgotPassword.js +++ b/packages/component-user-manager/src/routes/users/forgotPassword.js @@ -40,12 +40,6 @@ module.exports = models => async (req, res) => { user, baseUrl: services.getBaseUrl(req), }) - // mailService.sendSimpleEmail({ - // toEmail: user.email, - // user, - // emailType: 'forgot-password', - // dashboardUrl: services.getBaseUrl(req), - // }) } catch (e) { logger.error( `A forgot password request has been made on an non-existent email: ${email}`, diff --git a/packages/component-wizard/src/components/SubmissionStatement.js b/packages/component-wizard/src/components/SubmissionStatement.js index 3fdc3879ce05fd3002410986c4c57d1516f4ab8b..cdbc630458e7808c29651a8bd83520d476f30301 100644 --- a/packages/component-wizard/src/components/SubmissionStatement.js +++ b/packages/component-wizard/src/components/SubmissionStatement.js @@ -52,7 +52,7 @@ const SubmissionStatement = () => ( </ActionLink> {' & '} <ActionLink to="https://www.hindawi.com/privacy/"> - privacy + privacy policy </ActionLink>{' '} under which this manuscript will be processed. </Text> diff --git a/packages/component-wizard/src/redux/conversion.js b/packages/component-wizard/src/redux/conversion.js index 8c824ee7726ca2ae6829e89a4a48d7bcbf81a26d..5470754f7da46c4b020eba5929e2402ee10cb13a 100644 --- a/packages/component-wizard/src/redux/conversion.js +++ b/packages/component-wizard/src/redux/conversion.js @@ -1,7 +1,8 @@ import moment from 'moment' -import { pick } from 'lodash' +import { pick, get } from 'lodash' import { actions } from 'pubsweet-client' import { create, update } from 'pubsweet-client/src/helpers/api' +import journalConfig from 'xpub-faraday/app/config/journal' /* constants */ export const CREATE_DRAFT_REQUEST = 'CREATE_DRAFT_REQUEST' @@ -61,7 +62,9 @@ export const createDraftSubmission = history => (dispatch, getState) => { coverLetter: [], }, fragmentType: 'version', - metadata: {}, + metadata: { + journal: get(journalConfig, 'metadata.nameText', ''), + }, version: 1, }), ).then(({ fragment }) => { diff --git a/packages/xpub-faraday/app/config/journal/manuscript-types.js b/packages/xpub-faraday/app/config/journal/manuscript-types.js index 1712e5be61e385dbd62199cf3ae5e5c40bf78ba0..3f02afc38c1ce4f2ef261a9e1fc4c908b52b9750 100644 --- a/packages/xpub-faraday/app/config/journal/manuscript-types.js +++ b/packages/xpub-faraday/app/config/journal/manuscript-types.js @@ -1,13 +1,13 @@ module.exports = [ { - label: 'Research', + label: 'Research Article', value: 'research', author: true, peerReview: true, abstractRequired: true, }, { - label: 'Review', + label: 'Review Article', value: 'review', author: true, peerReview: true, diff --git a/packages/xpub-faraday/config/authsome-mode.js b/packages/xpub-faraday/config/authsome-mode.js index ce2c668a20da9ab4a86b40e24ed00cdb08a60d0c..4d42abca0386849dc866a6fc033abc2abf62c6a8 100644 --- a/packages/xpub-faraday/config/authsome-mode.js +++ b/packages/xpub-faraday/config/authsome-mode.js @@ -1,5 +1,5 @@ const config = require('config') -const { get, pickBy, last, has } = require('lodash') +const { get, pickBy, last, has, pick } = require('lodash') const statuses = config.get('statuses') const helpers = require('./authsome-helpers') @@ -238,7 +238,17 @@ async function applyAuthenticatedUserPolicy(user, operation, object, context) { } if (get(object, 'type') === 'user' && get(object, 'id') === user.id) { - return true + return { + filter: body => + pick(body, [ + 'title', + 'country', + 'lastName', + 'firstName', + 'affiliation', + 'notifications', + ]), + } } // allow owner to submit a revision