mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
Revert formsy/formsy-react-component update
This commit is contained in:
parent
40b91adafe
commit
b4ac2d23af
2 changed files with 9 additions and 7 deletions
|
@ -35,7 +35,7 @@ import {
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { intlShape } from 'meteor/vulcan:i18n';
|
import { intlShape } from 'meteor/vulcan:i18n';
|
||||||
import { Form } from 'formsy-react-components';
|
import Formsy from 'formsy-react';
|
||||||
import { getEditableFields, getInsertableFields } from '../modules/utils.js';
|
import { getEditableFields, getInsertableFields } from '../modules/utils.js';
|
||||||
import cloneDeep from 'lodash/cloneDeep';
|
import cloneDeep from 'lodash/cloneDeep';
|
||||||
import set from 'lodash/set';
|
import set from 'lodash/set';
|
||||||
|
@ -431,7 +431,7 @@ class SmartForm extends Component {
|
||||||
...newValues,
|
...newValues,
|
||||||
}, // Submit form after setState update completed
|
}, // Submit form after setState update completed
|
||||||
}),
|
}),
|
||||||
() => this.submitForm(this.refs.form.formsyForm.getModel())
|
() => this.submitForm(this.refs.form.getModel())
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -612,7 +612,7 @@ class SmartForm extends Component {
|
||||||
*/
|
*/
|
||||||
formKeyDown = event => {
|
formKeyDown = event => {
|
||||||
if ((event.ctrlKey || event.metaKey) && event.keyCode === 13) {
|
if ((event.ctrlKey || event.metaKey) && event.keyCode === 13) {
|
||||||
this.submitForm(this.refs.form.formsyForm.getModel());
|
this.submitForm(this.refs.form.getModel());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -782,7 +782,7 @@ class SmartForm extends Component {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={'document-' + this.getFormType()}>
|
<div className={'document-' + this.getFormType()}>
|
||||||
<Form onSubmit={this.submitForm} onKeyDown={this.formKeyDown} disabled={this.state.disabled} ref="form">
|
<Formsy.Form onSubmit={this.submitForm} onKeyDown={this.formKeyDown} disabled={this.state.disabled} ref="form">
|
||||||
<Components.FormErrors errors={this.state.errors} />
|
<Components.FormErrors errors={this.state.errors} />
|
||||||
|
|
||||||
{fieldGroups.map(group => (
|
{fieldGroups.map(group => (
|
||||||
|
@ -813,7 +813,7 @@ class SmartForm extends Component {
|
||||||
deleteDocument={(this.getFormType() === 'edit' && this.props.showRemove && this.deleteDocument) || null}
|
deleteDocument={(this.getFormType() === 'edit' && this.props.showRemove && this.deleteDocument) || null}
|
||||||
collectionName={collectionName}
|
collectionName={collectionName}
|
||||||
/>
|
/>
|
||||||
</Form>
|
</Formsy.Form>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,10 @@ const SelectComponent = ({refFunction, inputProperties, ...properties}, { intl }
|
||||||
value: '',
|
value: '',
|
||||||
disabled: true,
|
disabled: true,
|
||||||
};
|
};
|
||||||
|
let otherOptions = inputProperties.options;
|
||||||
const options = [noneOption, ...inputProperties.options.map(({ label, value }) => ({ label, value: value.toString()}))];
|
// uncomment following to convert options values to strings
|
||||||
|
// otherOptions = otherOptions.map(({ label, value }) => ({ label, value: value.toString()}));
|
||||||
|
const options = [noneOption, ...otherOptions];
|
||||||
return <Select {...inputProperties} options={options} ref={refFunction}/>
|
return <Select {...inputProperties} options={options} ref={refFunction}/>
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue