Skip to content
Snippets Groups Projects
Commit 34aacf49 authored by Audrey Hamelers's avatar Audrey Hamelers
Browse files

remove default graphQL typename, explicitly request for article IDs

parent 121093a7
No related branches found
No related tags found
4 merge requests!380Pipeline changes,!379Build step added for the master branch,!378k8s release,!376#1183
......@@ -16,6 +16,7 @@ import './assets/favicon.ico'
const makeConfig = config => {
config.cache = new InMemoryCache({
addTypename: false,
typePolicies: {
ArticleId: {
keyFields: ['pubIdType', 'id'],
......
import React from 'react'
import { omit } from 'lodash'
import { withTheme } from 'styled-components'
import { Button } from '@pubsweet/ui'
import { Portal, Buttons, CloseModal } from '../ui'
......@@ -32,14 +31,7 @@ const MetaEdit = withTheme(
...props
}) => {
const { meta } = manuscript
const { fundingGroup: grants, releaseDelay, notes } = meta
const fundingGroup = grants
? grants.map(g => {
const n = omit(g, '__typename')
n.pi = omit(g.pi, '__typename')
return n
})
: []
const { fundingGroup = [], releaseDelay, notes } = meta
if (toEdit === 'dupes' && duplicates) {
return (
......
......@@ -71,6 +71,7 @@ const DashboardFragment = gql`
articleIds {
pubIdType
id
__typename
}
publicationDates {
type
......
......@@ -64,6 +64,7 @@ export const ManuscriptFragment = gql`
articleIds {
pubIdType
id
__typename
}
publicationDates {
type
......
import React from 'react'
import { withRouter } from 'react-router'
import { Query } from 'react-apollo'
import { omit } from 'lodash'
import { createBrowserHistory } from 'history'
import styled, { createGlobalStyle } from 'styled-components'
import { th } from '@pubsweet/ui-toolkit'
......@@ -229,7 +228,7 @@ class Created extends React.Component {
const { manuscript, history, changeNote, deleteNote, newNote } = this.props
const { meta, journal, files: allfiles, teams, organization } = manuscript
const preprint = organization.name === 'Europe PMC Preprints'
const { notes, fundingGroup: grants, articleIds } = meta
const { notes, fundingGroup = [], articleIds } = meta
const files = allfiles
? allfiles.filter(
file =>
......@@ -239,13 +238,6 @@ class Created extends React.Component {
)
: []
const pdfSend = allfiles && allfiles.find(f => f.type === 'pdf4load')
const fundingGroup = grants
? grants.map(g => {
const n = omit(g, '__typename')
n.pi = omit(g.pi, '__typename')
return n
})
: []
const reviewerNote = notes
? notes.find(n => n.notesType === 'selectedReviewer')
: null
......
import React from 'react'
import { omit } from 'lodash'
import styled from 'styled-components'
import { th } from '@pubsweet/ui-toolkit'
import { Button, Steps } from '@pubsweet/ui'
......@@ -103,20 +102,7 @@ class EditFundingAccess extends React.Component {
currentUser,
} = this.props
const { journal, meta, status } = manuscript
const {
articleIds,
releaseDelay,
title,
fundingGroup: grants,
notes,
} = meta
const fundingGroup = grants
? grants.map(g => {
const n = omit(g, '__typename')
n.pi = omit(g.pi, '__typename')
return n
})
: []
const { articleIds, releaseDelay, title, fundingGroup = [], notes } = meta
const planS = notes && notes.find(n => n.notesType === 'planS')
const pmid = articleIds && articleIds.find(aid => aid.pubIdType === 'pmid')
const pmcid =
......
......@@ -22,6 +22,7 @@ export const CREATE_MANUSCRIPT = gql`
articleIds {
pubIdType
id
__typename
}
publicationDates {
type
......
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