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

fix(styleguide): fix props and style for ManuscriptHeader

parent 1cf9a415
No related branches found
No related tags found
1 merge request!43Sprint #19
......@@ -22,7 +22,7 @@ const ManuscriptHeader = ({
fragment = {},
manuscriptType = {},
editorInChief = 'Unassigned',
collection: { visibleStatus = 'Draft', handlingEditor, customId },
collection: { visibleStatus = 'Draft', customId },
}) => {
const { authors = [], metadata = {}, submitted = null } = fragment
const { title = 'No title', journal = '', type = '' } = metadata
......@@ -48,17 +48,11 @@ const ManuscriptHeader = ({
<Text customId mr={1}>{`ID ${customId}`}</Text>
{submitted && (
<DateParser durationThreshold={0} timestamp={submitted}>
{timestamp => (
<Text mr={3} secondary>
Submitted on {timestamp}
</Text>
)}
{timestamp => <Text mr={3}>Submitted on {timestamp}</Text>}
</DateParser>
)}
<H4>{manuscriptType.label || type}</H4>
<Text ml={1} secondary>
{journal}
</Text>
<Text>{manuscriptType.label || type}</Text>
<Text ml={1}>{journal}</Text>
</Row>
<Row alignItems="center" justify="flex-start" mb={1}>
<H4>Editor in Chief</H4>
......@@ -104,7 +98,6 @@ export default compose(
withHandlers({
renderHE: ({
inviteHE,
revokeHE,
isFetching,
heInvitation,
resendInvitation,
......@@ -112,7 +105,7 @@ export default compose(
pendingInvitation,
handlingEditors = [],
currentUser: { canAssignHE },
collection: { handlingEditor, invitations = [] },
collection: { handlingEditor },
}) => () => {
if (pendingInvitation) {
const person = chain(handlingEditors)
......
......@@ -53,6 +53,10 @@ const fragment = {
},
}
const currentUser = {
canAssignHE: true,
}
const journal = {
manuscriptTypes: [
{
......@@ -70,12 +74,14 @@ const journal = {
abstractRequired: true,
},
],
};
}
<ManuscriptHeader
;<ManuscriptHeader
collection={collection}
fragment={fragment}
journal={journal}
currentUser={currentUser}
handlingEditors={[]}
inviteHE={() => console.log('go to invite HE ctx box')}
revokeInvitation={id => console.log('revoke invitation', id)}
resendInvitation={id => console.log('resend invitation', id)}
......@@ -129,18 +135,21 @@ const collection = {
role: 'handlingEditor',
type: 'invitation',
reason: 'because',
userId: 'cb7e3e26-6a09-4b79-a6ff-4d1235ee2381',
userId: 'he-1',
hasAnswer: false,
invitedOn: 1533713919119,
isAccepted: false,
person: {
id: 'cb7e3e26-6a09-4b79-a6ff-4d1235ee2381',
name: 'Toto Schilacci',
},
},
],
}
const handlingEditors=[{
id: 'he-1',
firstName: 'Handlington',
lastName: 'Ignashevici',
name: 'Handlington Ignashevici',
}]
const fragment = {
authors,
created: Date.now(),
......@@ -152,6 +161,10 @@ const fragment = {
},
}
const currentUser = {
canAssignHE: true,
}
const journal = {
manuscriptTypes: [
{
......@@ -169,12 +182,14 @@ const journal = {
abstractRequired: true,
},
],
};
}
<ManuscriptHeader
;<ManuscriptHeader
collection={collection}
fragment={fragment}
journal={journal}
currentUser={currentUser}
handlingEditors={handlingEditors}
inviteHE={() => console.log('go to invite HE ctx box')}
revokeInvitation={id => console.log('revoke invitation', id)}
resendInvitation={id => console.log('resend invitation', id)}
......@@ -233,10 +248,6 @@ const collection = {
invitedOn: 1533713919119,
isAccepted: true,
respondedOn: 1533714034932,
person: {
id: 'cb7e3e26-6a09-4b79-a6ff-4d1235ee2381',
name: 'Toto Schilacci',
},
},
],
}
......@@ -252,6 +263,8 @@ const fragment = {
},
}
const currentUser = {}
const journal = {
manuscriptTypes: [
{
......@@ -269,12 +282,13 @@ const journal = {
abstractRequired: true,
},
],
};
}
<ManuscriptHeader
;<ManuscriptHeader
collection={collection}
fragment={fragment}
journal={journal}
currentUser={currentUser}
inviteHE={() => console.log('go to invite HE ctx box')}
revokeInvitation={id => console.log('revoke invitation', id)}
resendInvitation={id => console.log('resend invitation', id)}
......
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