Skip to content
Snippets Groups Projects

Hin 1124

Merged Tania Fecheta requested to merge HIN-1124 into develop
3 files
+ 23
3
Compare changes
  • Side-by-side
  • Inline
Files
3
import { selectCurrentUser } from 'xpub-selectors'
import { get, has, last, chain, some } from 'lodash'
import { get, has, last, chain, some, isEmpty } from 'lodash'
export const isHEToManuscript = (state, collectionId = '') => {
const { id = '', isAccepted = false } = chain(state)
@@ -181,6 +181,20 @@ export const canViewEditorialComments = (
)
}
const cannotViewResponseFromAuthorStatuses = ['reviewersInvited']
export const canViewResponseFromAuthor = (state, collection, fragmentId) => {
const authorResponseToRevisonRequest = getFragmentAuthorResponse(
state,
fragmentId,
)
return (
!isEmpty(authorResponseToRevisonRequest) &&
!cannotViewResponseFromAuthorStatuses.includes(
get(collection, 'status', 'draft'),
)
)
}
export const getUserToken = ({ currentUser }) =>
get(currentUser, 'user.token', '')