Skip to content
Snippets Groups Projects
Commit f7710835 authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

Fix conflicts

parents dcebf7cb 93d86db3
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,11 @@ import { AuthorList } from 'pubsweet-component-wizard/src/components/AuthorList' ...@@ -14,7 +14,11 @@ import { AuthorList } from 'pubsweet-component-wizard/src/components/AuthorList'
import { declarations } from './' import { declarations } from './'
import issueTypes from './issues-types' import issueTypes from './issues-types'
import manuscriptTypes from './manuscript-types' import manuscriptTypes from './manuscript-types'
import { requiredBasedOnType, editModeEnabled } from './wizard-validators' import {
requiredBasedOnType,
editModeEnabled,
parseEmptyHtml,
} from './wizard-validators'
const min3Chars = minChars(3) const min3Chars = minChars(3)
const declarationsMinSize = minSize(declarations.options.length) const declarationsMinSize = minSize(declarations.options.length)
...@@ -101,6 +105,7 @@ export default { ...@@ -101,6 +105,7 @@ export default {
renderComponent: TitleEditor, renderComponent: TitleEditor,
placeholder: 'Manuscript title', placeholder: 'Manuscript title',
title: 'Manuscript title', title: 'Manuscript title',
validate: [parseEmptyHtml],
}, },
{ {
fieldId: 'spacing-title', fieldId: 'spacing-title',
......
...@@ -6,7 +6,7 @@ const requiredTypes = manuscriptTypes ...@@ -6,7 +6,7 @@ const requiredTypes = manuscriptTypes
.filter(t => t.abstractRequired) .filter(t => t.abstractRequired)
.map(t => t.value) .map(t => t.value)
const parseAbstract = value => { export const parseEmptyHtml = value => {
if (value && value.replace('<p></p>', '').replace('<h1></h1>', '')) { if (value && value.replace('<p></p>', '').replace('<h1></h1>', '')) {
return undefined return undefined
} }
...@@ -16,7 +16,7 @@ const parseAbstract = value => { ...@@ -16,7 +16,7 @@ const parseAbstract = value => {
export const requiredBasedOnType = (value, formValues) => { export const requiredBasedOnType = (value, formValues) => {
if ( if (
requiredTypes.includes(get(formValues, 'metadata.type')) && requiredTypes.includes(get(formValues, 'metadata.type')) &&
(isEmpty(get(formValues, 'metadata.abstract')) || parseAbstract(value)) (isEmpty(get(formValues, 'metadata.abstract')) || parseEmptyHtml(value))
) { ) {
return 'Required' return 'Required'
} }
......
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