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

refactor(details): refactor showing Make decision button

parent 2c9c8b9f
No related branches found
No related tags found
1 merge request!8Sprint #10
...@@ -60,7 +60,7 @@ const ManuscriptLayout = ({ ...@@ -60,7 +60,7 @@ const ManuscriptLayout = ({
</Container> </Container>
<SideBar flex={1}> <SideBar flex={1}>
<SideBarActions <SideBarActions
currentUser={currentUser} currentUserIs={currentUserIs}
project={project} project={project}
version={version} version={version}
/> />
......
...@@ -96,6 +96,8 @@ export default compose( ...@@ -96,6 +96,8 @@ export default compose(
switch (type) { switch (type) {
case 'staff': case 'staff':
return isAdmin || isEic || isHe return isAdmin || isEic || isHe
case 'adminEiC':
return isAdmin || isEic
default: default:
return false return false
} }
......
import React from 'react' import React from 'react'
import { th, Icon } from '@pubsweet/ui' import { th, Icon } from '@pubsweet/ui'
import styled from 'styled-components' import styled from 'styled-components'
import { get } from 'lodash'
import ZipFiles from 'pubsweet-components-faraday/src/components/Dashboard/ZipFiles' import ZipFiles from 'pubsweet-components-faraday/src/components/Dashboard/ZipFiles'
import { MakeDecision } from './' import { MakeDecision } from './'
const SideBarActions = ({ project, version, currentUser }) => { const SideBarActions = ({ project, version, currentUserIs }) => (
const isAdmin = get(currentUser, 'admin') <Root>
const isEic = get(currentUser, 'editorInChief') {currentUserIs('adminEiC') ? <MakeDecision /> : <div />}
return ( <ZipFiles archiveName={`ID-${project.customId}`} fragmentId={version.id}>
<Root> <ClickableIcon>
{isEic || isAdmin ? <MakeDecision /> : <div />} <Icon>download</Icon>
<ZipFiles archiveName={`ID-${project.customId}`} fragmentId={version.id}> </ClickableIcon>
<ClickableIcon> </ZipFiles>
<Icon>download</Icon> </Root>
</ClickableIcon> )
</ZipFiles>
</Root>
)
}
export default SideBarActions export default SideBarActions
......
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