Skip to content
Snippets Groups Projects
Commit 0dca2405 authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

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

parents 97564df9 adf97472
No related branches found
No related tags found
2 merge requests!58Sprint #20 - Goal - Reviewers submit report,!54HIN-971: Reviewer respond to invitation
......@@ -199,7 +199,7 @@ const parseInvitedHE = (handlingEditor, state, collectionId) =>
const hideCustomIdStatuses = ['draft', 'technicalChecks']
export const parseCollectionDetails = (state, collection) => ({
export const parseCollectionDetails = (state, collection = {}) => ({
...collection,
customId:
!hideCustomIdStatuses.includes(get(collection, 'status', 'draft')) &&
......
......@@ -73,7 +73,7 @@ const ManuscriptCard = ({
</Row>
<Row alignItems="center" justify="flex-start" mb={1}>
<H4>Handling editor</H4>
<Text ml={1} mr={3}>
<Text ml={1} mr={3} whiteSpace="nowrap">
{get(handlingEditor, 'name', 'Unassigned')}
</Text>
{handlingEditor && (
......@@ -143,6 +143,9 @@ const MainContainer = styled.div`
[data-tooltipped] {
overflow: hidden;
}
${H4} {
white-space: nowrap;
}
${H3} {
margin-bottom: 0;
text-overflow: ellipsis;
......
......@@ -21,10 +21,24 @@ const castToBool = author => ({
isCorresponding: isBoolean(author.isCorresponding) && author.isCorresponding,
})
const setCorrespondingAuthor = authors => {
const corresponding = authors.find(a => a.isCorresponding)
return corresponding
? authors
: authors.map(
a =>
a.isSubmitting
? {
...a,
isCorresponding: true,
}
: a,
)
}
const parseEditedAuthors = (editedAuthor, authors) => {
const newAuthor = castToBool(editedAuthor)
return authors.map(
const newAuthors = authors.map(
a =>
a.id === newAuthor.id
? newAuthor
......@@ -35,6 +49,8 @@ const parseEditedAuthors = (editedAuthor, authors) => {
: a.isCorresponding,
},
)
return setCorrespondingAuthor(newAuthors)
}
const WizardAuthors = ({
......@@ -156,7 +172,10 @@ export default compose(
}) => author => ({ hideModal, setModalError }) =>
deleteAuthor(project.id, version.id, author.id)
.then(() => {
setFormAuthors(authors.filter(a => a.id !== author.id))
const newAuthors = setCorrespondingAuthor(
authors.filter(a => a.id !== author.id),
)
setFormAuthors(newAuthors)
hideModal()
})
.catch(() => {
......
......@@ -52,7 +52,7 @@ module.exports = models => async (req, res) => {
})
// check collection status
if (collection.status !== 'submitted') {
if (!['submitted', 'heInvited'].includes(collection.status)) {
return res.status(400).json({
error: `Cannot invite HE while collection is in the status: ${
collection.status
......
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