Merge pull request #45 from Bouncey/fix/ui

Fix up the UI and pull in the latest seed files
This commit is contained in:
Stuart Taylor
2018-05-18 14:54:21 +01:00
committed by Mrugesh Mohapatra
parent 04a6a2026c
commit f962d7774a
105 changed files with 7019 additions and 9431 deletions

View File

@@ -1,15 +1,16 @@
import React from 'react';
import _ from 'lodash';
import { kebabCase, startCase } from 'lodash';
import PropTypes from 'prop-types';
import {
Alert,
Col,
ControlLabel,
FormControl,
HelpBlock,
Row
HelpBlock
} from 'react-bootstrap';
import './form-fields.css';
const propTypes = {
errors: PropTypes.objectOf(PropTypes.string),
fields: PropTypes.objectOf(
@@ -44,13 +45,13 @@ function FormFields(props) {
.filter(field => !ignored.includes(field))
.map(key => fields[key])
.map(({ name, onChange, value, pristine }) => {
const key = _.kebabCase(name);
const key = kebabCase(name);
const type = name in types ? types[name] : 'text';
return (
<Row className='inline-form-field' key={key}>
<div className='inline-form-field' key={key}>
<Col sm={3} xs={12}>
{type === 'hidden' ? null : (
<ControlLabel htmlFor={key}>{_.startCase(name)}</ControlLabel>
<ControlLabel htmlFor={key}>{startCase(name)}</ControlLabel>
)}
</Col>
<Col sm={9} xs={12}>
@@ -72,7 +73,7 @@ function FormFields(props) {
</HelpBlock>
) : null}
</Col>
</Row>
</div>
);
})}
</div>