mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
[WiP] rename project from Caravel to Superset (#1576)
* Change in files * Renamin files and folders * cleaning up a single piece of lint * Removing boat picture from docs * add superset word mark * Update rename note in docs * Fixing images * Pinning datatables * Fixing issues with mapbox-gl * Forgot to rename one file * Linting * v0.13.0 * adding pyyaml to dev-reqs
This commit is contained in:
committed by
GitHub
parent
973537fd9a
commit
15b67b2c6c
@@ -0,0 +1,52 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import FieldSet from './FieldSet';
|
||||
|
||||
const NUM_COLUMNS = 12;
|
||||
|
||||
const propTypes = {
|
||||
fields: PropTypes.object.isRequired,
|
||||
fieldSets: PropTypes.array.isRequired,
|
||||
fieldOverrides: PropTypes.object,
|
||||
onChange: PropTypes.func,
|
||||
form_data: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
const defaultProps = {
|
||||
fieldOverrides: {},
|
||||
onChange: () => {},
|
||||
};
|
||||
|
||||
export default class FieldSetRow extends React.Component {
|
||||
getFieldData(fs) {
|
||||
const { fields, fieldOverrides } = this.props;
|
||||
let fieldData = fields[fs];
|
||||
if (fieldOverrides.hasOwnProperty(fs)) {
|
||||
const overrideData = fieldOverrides[fs];
|
||||
fieldData = Object.assign({}, fieldData, overrideData);
|
||||
}
|
||||
return fieldData;
|
||||
}
|
||||
render() {
|
||||
const colSize = NUM_COLUMNS / this.props.fieldSets.length;
|
||||
return (
|
||||
<div className="row">
|
||||
{this.props.fieldSets.map((fs) => {
|
||||
const fieldData = this.getFieldData(fs);
|
||||
return (
|
||||
<div className={`col-lg-${colSize} col-xs-12`} key={fs}>
|
||||
<FieldSet
|
||||
name={fs}
|
||||
onChange={this.props.onChange}
|
||||
value={this.props.form_data[fs]}
|
||||
{...fieldData}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
FieldSetRow.propTypes = propTypes;
|
||||
FieldSetRow.defaultProps = defaultProps;
|
||||
Reference in New Issue
Block a user