diff --git a/app/storage/forms/submit.json b/app/storage/forms/submit.json index 5fba5123ed7fab43bad5efa6d8c1e8c1cd7f2c3b..144924e13d1563bb267502874d316f1f0129e999 100644 --- a/app/storage/forms/submit.json +++ b/app/storage/forms/submit.json @@ -1 +1 @@ -{"name":"Submission information","id":"submit","children":[{"title":"Authors","id":"1531726163478","component":"AuthorsInput","name":"authors","order":"3"},{"title":"Keywords","id":"1531303777701","component":"TextField","name":"meta.keywords","placeholder":"Enter keywords...","parse":"split","format":"join","validate":["required"],"order":"4"},{"title":"Type of article","id":"1531303833528","component":"Menu","name":"meta.articleType","options":[{"value":"original-research","label":"Original Research Report"},{"label":"Review","value":"review"},{"value":"opinion","label":"Opinion/Commentary"},{"value":"registered-report","label":"Registered Report"}],"validate":["required"],"order":"5"},{"title":"Section","id":"1531304067965","component":"CheckboxGroup","name":"meta.articleSections","options":[{"value":"cognitive-psychology","label":"Cognitive Psychology"},{"value":"social-psychology","label":"Social Psychology"},{"value":"personality-psychology","label":"Personality Psychology"},{"value":"developmental-psychology","label":"Developmental Psychology"},{"value":"clinical-psychology","label":"Clinical Psychology"},{"value":"organizational-behavior","label":"Organizational Behavior"},{"value":"methodology","label":"Methodology and Research Practice"}],"validate":["required"],"order":"6","placeholder":"test"},{"title":"Data is open ?","id":"1531304241437","component":"RadioGroup","options":[{"value":"yes","label":"Yes"},{"value":"No/Not Applicable","label":"No"}],"description":"<p>The journal requires data be openly available, and our full policy is <a href=\"https://www.collabra.org/about/editorialpolicies/#open-data-open-analytic-methods-code-and-research-materials-transparency\" target=\"_blank\">here</a>. If you have exceptions that need to be considered, please click \"No\" and explain in your cover letter below. Please click N/A if your submission does not feature data.</p>","name":"meta.declarations.openData","inline":"true","sectioncss":"{\"flex-direction\": \"row\", \"wrap\": \"wrap\"}","validate":["required"],"order":"7"},{"title":"Previously submitted ?","id":"1531304409993","component":"RadioGroup","description":"<p>Provide further details in your cover letter below, if necessary.</p>","options":[{"label":"Yes","value":"yes"},{"label":"No","value":"no"}],"name":"meta.declarations.previouslySubmitted","inline":"true","sectioncss":"{\"flex-direction\": \"row\", \"wrap\": \"wrap\"}","validate":["required"],"order":"8"},{"title":"Open peer review ?","id":"1531304483066","component":"RadioGroup","description":"<p>Please read a description of our <a href=\"https://www.collabra.org/about/editorialpolicies/#open-peer-review\" target=\"_blank\">“Open Reviewâ€</a> option and select “Yes†if you choose this process.</p>","options":[{"label":"Yes","value":"yes"},{"label":"No","value":"no"}],"name":"meta.declarations.openPeerReview","sectioncss":"{\"flex-direction\": \"row\", \"wrap\": \"wrap\"}","inline":"true","validate":["required"],"order":"9"},{"title":"Streamlined review ?","id":"1531304541011","component":"RadioGroup","description":"<p>Please read a description of our <a href=\"https://www.collabra.org/about/editorialpolicies/#streamlined-review\" target=\"_blank\">“Streamlined Reviewâ€</a> option and select “Yes†if you choose this process. If “Yesâ€, please upload your ported decision letter and reviews as “Supplementary Files†below, clearly labeled.</p>","options":[{"label":"Yes","value":"yes"},{"label":"No","value":"no"}],"name":"meta.declarations.streamlinedReview","sectioncss":"{\"flex-direction\": \"row\", \"wrap\": \"wrap\"}","inline":"true","validate":["required"],"order":"10"},{"title":"Submitted as part of the <a href=\"https://www.collabra.org/collections/special/\" target=\"_blank\">research nexus</a> ?","id":"1531304591795","component":"RadioGroup","description":"<p>If yes, mention the name of the Research Nexus in your cover letter below.</p>","options":[{"label":"Yes","value":"yes"},{"label":"No","value":"no"}],"name":"meta.declarations.researchNexus","sectioncss":"{\"flex-direction\": \"row\", \"wrap\": \"wrap\"}","inline":"true","validate":["required"],"order":"11"},{"title":"Pre-registered ?","id":"1531304681954","component":"RadioGroup","description":"<p>If any or all elements of your study have been pre-registered, click yes and ensure details are in the Acknowledgements section of your manuscript, following these <a href=\"https://www.collabra.org/about/editorialpolicies/#preregistration-of-studies-and-analysis-plans\" target=\"_blank\">guidelines</a>.</p>","options":[{"label":"Yes","value":"yes"},{"label":"No","value":"no"}],"name":"meta.declarations.preregistered","sectioncss":"{\"flex-direction\": \"row\", \"wrap\": \"wrap\"}","inline":"true","validate":["required"],"order":"12"},{"title":"Suggested reviewers","id":"1531304848635","component":"TextField","placeholder":"Add reviewer names...","name":"suggestions.reviewers.suggested","parse":"split","format":"join","order":"13"},{"title":"Opposed reviewers","id":"1531304933009","component":"TextField","placeholder":"Add reviewer names...","name":"suggestions.reviewers.opposed","parse":"split","format":"join","order":"14"},{"title":"Suggested editors","id":"1531304988723","component":"TextField","placeholder":"Add editor names...","name":"suggestions.editors.suggested","parse":"split","format":"join","order":"15"},{"title":"Opposed Editors","id":"1531305053799","component":"TextField","placeholder":"Add editor names...","name":"suggestions.editors.opposed","parse":"split","format":"join","order":"16"},{"title":"Funding body acknowledgement (required)","id":"1531305101246","component":"AbstractEditor","placeholder":"Enter body acknowledgement ...","description":"<p>Please also specifically state if your work was not supported by funding.</p>","name":"content","type":"fundingAcknowledgement","group":"meta.notes","validate":["required"],"order":"18"},{"title":"Special instructions (confidential, to Editors only)","id":"1531305179597","component":"AbstractEditor","placeholder":"Enter instructions ...","description":"<p>Please write or paste what you would normally write into a cover letter here, focusing on information that has not been covered by this form, or any further information prompted by your answers to the questions above.</p>","name":"content","type":"specialInstructions","group":"meta.notes","order":"17"},{"title":"Upload supplementary materials","id":"1531305332347","component":"SupplementaryFiles","description":"<p><pre>There are 3 types of item which should be uploaded here:<br /></p><p><ul></p><p><li>Regular figures which should also be be embedded in the manuscript.(These are helpful for the production<br />process,if your article is accepted, in case there are any issues with the embedded versions.)</li></p><p><li>Supplemental items that provide a relevant and useful expansion of the article (Examples include appendices,<br/>very large tables, audios, videos, three-dimensional visualizations, interactive graphics, and so on.)</li></p><p><li>Items that support the peer review process. (Examples are ported reviews and decision letters for use during<br />the Streamlined Review workflow. Also, if you have a long cover letter you would rather upload than paste<br/>into the text box, please also upload it here.)</li></p><p></ul></p><p>Supplemental materials can be named in almost any way, provided that the files are clearly and consistently named,<br />are uploaded in chronological order, and grouped as they are described above. For example, a typical article<br/>might include:</p><p><br /></p><p><ul></p><p><li>Figure 1.jpg</li></p><p><li>Figure 2.jpg</li></p><p><li>Figure 3.jpg</li></p><p><li>Supplemental Table 1.docx</li></p><p><li>Ported Decision Letter and Reviews from Journal X.docx</li></p><p></ul></p><p></pre></p>","name":"fileName","order":"19"}],"description":"<p></p><p>test The corresponding author confirms that all co-authors are included, and that everyone listed as a co-author agrees to that role and all the following requirements and acknowledgements.</p><p></p><p>The submission represents original work and that sources are given proper attribution.</p><p>(The journal employs <a href=\"https://www.crossref.org/services/similarity-check/\" rel=\"noopener noreferrer\" target=\"_blank\">CrossCheck</a> to compare submissions against a large and growing database of published scholarly content. If in the judgment of a senior editor a submission is genuinely suspected of plagiarism, it will be returned to the author(s)</p><p>with a request for explanation.)</p><p></p><p>The research was conducted in accordance with ethical principles.</p><p></p><p>There is a Data Accessibility Statement, containing information about the location of open data and materials, in the manuscript.</p><p></p><p>A conflict of interest statement is present in the manuscript, even if</p><p>to state no conflicts of interest.</p>","haspopup":"true","popuptitle":"By submitting the manuscript, you agree to the following statements.","popupdescription":"<p></p><p>wwwwwwThe corresponding author confirms that all co-authors are included, and that everyone listed as a co-author agrees to that role and all the following requirements and acknowledgements.</p><p></p><p>The submission represents original work and that sources are given proper attribution.</p><p>(The journal employs <a href=\"https://www.crossref.org/services/similarity-check/\" rel=\"noopener noreferrer\" target=\"_blank\">CrossCheck</a> to compare submissions against a large and growing database of published scholarly content. If in the judgment of a senior editor a submission is genuinely suspected of plagiarism, it will be returned to the author(s)</p><p>with a request for explanation.)</p><p></p><p>The research was conducted in accordance with ethical principles.</p><p></p><p>There is a Data Accessibility Statement, containing information about the location of open data and materials, in the manuscript.</p><p></p><p>A conflict of interest statement is present in the manuscript, even if</p><p>to state no conflicts of interest.</p>"} \ No newline at end of file +{"name":"Submission information","id":"submit","children":[{"title":"Title","id":"1531303631370","component":"AbstractEditor","name":"meta.title","placeholder":"Enter Title...","validate":["required","minChars"],"validateValue":{"minChars":"10"},"order":"1"},{"title":"Abstract","id":"1531303727228","component":"AbstractEditor","name":"meta.abstract","placeholder":"Enter the abstract...","validate":["required","minChars"],"validateValue":{"minChars":"100"},"order":"2"},{"title":"Authors","id":"1531726163478","component":"AuthorsInput","name":"authors","order":"3"},{"title":"Keywords","id":"1531303777701","component":"TextField","name":"meta.keywords","placeholder":"Enter keywords...","parse":"split","format":"join","validate":["required"],"order":"4"},{"title":"Type of article","id":"1531303833528","component":"Menu","name":"meta.articleType","options":[{"value":"original-research","label":"Original Research Report"},{"label":"Review","value":"review"},{"value":"opinion","label":"Opinion/Commentary"},{"value":"registered-report","label":"Registered Report"}],"validate":["required"],"order":"5"},{"title":"Section","id":"1531304067965","component":"CheckboxGroup","name":"meta.articleSections","options":[{"value":"cognitive-psychology","label":"Cognitive Psychology"},{"value":"social-psychology","label":"Social Psychology"},{"value":"personality-psychology","label":"Personality Psychology"},{"value":"developmental-psychology","label":"Developmental Psychology"},{"value":"clinical-psychology","label":"Clinical Psychology"},{"value":"organizational-behavior","label":"Organizational Behavior"},{"value":"methodology","label":"Methodology and Research Practice"}],"validate":["required"],"order":"6","placeholder":"test"},{"title":"Data is open ?","id":"1531304241437","component":"RadioGroup","options":[{"value":"yes","label":"Yes"},{"value":"No/Not Applicable","label":"No"}],"description":"<p>The journal requires data be openly available, and our full policy is <a href=\"https://www.collabra.org/about/editorialpolicies/#open-data-open-analytic-methods-code-and-research-materials-transparency\" target=\"_blank\">here</a>. If you have exceptions that need to be considered, please click \"No\" and explain in your cover letter below. Please click N/A if your submission does not feature data.</p>","name":"meta.declarations.openData","inline":"true","sectioncss":"{\"flex-direction\": \"row\", \"wrap\": \"wrap\"}","validate":["required"],"order":"7"},{"title":"Previously submitted ?","id":"1531304409993","component":"RadioGroup","description":"<p>Provide further details in your cover letter below, if necessary.</p>","options":[{"label":"Yes","value":"yes"},{"label":"No","value":"no"}],"name":"meta.declarations.previouslySubmitted","inline":"true","sectioncss":"{\"flex-direction\": \"row\", \"wrap\": \"wrap\"}","validate":["required"],"order":"8"},{"title":"Open peer review ?","id":"1531304483066","component":"RadioGroup","description":"<p>Please read a description of our <a href=\"https://www.collabra.org/about/editorialpolicies/#open-peer-review\" target=\"_blank\">“Open Reviewâ€</a> option and select “Yes†if you choose this process.</p>","options":[{"label":"Yes","value":"yes"},{"label":"No","value":"no"}],"name":"meta.declarations.openPeerReview","sectioncss":"{\"flex-direction\": \"row\", \"wrap\": \"wrap\"}","inline":"true","validate":["required"],"order":"9"},{"title":"Streamlined review ?","id":"1531304541011","component":"RadioGroup","description":"<p>Please read a description of our <a href=\"https://www.collabra.org/about/editorialpolicies/#streamlined-review\" target=\"_blank\">“Streamlined Reviewâ€</a> option and select “Yes†if you choose this process. If “Yesâ€, please upload your ported decision letter and reviews as “Supplementary Files†below, clearly labeled.</p>","options":[{"label":"Yes","value":"yes"},{"label":"No","value":"no"}],"name":"meta.declarations.streamlinedReview","sectioncss":"{\"flex-direction\": \"row\", \"wrap\": \"wrap\"}","inline":"true","validate":["required"],"order":"10"},{"title":"Submitted as part of the <a href=\"https://www.collabra.org/collections/special/\" target=\"_blank\">research nexus</a> ?","id":"1531304591795","component":"RadioGroup","description":"<p>If yes, mention the name of the Research Nexus in your cover letter below.</p>","options":[{"label":"Yes","value":"yes"},{"label":"No","value":"no"}],"name":"meta.declarations.researchNexus","sectioncss":"{\"flex-direction\": \"row\", \"wrap\": \"wrap\"}","inline":"true","validate":["required"],"order":"11"},{"title":"Pre-registered ?","id":"1531304681954","component":"RadioGroup","description":"<p>If any or all elements of your study have been pre-registered, click yes and ensure details are in the Acknowledgements section of your manuscript, following these <a href=\"https://www.collabra.org/about/editorialpolicies/#preregistration-of-studies-and-analysis-plans\" target=\"_blank\">guidelines</a>.</p>","options":[{"label":"Yes","value":"yes"},{"label":"No","value":"no"}],"name":"meta.declarations.preregistered","sectioncss":"{\"flex-direction\": \"row\", \"wrap\": \"wrap\"}","inline":"true","validate":["required"],"order":"12"},{"title":"Suggested reviewers","id":"1531304848635","component":"TextField","placeholder":"Add reviewer names...","name":"suggestions.reviewers.suggested","parse":"split","format":"join","order":"13"},{"title":"Opposed reviewers","id":"1531304933009","component":"TextField","placeholder":"Add reviewer names...","name":"suggestions.reviewers.opposed","parse":"split","format":"join","order":"14"},{"title":"Suggested editors","id":"1531304988723","component":"TextField","placeholder":"Add editor names...","name":"suggestions.editors.suggested","parse":"split","format":"join","order":"15"},{"title":"Opposed Editors","id":"1531305053799","component":"TextField","placeholder":"Add editor names...","name":"suggestions.editors.opposed","parse":"split","format":"join","order":"16"},{"title":"Funding body acknowledgement (required)","id":"1531305101246","component":"AbstractEditor","placeholder":"Enter body acknowledgement ...","description":"<p>Please also specifically state if your work was not supported by funding.</p>","name":"content","type":"fundingAcknowledgement","group":"meta.notes","validate":["required"],"order":"18"},{"title":"Special instructions (confidential, to Editors only)","id":"1531305179597","component":"AbstractEditor","placeholder":"Enter instructions ...","description":"<p>Please write or paste what you would normally write into a cover letter here, focusing on information that has not been covered by this form, or any further information prompted by your answers to the questions above.</p>","name":"content","type":"specialInstructions","group":"meta.notes","order":"17"},{"title":"Upload supplementary materials","id":"1531305332347","component":"SupplementaryFiles","description":"<p><pre>There are 3 types of item which should be uploaded here:<br /></p><p><ul></p><p><li>Regular figures which should also be be embedded in the manuscript.(These are helpful for the production<br />process,if your article is accepted, in case there are any issues with the embedded versions.)</li></p><p><li>Supplemental items that provide a relevant and useful expansion of the article (Examples include appendices,<br/>very large tables, audios, videos, three-dimensional visualizations, interactive graphics, and so on.)</li></p><p><li>Items that support the peer review process. (Examples are ported reviews and decision letters for use during<br />the Streamlined Review workflow. Also, if you have a long cover letter you would rather upload than paste<br/>into the text box, please also upload it here.)</li></p><p></ul></p><p>Supplemental materials can be named in almost any way, provided that the files are clearly and consistently named,<br />are uploaded in chronological order, and grouped as they are described above. For example, a typical article<br/>might include:</p><p><br /></p><p><ul></p><p><li>Figure 1.jpg</li></p><p><li>Figure 2.jpg</li></p><p><li>Figure 3.jpg</li></p><p><li>Supplemental Table 1.docx</li></p><p><li>Ported Decision Letter and Reviews from Journal X.docx</li></p><p></ul></p><p></pre></p>","name":"fileName","order":"19"}],"description":"<p></p><p>test The corresponding author confirms that all co-authors are included, and that everyone listed as a co-author agrees to that role and all the following requirements and acknowledgements.</p><p></p><p>The submission represents original work and that sources are given proper attribution.</p><p>(The journal employs <a href=\"https://www.crossref.org/services/similarity-check/\" rel=\"noopener noreferrer\" target=\"_blank\">CrossCheck</a> to compare submissions against a large and growing database of published scholarly content. If in the judgment of a senior editor a submission is genuinely suspected of plagiarism, it will be returned to the author(s)</p><p>with a request for explanation.)</p><p></p><p>The research was conducted in accordance with ethical principles.</p><p></p><p>There is a Data Accessibility Statement, containing information about the location of open data and materials, in the manuscript.</p><p></p><p>A conflict of interest statement is present in the manuscript, even if</p><p>to state no conflicts of interest.</p>","haspopup":"true","popuptitle":"By submitting the manuscript, you agree to the following statements.","popupdescription":"<p></p><p>wwwwwwThe corresponding author confirms that all co-authors are included, and that everyone listed as a co-author agrees to that role and all the following requirements and acknowledgements.</p><p></p><p>The submission represents original work and that sources are given proper attribution.</p><p>(The journal employs <a href=\"https://www.crossref.org/services/similarity-check/\" rel=\"noopener noreferrer\" target=\"_blank\">CrossCheck</a> to compare submissions against a large and growing database of published scholarly content. If in the judgment of a senior editor a submission is genuinely suspected of plagiarism, it will be returned to the author(s)</p><p>with a request for explanation.)</p><p></p><p>The research was conducted in accordance with ethical principles.</p><p></p><p>There is a Data Accessibility Statement, containing information about the location of open data and materials, in the manuscript.</p><p></p><p>A conflict of interest statement is present in the manuscript, even if</p><p>to state no conflicts of interest.</p>"} \ No newline at end of file diff --git a/config/authsomeGraphql.js b/config/authsomeGraphql.js index 55d4b5f991ee48a90e562d33732121acdcdfebfa..16fb4771fca9eb9a682658e39b1ea258335ce7d1 100644 --- a/config/authsomeGraphql.js +++ b/config/authsomeGraphql.js @@ -517,6 +517,14 @@ class XpubCollabraMode { return false } + async isAllowedToReview(object) { + this.user = await this.context.models.User.find(this.userId) + const permission = await this.isAssignedReviewerEditor({ + id: object.manuscriptId, + }) + return permission + } + async canViewMySubmissionSection() { this.user = await this.context.models.User.find(this.userId) const manuscripts = await Promise.all( @@ -676,10 +684,14 @@ module.exports = { return user.admin }, create: (userId, operation, object, context) => true, - update: (userId, operation, object, context) => { + update: async (userId, operation, object, context) => { const mode = new XpubCollabraMode(userId, operation, object, context) - if (mode.object === 'Manuscript' || mode.object === 'Team') { + if ( + mode.object === 'Manuscript' || + mode.object === 'Review' || + mode.object === 'Team' + ) { return true } @@ -687,6 +699,10 @@ module.exports = { return true } + if (mode.object.current.type === 'Review') { + return mode.isAllowedToReview(mode.object.current) + } + if (mode.object.current.type === 'Manuscript') { return mode.canUpdateManuscript() } @@ -736,13 +752,17 @@ module.exports = { return mode.canViewPage() }, 'can view only admin': () => false, - read: (userId, operation, object, context) => { + read: async (userId, operation, object, context) => { const mode = new XpubCollabraMode(userId, operation, object, context) - if (object === 'Manuscript') { + if (object === 'Manuscript' || object === 'Review') { return true } + if (object.type === 'Review') { + return mode.isAllowedToReview(object) + } + if (object.type === 'Manuscript') { return mode.canReadManuscript() } diff --git a/server/review/src/resolvers.js b/server/review/src/resolvers.js index b809168e36b472bb8b5dc00dceebb4d0c8d11f27..ab90a6ecc39cf9fcf15ea91d2aadeaafa155e49c 100644 --- a/server/review/src/resolvers.js +++ b/server/review/src/resolvers.js @@ -5,15 +5,20 @@ const resolvers = { Mutation: { async updateReview(_, { id, input }, ctx) { if (id) { - const review = await Review.find(id) + const review = await ctx.connectors.Review.fetchOne(id, ctx) const update = merge({}, review, input) - const updateReview = await new Review(update).save() - updateReview.comments = await updateReview.getComments() - return updateReview + await ctx.connectors.Review.update(id, update, ctx) + // Load Review + const rvw = await new Review(update) + rvw.comments = await rvw.getComments() + + return rvw } input.userId = ctx.user - const review = await new Review(input).save() + const review = await new Review(input) + await review.save() review.comments = await review.getComments() + return review }, },