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

fix: cr feedback

parent c050d36d
No related branches found
No related tags found
2 merge requests!58Sprint #20 - Goal - Reviewers submit report,!48Hin 934 invite he on submitted
...@@ -183,15 +183,23 @@ const parseInvitedHE = (handlingEditor, state, collectionId) => ...@@ -183,15 +183,23 @@ const parseInvitedHE = (handlingEditor, state, collectionId) =>
? 'Invited' ? 'Invited'
: handlingEditor.name, : handlingEditor.name,
} }
const hideCustomIdStatuses = ['draft', 'technicalChecks'] const hideCustomIdStatuses = ['draft', 'technicalChecks']
export const newestFirstParseDashboard = (state, items) =>
chain(items) export const parseCollectionDetails = (state, collection) => ({
...collection,
customId:
!hideCustomIdStatuses.includes(get(collection, 'status', 'draft')) &&
collection.customId,
handlingEditor: parseInvitedHE(
collection.handlingEditor,
state,
collection.id,
),
})
export const newestFirstParseDashboard = (state = {}) =>
chain(state.collections)
.orderBy(['created'], ['desc']) .orderBy(['created'], ['desc'])
.map(item => ({ .map(item => parseCollectionDetails(state, item))
...item,
customId:
!hideCustomIdStatuses.includes(get(item, 'status', 'draft')) &&
item.customId,
handlingEditor: parseInvitedHE(item.handlingEditor, state, item.id),
}))
.value() .value()
...@@ -26,7 +26,7 @@ const ManuscriptCard = ({ ...@@ -26,7 +26,7 @@ const ManuscriptCard = ({
onCardClick, onCardClick,
fragment = {}, fragment = {},
manuscriptType = {}, manuscriptType = {},
collection: { visibleStatus = 'Draft', handlingEditor, customId }, collection: { visibleStatus = 'Draft', handlingEditor, customId, id: collId },
}) => { }) => {
const { const {
authors = [], authors = [],
...@@ -82,7 +82,7 @@ const ManuscriptCard = ({ ...@@ -82,7 +82,7 @@ const ManuscriptCard = ({
<Item justify="flex-end" onClick={e => e.stopPropagation()}> <Item justify="flex-end" onClick={e => e.stopPropagation()}>
<OpenModal <OpenModal
confirmText="Delete" confirmText="Delete"
modalKey={`delete-${customId}`} modalKey={`delete-${collId}`}
onConfirm={onDelete} onConfirm={onDelete}
title="Are you sure you want to delete this submission?" title="Are you sure you want to delete this submission?"
> >
......
...@@ -40,7 +40,7 @@ const ManuscriptHeader = ({ ...@@ -40,7 +40,7 @@ const ManuscriptHeader = ({
</Row> </Row>
)} )}
<Row alignItems="center" justify="flex-start" mb={1}> <Row alignItems="center" justify="flex-start" mb={1}>
<Text customId mr={1}>{`ID ${customId}`}</Text> {customId && <Text customId mr={1}>{`ID ${customId}`}</Text>}
{submitted && ( {submitted && (
<DateParser durationThreshold={0} timestamp={submitted}> <DateParser durationThreshold={0} timestamp={submitted}>
{timestamp => <Text mr={3}>Submitted on {timestamp}</Text>} {timestamp => <Text mr={3}>Submitted on {timestamp}</Text>}
......
...@@ -37,6 +37,7 @@ import { ...@@ -37,6 +37,7 @@ import {
pendingHEInvitation, pendingHEInvitation,
currentUserIsReviewer, currentUserIsReviewer,
canMakeRecommendation, canMakeRecommendation,
parseCollectionDetails,
canOverrideTechnicalChecks, canOverrideTechnicalChecks,
} from 'pubsweet-component-faraday-selectors' } from 'pubsweet-component-faraday-selectors'
import { RemoteOpener } from 'pubsweet-component-faraday-ui' import { RemoteOpener } from 'pubsweet-component-faraday-ui'
...@@ -72,7 +73,10 @@ export default compose( ...@@ -72,7 +73,10 @@ export default compose(
handlingEditors: selectHandlingEditors(state), handlingEditors: selectHandlingEditors(state),
hasManuscriptFailure: hasManuscriptFailure(state), hasManuscriptFailure: hasManuscriptFailure(state),
fragment: selectFragment(state, match.params.version), fragment: selectFragment(state, match.params.version),
collection: selectCollection(state, match.params.project), collection: parseCollectionDetails(
state,
selectCollection(state, match.params.project),
),
pendingHEInvitation: pendingHEInvitation(state, match.params.project), pendingHEInvitation: pendingHEInvitation(state, match.params.project),
editorialRecommendations: selectEditorialRecommendations( editorialRecommendations: selectEditorialRecommendations(
state, state,
......
...@@ -21,7 +21,7 @@ export default compose( ...@@ -21,7 +21,7 @@ export default compose(
state => { state => {
const { collections, conversion } = state const { collections, conversion } = state
const currentUser = selectCurrentUser(state) const currentUser = selectCurrentUser(state)
const dashboard = newestFirstParseDashboard(state, collections) const dashboard = newestFirstParseDashboard(state)
const userPermissions = getUserPermissions(state) const userPermissions = getUserPermissions(state)
return { return {
......
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