From 12ea454ee984c98eda598f2f37db501f73609367 Mon Sep 17 00:00:00 2001
From: ahamelers <audrey@ahamelers.com>
Date: Thu, 24 Jan 2019 17:03:32 +0000
Subject: [PATCH] #211

---
 app/components/submission-wizard/CreatePage.jsx |  6 ++++--
 app/components/submission-wizard/SubmitPage.jsx | 10 ++++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/app/components/submission-wizard/CreatePage.jsx b/app/components/submission-wizard/CreatePage.jsx
index eb8ad979d..67a6be37f 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 fbcdc52f2..1ee70caf9 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 =>
-- 
GitLab