Skip to content
Snippets Groups Projects
Commit e560a908 authored by Jure's avatar Jure
Browse files

FormGroup is self sufficient when it comes to validations.

parent ae3fd0c9
No related branches found
No related tags found
No related merge requests found
......@@ -7,10 +7,12 @@ import {
HelpBlock,
} from 'react-bootstrap'
import Joi from 'joi-browser'
import serverValidations from 'pubsweet-server/src/models/validations'
import mergeValidations from 'pubsweet-server/src/models/validations'
import config from 'config'
const validations = serverValidations(config)
const appValidationsPath = config.validations
const validations = mergeValidations(require(appValidationsPath))
class FormGroup extends React.Component {
constructor(props) {
......
......@@ -2,11 +2,6 @@ import React from 'react'
import PropTypes from 'prop-types'
import { Button } from 'react-bootstrap'
import FormGroup from 'pubsweet-component-form-group/FormGroup'
import mergeValidations from 'pubsweet-server/src/models/validations'
import config from 'config'
const appValidationsPath = config.validations
const validations = mergeValidations(require(appValidationsPath))
export default class PostCreator extends React.Component {
constructor(props) {
......@@ -39,7 +34,6 @@ export default class PostCreator extends React.Component {
label="Title"
modelProperty="fragment.title"
placeholder="One fine day..."
validations={validations}
/>
<Button
aria-label="Create"
......
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