Skip to content
Snippets Groups Projects
Commit e05256e4 authored by Sebastian's avatar Sebastian
Browse files

Merge branch 'develop' of gitlab.coko.foundation:xpub/xpub-faraday into develop

parents 5a999195 962f9c5d
No related branches found
No related tags found
1 merge request!6Agree/Decline to work on a manuscript
......@@ -45,6 +45,14 @@ const submitManuscript = (
...values,
}),
)
.then(() =>
dispatch(
actions.updateCollection({
id: project.id,
status: 'submitted',
}),
),
)
.then(() => {
history.push(redirectPath, { project: project.id, version: version.id })
})
......
......@@ -34,7 +34,6 @@ const DashboardCard = ({
...rest
}) => {
const { submitted, title, type } = parseVersion(version)
const status = get(project, 'status')
const metadata = get(version, 'metadata')
const files = get(version, 'files')
const customId = project.customId || project.id.split('-')[0]
......@@ -81,7 +80,7 @@ const DashboardCard = ({
</Top>
<Bottom>
<LeftDetails flex="3">
<Status>{mapStatusToLabel(status)}</Status>
<Status>{mapStatusToLabel(project)}</Status>
<DateField>{submitted || ''}</DateField>
</LeftDetails>
<RightDetails flex="4">
......@@ -197,22 +196,22 @@ export default compose(
// this can be changed, but it works; cba
if (isAdmin || isEic) {
if (status === 'submitted' || status === 'he-invited')
if (status === 'submitted' || status === 'heInvited')
return <EditorInChiefActions project={project} />
if (status === 'under-review')
if (status === 'underReview')
return <AssignedHE>{get(handlingEditor, 'name')}</AssignedHE>
return <div />
}
if (isHe) {
if (status === 'he-invited')
if (status === 'heInvited')
return (
<HandlingEditorActions
currentUser={currentUser}
project={project}
/>
)
if (status === 'under-review')
if (status === 'underReview' || status === 'heAssigned')
return <AssignedHE>{get(handlingEditor, 'name')}</AssignedHE>
}
},
......
......@@ -76,6 +76,7 @@ export default compose(
type: modalType,
title: 'Agree to handling editor assignment',
subtitle: `Clicking "Agree" will assign you as Handling Editor for this Manuscript.`,
confirmText: 'Agree',
onConfirm: () => {
handlingEditorDecision(invitation.id, project.id, true).then(() => {
getCollections()
......
import moment from 'moment'
import { get, find } from 'lodash'
import { get, find, capitalize } from 'lodash'
export const parseTitle = version => {
const title = get(version, 'metadata.title')
......@@ -43,7 +43,7 @@ export const parseVersion = version => ({
export const parseJournalIssue = (journal, metadata) =>
journal.issueTypes.find(t => t.value === get(metadata, 'issue'))
export const mapStatusToLabel = status => {
export const mapStatusToLabel2 = status => {
switch (status) {
case 'he-invited':
return 'Handling Editor Assigned'
......@@ -56,6 +56,15 @@ export const mapStatusToLabel = status => {
}
}
export const mapStatusToLabel = ({ visibleStatus, status }) => {
if (visibleStatus) {
return visibleStatus
} else if (status) {
return capitalize(status)
}
return 'Draft'
}
export const handleError = fn => e => {
fn(get(JSON.parse(e.response), 'error') || 'Oops! Something went wrong!')
}
......
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