Skip to content
Snippets Groups Projects
Commit 6b3a62f2 authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

feat(journal): add journal name on manuscript creation

style manuscript card and details for journal name
parent 3a9b8902
No related branches found
No related tags found
1 merge request!43Sprint #19
......@@ -34,7 +34,7 @@ const ManuscriptCard = ({
id: fragmentId,
submitted = null,
} = fragment
const { title = 'No title', journal = '', type = '' } = metadata
const { title = 'No title', journal, type = '' } = metadata
return (
<Root data-test-id={`fragment-${fragmentId}`} onClick={onCardClick}>
<MainContainer>
......@@ -59,7 +59,11 @@ const ManuscriptCard = ({
</DateParser>
)}
<Text>{manuscriptType.label || type}</Text>
<Text ml={1}>{journal}</Text>
{journal && (
<Text journal ml={1}>
{journal}
</Text>
)}
</Row>
<Row alignItems="center" justify="flex-start" mb={1}>
<H4>Handling editor</H4>
......
......@@ -38,6 +38,16 @@ const textHelper = props => {
}
`
}
if (has(props, 'journal')) {
return css`
color: ${th('colorSecondary')};
font-family: ${th('fontReading')};
&:before {
content: '•';
padding-right: ${th('gridUnit')};
}
`
}
return css`
color: ${th('colorText')};
font-family: ${th('fontReading')};
......
......@@ -47,7 +47,9 @@ const ManuscriptHeader = ({
</DateParser>
)}
<Text>{manuscriptType.label || type}</Text>
<Text ml={1}>{journal}</Text>
<Text journal ml={1}>
{journal}
</Text>
</Row>
<Row alignItems="center" justify="flex-start" mb={1}>
<H4>Editor in Chief</H4>
......
......@@ -4,7 +4,7 @@ import { th } from '@pubsweet/ui-toolkit'
import { H2, Button, Spinner } from '@pubsweet/ui'
import { compose, setDisplayName, withHandlers } from 'recompose'
import { IconButton, Text } from '../'
import { IconButton, Text, Row } from '../'
const MultiAction = ({
title,
......@@ -27,7 +27,7 @@ const MultiAction = ({
{modalError}
</Text>
)}
<Buttons isFetching={isFetching}>
<Row mt={1}>
{isFetching ? (
<Spinner size={3} />
) : (
......@@ -38,7 +38,7 @@ const MultiAction = ({
</Button>
</Fragment>
)}
</Buttons>
</Row>
</Root>
)
......@@ -90,11 +90,4 @@ const Root = styled.div`
margin-bottom: ${th('gridUnit')};
}
`
const Buttons = styled.div`
display: flex;
justify-content: ${props => (props.isFetching ? 'center' : 'space-evenly')};
margin-top: calc(${th('gridUnit')} * 3);
width: 70%;
`
// #endregion
import moment from 'moment'
import { pick } from 'lodash'
import { pick, get } from 'lodash'
import { actions } from 'pubsweet-client'
import { create, update } from 'pubsweet-client/src/helpers/api'
import journalConfig from 'xpub-faraday/app/config/journal'
/* constants */
export const CREATE_DRAFT_REQUEST = 'CREATE_DRAFT_REQUEST'
......@@ -61,7 +62,9 @@ export const createDraftSubmission = history => (dispatch, getState) => {
coverLetter: [],
},
fragmentType: 'version',
metadata: {},
metadata: {
journal: get(journalConfig, 'metadata.nameText', ''),
},
version: 1,
}),
).then(({ fragment }) => {
......
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