Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Kotahi
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Omo Oaiya
Kotahi
Commits
b9f30491
Commit
b9f30491
authored
3 years ago
by
Ben Whitmore
Browse files
Options
Downloads
Patches
Plain Diff
fix(manuscript): fix page crash on viewing accepted submission
parent
5b3878ed
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/components/component-submit/src/components/CurrentVersion.js
+0
-41
0 additions, 41 deletions
...ponents/component-submit/src/components/CurrentVersion.js
app/components/component-submit/src/components/Submit.js
+26
-4
26 additions, 4 deletions
app/components/component-submit/src/components/Submit.js
with
26 additions
and
45 deletions
app/components/component-submit/src/components/CurrentVersion.js
deleted
100644 → 0
+
0
−
41
View file @
5b3878ed
import
React
from
'
react
'
// import styled from 'styled-components'
// import { Link } from 'react-router-dom'
// import { Attachment } from '@pubsweet/ui'
// import { th } from '@pubsweet/ui-toolkit'
// import Metadata from './MetadataFields'
// import Declarations from './Declarations'
// import Suggestions from './Suggestions'
// import SupplementaryFiles from './SupplementaryFiles'
import
Metadata
from
'
../../../component-review/src/components/metadata/ReviewMetadata
'
// import { Legend } from '../style'
// import {
// Section,
// SectionHeader,
// SectionContent,
// SectionRow,
// Title,
// } from '../../../shared'
// const filterFileManuscript = files =>
// files.filter(
// file =>
// file.type === 'manuscript' &&
// file.mimeType ===
// 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
// )
// Due to migration to new Data Model
// Attachement component needs different data structure to work
// needs to change the pubsweet ui Attachement to support the new Data Model
// const filesToAttachment = file => ({
// name: file.filename,
// url: file.url,
// })
const
CurrentVersion
=
({
journal
,
forms
,
manuscript
})
=>
(
<
Metadata
manuscript
=
{
manuscript
}
/
>
)
export
default
CurrentVersion
This diff is collapsed.
Click to expand it.
app/components/component-submit/src/components/Submit.js
+
26
−
4
View file @
b9f30491
...
...
@@ -2,10 +2,10 @@ import React from 'react'
import
PropTypes
from
'
prop-types
'
import
{
Formik
}
from
'
formik
'
import
{
set
}
from
'
lodash
'
import
CurrentVersion
from
'
./CurrentVersion
'
import
DecisionAndReviews
from
'
./DecisionAndReviews
'
import
CreateANewVersion
from
'
./CreateANewVersion
'
import
FormTemplate
from
'
./FormTemplate
'
import
ReviewMetadata
from
'
../../../component-review/src/components/metadata/ReviewMetadata
'
import
MessageContainer
from
'
../../../component-chat/src
'
import
{
SectionContent
,
...
...
@@ -20,7 +20,12 @@ import {
// TODO: Improve the import, perhaps a shared component?
import
EditorSection
from
'
../../../component-review/src/components/decision/EditorSection
'
const
SubmittedVersion
=
({
manuscript
,
currentVersion
,
createNewVersion
})
=>
{
const
SubmittedVersion
=
({
manuscript
,
currentVersion
,
createNewVersion
,
form
,
})
=>
{
const
reviseDecision
=
currentVersion
&&
manuscript
.
status
===
'
revise
'
return
(
<>
...
...
@@ -32,7 +37,7 @@ const SubmittedVersion = ({ manuscript, currentVersion, createNewVersion }) => {
/
>
)}
<
DecisionAndReviews
manuscript
=
{
manuscript
}
noGap
=
{
!
reviseDecision
}
/
>
<
CurrentVersion
manuscript
=
{
manuscript
}
/
>
<
ReviewMetadata
form
=
{
form
}
manuscript
=
{
manuscript
}
/
>
<
/
>
)
}
...
...
@@ -41,6 +46,17 @@ SubmittedVersion.propTypes = {
manuscript
:
PropTypes
.
objectOf
(
PropTypes
.
any
),
currentVersion
:
PropTypes
.
bool
.
isRequired
,
createNewVersion
:
PropTypes
.
func
.
isRequired
,
form
:
PropTypes
.
shape
({
children
:
PropTypes
.
arrayOf
(
PropTypes
.
shape
({
id
:
PropTypes
.
string
.
isRequired
,
name
:
PropTypes
.
string
.
isRequired
,
component
:
PropTypes
.
string
.
isRequired
,
title
:
PropTypes
.
string
.
isRequired
,
shortDescription
:
PropTypes
.
string
,
}).
isRequired
,
).
isRequired
,
}).
isRequired
,
}
SubmittedVersion
.
defaultProps
=
{
manuscript
:
undefined
,
...
...
@@ -83,7 +99,9 @@ const Submit = ({
const
editorSection
=
addEditor
(
manuscript
,
'
Manuscript text
'
)
let
decisionSection
if
([
'
new
'
,
'
revising
'
,
'
submitted
'
,
'
evaluated
'
].
includes
(
manuscript
.
status
))
{
if
(
[
'
new
'
,
'
revising
'
,
'
submitted
'
,
'
evaluated
'
].
includes
(
manuscript
.
status
)
)
{
Object
.
assign
(
submissionValues
,
JSON
.
parse
(
manuscript
.
submission
))
const
versionValues
=
{
...
...
@@ -134,6 +152,7 @@ const Submit = ({
<
SubmittedVersion
createNewVersion
=
{
createNewVersion
}
currentVersion
=
{
version
===
currentVersion
}
form
=
{
form
}
manuscript
=
{
manuscript
}
/
>
),
...
...
@@ -220,6 +239,9 @@ Submit.propTypes = {
}),
onChange
:
PropTypes
.
func
.
isRequired
,
onSubmit
:
PropTypes
.
func
.
isRequired
,
match
:
PropTypes
.
shape
({
url
:
PropTypes
.
string
.
isRequired
,
}).
isRequired
,
}
Submit
.
defaultProps
=
{
parent
:
undefined
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment