From f6f294b18f74991fe6b96b09b624ae4896f45e00 Mon Sep 17 00:00:00 2001 From: Yannis Barlas Date: Wed, 16 Jan 2019 22:36:11 +0200 Subject: [PATCH 1/7] feat(assign reviewers): ui to invite external reviewers --- app/components/AssignReviewers.js | 53 +++++++++++++++++++++++++- app/components/form/AddReviewerForm.js | 36 +++++++++++++++++ app/components/form/index.js | 1 + 3 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 app/components/form/AddReviewerForm.js diff --git a/app/components/AssignReviewers.js b/app/components/AssignReviewers.js index 530875b..ef08d4d 100644 --- a/app/components/AssignReviewers.js +++ b/app/components/AssignReviewers.js @@ -11,7 +11,8 @@ import { th } from '@pubsweet/ui-toolkit' import ComposedAssignReviewers from './compose/AssignReviewers' import { Select as DefaultSelect } from './ui' -import { AssignReviewersForm } from './form' +import { TextField } from './formElements' +import { AddReviewerForm, AssignReviewersForm } from './form' import Loading from './Loading' import { isMember } from '../helpers/teams' @@ -56,6 +57,7 @@ const PageHeading = styled(H2)` const ContentWrapper = styled.div` cursor: default; display: flex; + flex-direction: column; margin-left: ${th('gridUnit')}; form { @@ -80,6 +82,52 @@ const Tag = styled.span` padding: calc(${th('gridUnit')} / 2); ` +const InviteSectionWrapper = styled.div` + margin: calc(${th('gridUnit')} * 3) 0; +` + +const InviteSection = props => { + const { articleId } = props + + return ( + + Add a reviewer that is not in the system + + + {formProps => { + const { errors, values, ...rest } = formProps + + return ( + + + + + + + + ) + }} + + + ) +} + const SuggestedReviewer = props => { const { name } = props return {name} @@ -264,7 +312,6 @@ const AssignReviewers = props => { options={userOptions} value={values.reviewers} /> - @@ -272,6 +319,8 @@ const AssignReviewers = props => { ) }} + +
diff --git a/app/components/form/AddReviewerForm.js b/app/components/form/AddReviewerForm.js new file mode 100644 index 0000000..3d4d293 --- /dev/null +++ b/app/components/form/AddReviewerForm.js @@ -0,0 +1,36 @@ +import React from 'react' +import * as yup from 'yup' + +import Form from './Form' + +const initialValues = { + email: '', + name: '', +} + +const validations = yup.object().shape({ + email: yup + .string() + .required('Email is required') + .email('Invalid email address'), + name: yup.string().required('Name is required'), +}) + +const AddReviewerForm = props => { + // const { articleId } = props + + const handleSubmit = (formValues, formikBag) => { + // console.log('submit me!', formValues) + } + + return ( +
+ ) +} + +export default AddReviewerForm diff --git a/app/components/form/index.js b/app/components/form/index.js index b98f38b..3239c86 100644 --- a/app/components/form/index.js +++ b/app/components/form/index.js @@ -1,3 +1,4 @@ +export { default as AddReviewerForm } from './AddReviewerForm' export { default as AssignReviewersForm } from './AssignReviewersForm' export { default as DecisionForm } from './DecisionForm' export { default as DiscussForm } from './DiscussForm' From c5b46a6298c6f904be93b868958b16c316a1b823 Mon Sep 17 00:00:00 2001 From: Yannis Barlas Date: Fri, 18 Jan 2019 22:14:37 +0200 Subject: [PATCH 2/7] fix(editor panel): whitelist doi field for editors --- config/authsome.js | 1 + 1 file changed, 1 insertion(+) diff --git a/config/authsome.js b/config/authsome.js index aefcdd6..7928b15 100644 --- a/config/authsome.js +++ b/config/authsome.js @@ -169,6 +169,7 @@ const permissions = { 'currentlyWith', 'dataType', 'decisionLetter', + 'doi', 'status', ] From d064f232be6c3dd77e06e28656be26e8c354b02c Mon Sep 17 00:00:00 2001 From: Yannis Barlas Date: Fri, 18 Jan 2019 23:01:07 +0200 Subject: [PATCH 3/7] fix(authsome): doi editing now passes for global users --- config/authsome.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/authsome.js b/config/authsome.js index 7928b15..efab338 100644 --- a/config/authsome.js +++ b/config/authsome.js @@ -57,6 +57,8 @@ const isInvitedReviewer = (user, object, context) => const updatedProperties = (current, update) => { const diff = Object.keys(current).filter(k => { + if (!update[k]) return false + if (typeof current[k] === 'string') { return current[k] !== update[k] } From 357adce9cd7b2d6f69d920b1101f151bab73a801 Mon Sep 17 00:00:00 2001 From: Yannis Barlas Date: Fri, 18 Jan 2019 23:25:08 +0200 Subject: [PATCH 4/7] fix(graphql): remove console log --- app/components/compose/pieces/manuscriptMetadataUpdate.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/components/compose/pieces/manuscriptMetadataUpdate.js b/app/components/compose/pieces/manuscriptMetadataUpdate.js index a88f00e..9912f13 100644 --- a/app/components/compose/pieces/manuscriptMetadataUpdate.js +++ b/app/components/compose/pieces/manuscriptMetadataUpdate.js @@ -14,7 +14,6 @@ const MANUSCRIPT_METADATA_UPDATE = gql` const ManuscriptMetadataUpdateMutation = props => { const { articleId, render } = props - console.log(props) const refetchQueries = [ { From 20d7b0d610702d7933fff9b9f47aeae9cf915442 Mon Sep 17 00:00:00 2001 From: Yannis Barlas Date: Fri, 18 Jan 2019 23:03:38 +0200 Subject: [PATCH 5/7] fix(editor panel): show previous doi when editing it --- app/components/ui/EditorPanelMetadata.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/components/ui/EditorPanelMetadata.js b/app/components/ui/EditorPanelMetadata.js index 04d8f6b..2b53dd6 100644 --- a/app/components/ui/EditorPanelMetadata.js +++ b/app/components/ui/EditorPanelMetadata.js @@ -86,6 +86,7 @@ const EditorPanelMetadata = props => { return ( From 506ddcf06f05090c12e0ffbb5133fbbab9b85c00 Mon Sep 17 00:00:00 2001 From: Rik Smith-Unna Date: Wed, 30 Jan 2019 11:49:23 +0000 Subject: [PATCH 6/7] chore: recommit yarn.lock --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 9c96e2a..bf26a0d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9646,7 +9646,7 @@ prompt@^1.0.0: utile "0.3.x" winston "2.1.x" -"prompt@github:flatiron/prompt#1c95d1d8d333b5fbc13fa5f0619f3dcf0d514f87": +prompt@flatiron/prompt#1c95d1d8d333b5fbc13fa5f0619f3dcf0d514f87: version "1.0.0" resolved "https://codeload.github.com/flatiron/prompt/tar.gz/1c95d1d8d333b5fbc13fa5f0619f3dcf0d514f87" dependencies: From e04a72726194d855793cdcc694b72a6ddecd0577 Mon Sep 17 00:00:00 2001 From: Rik Smith-Unna Date: Wed, 30 Jan 2019 11:49:43 +0000 Subject: [PATCH 7/7] docs: mark TODO in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a2ca4e..a2dafcd 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ **[Join our PREreview Slack Channel](https://join.slack.com/t/prereview/shared_invite/enQtMzYwMjQzMTk3ODMxLTZhOWQ5M2FmMTY5OTYzZDNhNDg2ZDdhODE2Y2Y4MTVjY2U0OWRiZTA5ZjM3MWM1ZTY0N2E1ODYyNWM1NTc2NDg)** -## Developer quick links +## [TODO] Developer quick links - Design - Roadmap