Commit 6e423064 authored by Yannis Barlas's avatar Yannis Barlas

Merge branch 'fix-console-warnings' into 'master'

Fix console warnings

See merge request !353
parents 4f4491a4 a27d938b
Pipeline #8390 passed with stages
in 28 minutes and 46 seconds
......@@ -63,7 +63,7 @@ export class Authorize extends React.Component {
Authorize.propTypes = {
currentUser: PropTypes.object,
operation: PropTypes.string,
object: PropTypes.object,
object: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
children: PropTypes.element,
unauthorized: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
authsome: PropTypes.object.isRequired,
......
......@@ -38,7 +38,7 @@ const Dashboard = ({
object={dashboard}
operation="can view my submission section"
>
{dashboard.length > 0 && (
{dashboard.length > 0 ? (
<Section>
<Heading>My Submissions</Heading>
{dashboard.map(project => (
......@@ -54,11 +54,11 @@ const Dashboard = ({
/>
))}
</Section>
)}
) : null}
</Authorize>
<Authorize object={dashboard} operation="can view review section">
{dashboard.length > 0 && (
{dashboard.length > 0 ? (
<Section>
<Heading>To review</Heading>
{dashboard.map(project => (
......@@ -70,7 +70,7 @@ const Dashboard = ({
/>
))}
</Section>
)}
) : null}
</Authorize>
<Authorize
......@@ -78,7 +78,7 @@ const Dashboard = ({
object={dashboard}
operation="can view my manuscripts section"
>
{dashboard.length > 0 && (
{dashboard.length > 0 ? (
<Section>
<Heading>My Manuscripts</Heading>
{dashboard.map(project => (
......@@ -88,7 +88,7 @@ const Dashboard = ({
/>
))}
</Section>
)}
) : null}
</Authorize>
</Page>
)
......
......@@ -4,7 +4,9 @@ import Dropzone from 'react-dropzone'
import { Icon } from '@pubsweet/ui'
import { th } from '@pubsweet/ui-toolkit'
const StyledDropzone = styled(Dropzone)`
const StyledDropzone = styled(({ disableUpload, ...props }) => (
<Dropzone {...props} />
))`
border: none;
cursor: pointer;
display: inline-block;
......@@ -205,7 +207,7 @@ class UploadManuscript extends Component {
return (
<StyledDropzone
accept="application/vnd.openxmlformats-officedocument.wordprocessingml.document"
disableUpload={this.status === 'converting'}
disableUpload={this.status === 'converting' ? 'disableUpload' : null}
onDrop={uploadManuscript}
>
<Root>
......@@ -217,13 +219,11 @@ class UploadManuscript extends Component {
{this.state.error ? (
<Error>{conversion.error.message}</Error>
) : (
[
<Info>
{this.state.completed
? 'Submission created'
: 'Submit Manuscript'}
</Info>,
]
<Info>
{this.state.completed
? 'Submission created'
: 'Submit Manuscript'}
</Info>
)}
</Main>
<SubInfo>
......
......@@ -20,9 +20,21 @@ const OwnerItem = ({ project, version, deleteProject }) => {
const manuscriptLink = `${baseLink}/manuscript`
const actionButtons = {
submit: <Action to={submitLink}>Summary Info</Action>,
manuscript: <Action to={manuscriptLink}>Manuscript</Action>,
delete: <Action onClick={() => deleteProject(project)}>Delete</Action>,
submit: (
<Action key="submit-action" to={submitLink}>
Summary Info
</Action>
),
manuscript: (
<Action key="manuscript-action" to={manuscriptLink}>
Manuscript
</Action>
),
delete: (
<Action key="delete-action" onClick={() => deleteProject(project)}>
Delete
</Action>
),
}
const unauthorized = (
......
......@@ -115,6 +115,7 @@ class Editor extends React.Component {
placeholderClassName,
title,
readonly,
fileUpload,
...remainingProps
} = this.props
const { state } = this.state
......
......@@ -22,11 +22,11 @@ const minChars100 = minChars(100)
const maxChars500 = maxChars(500)
const maxChars5000 = maxChars(5000)
const TitleInput = input => (
const TitleInput = ({ validationStatus, ...input }) => (
<TitleEditor placeholder="Enter the title…" title="Title" {...input} />
)
const AbstractInput = input => (
const AbstractInput = ({ validationStatus, ...input }) => (
<AbstractEditor
placeholder="Enter the abstract…"
title="Abstract"
......
......@@ -16,7 +16,9 @@ const stripHtml = htmlString => {
return temp.textContent
}
const Input = extraProps => input => <NoteEditor {...input} {...extraProps} />
const Input = extraProps => ({ validationStatus, ...input }) => (
<NoteEditor {...input} {...extraProps} />
)
const Notes = ({ readonly, journal }) => (
<FormSection name="notes">
......
Markdown is supported
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