diff --git a/app/components/submission-wizard/CreatePage.jsx b/app/components/submission-wizard/CreatePage.jsx index eb8ad979dabca9d35f756d15c3d5e6a4f5944d8f..67a6be37f77be5755542446b3876b3348d0de0d6 100755 --- a/app/components/submission-wizard/CreatePage.jsx +++ b/app/components/submission-wizard/CreatePage.jsx @@ -1,5 +1,6 @@ import React from 'react' import { Query } from 'react-apollo' +import { omit } from 'lodash' import styled, { createGlobalStyle } from 'styled-components' import { th, lighten } from '@pubsweet/ui-toolkit' import { Icon, Button, Checkbox, H2 } from '@pubsweet/ui' @@ -181,7 +182,7 @@ class Created extends React.Component { const { currentStep, status, error, checked } = this.state const { manuscript } = this.props const { id: mId, meta, journal, files: allfiles } = manuscript - const { notes } = meta + const { notes, fundingGroup: grants } = meta const files = allfiles ? allfiles.filter( file => @@ -190,6 +191,7 @@ class Created extends React.Component { SubmissionTypes.includes(file.type), ) : [] + const fundingGroup = grants ? grants.map(g => omit(g, ['__typename'])) : [] return ( <SplitPage> <StepPanel> @@ -250,7 +252,7 @@ class Created extends React.Component { changedEmbargo={this.props.updateEmbargo} changedGrants={this.props.updateGrants} selectedEmbargo={meta.releaseDelay} - selectedGrants={meta.fundingGroup} + selectedGrants={fundingGroup} /> )} {currentStep === 3 && ( diff --git a/app/components/submission-wizard/SubmitPage.jsx b/app/components/submission-wizard/SubmitPage.jsx index fbcdc52f230b07c68a118c4d41eb11a8db2e541c..1ee70caf9c5434b3a6db6113862b3aa03f0541b9 100755 --- a/app/components/submission-wizard/SubmitPage.jsx +++ b/app/components/submission-wizard/SubmitPage.jsx @@ -1,5 +1,6 @@ import React from 'react' import { Query } from 'react-apollo' +import { omit } from 'lodash' import styled, { withTheme } from 'styled-components' import { th } from '@pubsweet/ui-toolkit' import { Button, ErrorText, H1, H2, H3, Icon } from '@pubsweet/ui' @@ -135,8 +136,13 @@ class Submit extends React.Component { } = manuscript if (teams && allfiles) { const { editing, references, regexes } = this.state - const fundingGroup = meta.fundingGroup ? meta.fundingGroup : [] - const { releaseDelay = '', unmatchedJournal, notes } = meta + const { + fundingGroup: grants, + releaseDelay = '', + unmatchedJournal, + notes, + } = meta + const fundingGroup = grants ? grants.map(g => omit(g, '__typename')) : [] const files = allfiles ? allfiles.filter( file =>