Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nacmartin committed Jun 25, 2017
1 parent 6fc6a26 commit 9e19595
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "liform-react",
"version": "0.6.2",
"version": "0.6.3",
"description": "Generate forms from json-schema to use with React (and redux-form)",
"main": "./lib/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Liform = (props) => {
form: props.formKey || props.schema.title || 'form',
validate: props.syncValidation || buildSyncValidation(schema),
initialValues: props.initialValues,
context: {...props.context, formName},
context: { ...props.context, formName },
})(props.baseForm || BaseForm)
return (
<FinalForm renderFields={renderField.bind(this)} {...props} schema={schema} />
Expand Down
2 changes: 1 addition & 1 deletion src/renderField.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const guessWidget = (fieldSchema) => {

const renderField = (fieldSchema, fieldName, theme, prefix = '', context = {}, required = false) => {
if(fieldSchema.hasOwnProperty('allOf')) {
fieldSchema = {...fieldSchema, ...deepmerge.all(fieldSchema.allOf)}
fieldSchema = { ...fieldSchema, ...deepmerge.all(fieldSchema.allOf) }
delete fieldSchema.allOf
}

Expand Down
13 changes: 3 additions & 10 deletions src/themes/bootstrap3/oneOfChoiceWidget.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
import { Field, change } from 'redux-form'
import { change } from 'redux-form'
import { connect } from 'react-redux'
import renderField from '../../renderField'
import _ from 'lodash'
Expand All @@ -23,8 +23,6 @@ class OneOfChoiceWidget extends Component {
])
const schema = field.schema
const options = schema.oneOf
const theme = field.theme
const context = field.context

return (
<div className={className}>
Expand All @@ -51,19 +49,14 @@ class OneOfChoiceWidget extends Component {
}

selectItem(e) {
console.log(this.props)
const {schema, context, dispatch} = this.props
const { schema, context, dispatch } = this.props
for (let property in schema.oneOf[this.state.choice].properties) {
dispatch(change(context.formName, property, null))
}
this.setState({choice: e.target.value})
}
showItem(item, idx, theme, name, context) {
this.setState({ choice: e.target.value })
}
}



OneOfChoiceWidget.propTypes = {
schema: PropTypes.object.isRequired,
fieldName: PropTypes.string,
Expand Down

0 comments on commit 9e19595

Please sign in to comment.