mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00

- Form API: updateCurrentValue(fieldName, fieldValue) => updateCurrentValues(newValues: {[fieldName]: fieldValue}) to update one or more fields at once; - changes on EmbedlyURL: use of currentValues instead of autofilledValues, fix the use of 'media' field on new & edit (assigned server-side in async callback) - fix Posts schema's autoValue logic: moved to callbacks (it worked on new docs but not triggered on edits)
23 lines
No EOL
706 B
JavaScript
23 lines
No EOL
706 B
JavaScript
import React, { PropTypes, Component } from 'react';
|
|
import FormComponent from "./FormComponent.jsx";
|
|
|
|
class FormGroup extends Component {
|
|
render() {
|
|
return (
|
|
<div className="form-section">
|
|
{this.props.name === "default" ? null : <h3 className="form-section-heading">{this.props.label}</h3>}
|
|
{this.props.fields.map(field => <FormComponent key={field.name} {...field} updateCurrentValues={this.props.updateCurrentValues} />)}
|
|
</div>
|
|
)
|
|
}
|
|
}
|
|
|
|
FormGroup.propTypes = {
|
|
name: React.PropTypes.string,
|
|
label: React.PropTypes.string,
|
|
order: React.PropTypes.number,
|
|
fields: React.PropTypes.array,
|
|
updateCurrentValues: React.PropTypes.func
|
|
}
|
|
|
|
export default FormGroup; |