diff --git a/common/app/routes/Jobs/components/NewJob.jsx b/common/app/routes/Jobs/components/NewJob.jsx index a412ff6d7d..61bf46530a 100644 --- a/common/app/routes/Jobs/components/NewJob.jsx +++ b/common/app/routes/Jobs/components/NewJob.jsx @@ -7,19 +7,57 @@ import { Well } from 'react-bootstrap'; +const defaults = { + 'string': { + value: '', + valid: false, + pristine: true + } +}; + +function defaultValue(type) { + return defaults[type]; +} + +function validatePosition(value) { + if (!value && typeof value !== 'string') { + return false; + } + return true; +} + export default contain({ actions: 'jobActions', store: 'jobsStore', map({ form = {} }) { - return form; + const { + position = defaultValue('string'), + location = defaultValue('string'), + description = defaultValue('string') + } = form; + return { + position, + location, + description + }; } }, React.createClass({ displayName: 'NewJob', + propTypes: { - jobActions: PropTypes.object + jobActions: PropTypes.object, + position: PropTypes.object, + location: PropTypes.object, + description: PropTypes.object }, + render() { + const { + jobActions, + position + } = this.props; + return (