Commit f9c81784 authored by Giannis Kopanas's avatar Giannis Kopanas

Merge branch 'fix-colabra-submit' into 'master'

fix submit form

See merge request !252
parents 2d5deb4d 8c7caffd
Pipeline #11053 passed with stages
in 6 minutes and 30 seconds
{"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 &lt;a href=\"https://www.collabra.org/about/editorialpolicies/#open-data-open-analytic-methods-code-and-research-materials-transparency\" target=\"_blank\"&gt;here&lt;/a&gt;. 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 &lt;a href=\"https://www.collabra.org/about/editorialpolicies/#open-peer-review\" target=\"_blank\"&gt;“Open Review”&lt;/a&gt; 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 &lt;a href=\"https://www.collabra.org/about/editorialpolicies/#streamlined-review\" target=\"_blank\"&gt;“Streamlined Review”&lt;/a&gt; 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 &lt;a href=\"https://www.collabra.org/about/editorialpolicies/#preregistration-of-studies-and-analysis-plans\" target=\"_blank\"&gt;guidelines&lt;/a&gt;.</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>&lt;pre&gt;There are 3 types of item which should be uploaded here:&lt;br /&gt;</p><p>&lt;ul&gt;</p><p>&lt;li&gt;Regular figures which should also be be embedded in the manuscript.(These are helpful for the production&lt;br /&gt;process,if your article is accepted, in case there are any issues with the embedded versions.)&lt;/li&gt;</p><p>&lt;li&gt;Supplemental items that provide a relevant and useful expansion of the article (Examples include appendices,&lt;br/&gt;very large tables, audios, videos, three-dimensional visualizations, interactive graphics, and so on.)&lt;/li&gt;</p><p>&lt;li&gt;Items that support the peer review process. (Examples are ported reviews and decision letters for use during&lt;br /&gt;the Streamlined Review workflow. Also, if you have a long cover letter you would rather upload than paste&lt;br/&gt;into the text box, please also upload it here.)&lt;/li&gt;</p><p>&lt;/ul&gt;</p><p>Supplemental materials can be named in almost any way, provided that the files are clearly and consistently named,&lt;br /&gt;are uploaded in chronological order, and grouped as they are described above. For example, a typical article&lt;br/&gt;might include:</p><p>&lt;br /&gt;</p><p>&lt;ul&gt;</p><p>&lt;li&gt;Figure 1.jpg&lt;/li&gt;</p><p>&lt;li&gt;Figure 2.jpg&lt;/li&gt;</p><p>&lt;li&gt;Figure 3.jpg&lt;/li&gt;</p><p>&lt;li&gt;Supplemental Table 1.docx&lt;/li&gt;</p><p>&lt;li&gt;Ported Decision Letter and Reviews from Journal X.docx&lt;/li&gt;</p><p>&lt;/ul&gt;</p><p>&lt;/pre&gt;</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 &lt;a href=\"https://www.crossref.org/services/similarity-check/\" rel=\"noopener noreferrer\" target=\"_blank\"&gt;CrossCheck&lt;/a&gt; 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 &lt;a href=\"https://www.crossref.org/services/similarity-check/\" rel=\"noopener noreferrer\" target=\"_blank\"&gt;CrossCheck&lt;/a&gt; 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 &lt;a href=\"https://www.collabra.org/about/editorialpolicies/#open-data-open-analytic-methods-code-and-research-materials-transparency\" target=\"_blank\"&gt;here&lt;/a&gt;. 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 &lt;a href=\"https://www.collabra.org/about/editorialpolicies/#open-peer-review\" target=\"_blank\"&gt;“Open Review”&lt;/a&gt; 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 &lt;a href=\"https://www.collabra.org/about/editorialpolicies/#streamlined-review\" target=\"_blank\"&gt;“Streamlined Review”&lt;/a&gt; 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 &lt;a href=\"https://www.collabra.org/about/editorialpolicies/#preregistration-of-studies-and-analysis-plans\" target=\"_blank\"&gt;guidelines&lt;/a&gt;.</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>&lt;pre&gt;There are 3 types of item which should be uploaded here:&lt;br /&gt;</p><p>&lt;ul&gt;</p><p>&lt;li&gt;Regular figures which should also be be embedded in the manuscript.(These are helpful for the production&lt;br /&gt;process,if your article is accepted, in case there are any issues with the embedded versions.)&lt;/li&gt;</p><p>&lt;li&gt;Supplemental items that provide a relevant and useful expansion of the article (Examples include appendices,&lt;br/&gt;very large tables, audios, videos, three-dimensional visualizations, interactive graphics, and so on.)&lt;/li&gt;</p><p>&lt;li&gt;Items that support the peer review process. (Examples are ported reviews and decision letters for use during&lt;br /&gt;the Streamlined Review workflow. Also, if you have a long cover letter you would rather upload than paste&lt;br/&gt;into the text box, please also upload it here.)&lt;/li&gt;</p><p>&lt;/ul&gt;</p><p>Supplemental materials can be named in almost any way, provided that the files are clearly and consistently named,&lt;br /&gt;are uploaded in chronological order, and grouped as they are described above. For example, a typical article&lt;br/&gt;might include:</p><p>&lt;br /&gt;</p><p>&lt;ul&gt;</p><p>&lt;li&gt;Figure 1.jpg&lt;/li&gt;</p><p>&lt;li&gt;Figure 2.jpg&lt;/li&gt;</p><p>&lt;li&gt;Figure 3.jpg&lt;/li&gt;</p><p>&lt;li&gt;Supplemental Table 1.docx&lt;/li&gt;</p><p>&lt;li&gt;Ported Decision Letter and Reviews from Journal X.docx&lt;/li&gt;</p><p>&lt;/ul&gt;</p><p>&lt;/pre&gt;</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 &lt;a href=\"https://www.crossref.org/services/similarity-check/\" rel=\"noopener noreferrer\" target=\"_blank\"&gt;CrossCheck&lt;/a&gt; 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 &lt;a href=\"https://www.crossref.org/services/similarity-check/\" rel=\"noopener noreferrer\" target=\"_blank\"&gt;CrossCheck&lt;/a&gt; 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
......@@ -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()
}
......
......@@ -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
},
},
......
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