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

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

parents 7f226f7e 06bad58b
No related branches found
No related tags found
No related merge requests found
...@@ -84,7 +84,7 @@ const createNewUser = async ( ...@@ -84,7 +84,7 @@ const createNewUser = async (
UserModel, UserModel,
role, role,
) => { ) => {
const username = uuid.v4().slice(0, 8) const username = email
const password = uuid.v4() const password = uuid.v4()
const userBody = { const userBody = {
username, username,
......
...@@ -2,13 +2,13 @@ import React from 'react' ...@@ -2,13 +2,13 @@ import React from 'react'
import { get } from 'lodash' import { get } from 'lodash'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { Button, Icon, th } from '@pubsweet/ui' import { Button, Icon, th } from '@pubsweet/ui'
import styled, { css } from 'styled-components' import styled, { css, withTheme } from 'styled-components'
import { compose, getContext } from 'recompose' import { compose, getContext } from 'recompose'
import { parseVersion, parseJournalIssue } from './utils' import { parseVersion, parseJournalIssue } from './utils'
import ZipFiles from './ZipFiles' import ZipFiles from './ZipFiles'
import AssignEditor from './AssignEditor' import HandlingEditorActions from './HandlingEditorActions'
const DashboardCard = ({ const DashboardCard = ({
deleteProject, deleteProject,
...@@ -18,6 +18,7 @@ const DashboardCard = ({ ...@@ -18,6 +18,7 @@ const DashboardCard = ({
showAbstractModal, showAbstractModal,
journal, journal,
cancelSubmission, cancelSubmission,
theme,
...rest ...rest
}) => { }) => {
const { submitted, title, type } = parseVersion(version) const { submitted, title, type } = parseVersion(version)
...@@ -84,7 +85,7 @@ const DashboardCard = ({ ...@@ -84,7 +85,7 @@ const DashboardCard = ({
} }
> >
Details Details
<Icon color="#667080">chevron-right</Icon> <Icon color={theme.colorPrimary}>chevron-right</Icon>
</Details> </Details>
) : ( ) : (
<Details <Details
...@@ -115,53 +116,33 @@ const DashboardCard = ({ ...@@ -115,53 +116,33 @@ const DashboardCard = ({
arr, arr,
) => ( ) => (
<Author key={email}> <Author key={email}>
{isSubmitting && <AuthorStatus>SA</AuthorStatus>}
{isCorresponding &&
!isSubmitting && <AuthorStatus>CA</AuthorStatus>}
<AuthorName> <AuthorName>
{firstName} {middleName} {lastName} {firstName} {middleName} {lastName}
</AuthorName> </AuthorName>
{isSubmitting && <AuthorStatus>SA</AuthorStatus>}
{isCorresponding &&
!isSubmitting && <AuthorStatus>CA</AuthorStatus>}
{arr.length - 1 === index ? '' : ','} {arr.length - 1 === index ? '' : ','}
</Author> </Author>
), ),
)} )}
</AuthorList> </AuthorList>
</Top> </Top>
<div> <Bottom>
Handling editor <LeftDetails flex="5">
<AssignEditor collectionId={project.id} /> <HEText>Handling Editor</HEText>
</div> <HandlingEditorActions project={project} />
</LeftDetails>
</Bottom>
</DetailsView> </DetailsView>
)} )}
</Card> </Card>
) : null ) : null
} }
export default compose( export default compose(getContext({ journal: PropTypes.object }), withTheme)(
getContext({ journal: PropTypes.object }), DashboardCard,
// withModal({ )
// modalComponent: ConfirmationModal,
// }),
// withHandlers({
// cancelSubmission: ({
// showModal,
// deleteProject,
// project,
// hideModal,
// }) => () => {
// const modalConfig = {
// onConfirm: () => {
// deleteProject(project)
// hideModal()
// },
// dismissable: false,
// title: 'Are you sure you want to delete the manuscript?',
// subtitle: 'This operation cannot be undone!',
// }
// showModal(modalConfig)
// },
// }),
)(DashboardCard)
// #region styled-components // #region styled-components
const defaultText = css` const defaultText = css`
...@@ -192,6 +173,7 @@ const AuthorStatus = styled.span` ...@@ -192,6 +173,7 @@ const AuthorStatus = styled.span`
text-align: center; text-align: center;
text-transform: uppercase; text-transform: uppercase;
padding: 0 2px; padding: 0 2px;
margin-left: 4px;
` `
const ActionButtons = styled(Button)` const ActionButtons = styled(Button)`
...@@ -227,7 +209,7 @@ const DetailsView = styled.div` ...@@ -227,7 +209,7 @@ const DetailsView = styled.div`
align-items: center; align-items: center;
border-top: ${th('borderDefault')}; border-top: ${th('borderDefault')};
display: flex; display: flex;
flex-direction: row; flex-direction: column;
justify-content: space-between; justify-content: space-between;
width: 100%; width: 100%;
` `
...@@ -323,9 +305,11 @@ const Status = styled.div` ...@@ -323,9 +305,11 @@ const Status = styled.div`
border: ${th('borderDefault')}; border: ${th('borderDefault')};
${defaultText}; ${defaultText};
font-weight: bold; font-weight: bold;
padding: 0.2em 0.5em; padding: 0 0.5em;
text-align: left; text-align: left;
text-transform: uppercase; text-transform: capitalize;
line-height: 1.5;
color: ${th('colorPrimary')};
` `
const DateField = styled.span` const DateField = styled.span`
...@@ -333,4 +317,10 @@ const DateField = styled.span` ...@@ -333,4 +317,10 @@ const DateField = styled.span`
margin: 0 ${th('subGridUnit')}; margin: 0 ${th('subGridUnit')};
text-align: left; text-align: left;
` `
const HEText = styled.div`
${defaultText};
text-transform: uppercase;
`
// #endregion // #endregion
import React from 'react'
import PropTypes from 'prop-types'
import { Icon, th } from '@pubsweet/ui'
import styled, { css, withTheme } from 'styled-components'
import { compose, getContext } from 'recompose'
import AssignEditor from './AssignEditor'
const HandlingEditorActions = ({ project, theme }) => (
<Root>
<HEActions>
<Icon color={theme.colorPrimary}>refresh-cw</Icon>
<Icon color={theme.colorPrimary}>x-circle</Icon>
<AssignEditor collectionId={project.id} />
</HEActions>
</Root>
)
export default compose(getContext({ journal: PropTypes.object }), withTheme)(
HandlingEditorActions,
)
// #region styled-components
const defaultText = css`
color: ${th('colorText')};
font-family: ${th('fontReading')};
font-size: ${th('fontSizeBaseSmall')};
`
const Root = styled.div``
const HEActions = styled.div`
${defaultText};
text-transform: uppercase;
cursor: pointer;
margin-left: ${th('subGridUnit')};
span {
margin-left: ${th('subGridUnit')};
&:hover {
svg {
opacity: 0.8;
}
}
}
`
// #endregion
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