- added validation on add/edit Custom Field for multiple values (select/radio) - disabled Remove link when only one value remains - Added confirmation message on Reinstall - Added missing period in Import
41 lines
930 B
JavaScript
41 lines
930 B
JavaScript
define([
|
|
'react'
|
|
],
|
|
function(
|
|
React
|
|
) {
|
|
const FormFieldRadio = React.createClass({
|
|
render: function() {
|
|
if (this.props.field.values === undefined) {
|
|
return false;
|
|
}
|
|
|
|
const selected_value = this.props.item[this.props.field.name];
|
|
const options = Object.keys(this.props.field.values).map(
|
|
(value, index) => {
|
|
return (
|
|
<p key={ 'radio-' + index }>
|
|
<label>
|
|
<input
|
|
type="radio"
|
|
checked={ selected_value === value }
|
|
value={ value }
|
|
onChange={ this.props.onValueChange }
|
|
name={ this.props.field.name } />
|
|
{ this.props.field.values[value] }
|
|
</label>
|
|
</p>
|
|
);
|
|
}
|
|
);
|
|
|
|
return (
|
|
<div>
|
|
{ options }
|
|
</div>
|
|
);
|
|
}
|
|
});
|
|
|
|
return FormFieldRadio;
|
|
}); |