Fixed issue #305

- 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
This commit is contained in:
Jonathan Labreuille
2016-02-18 13:09:14 +01:00
parent 0daf7e12c1
commit 03c782d4ab
7 changed files with 65 additions and 32 deletions

View File

@ -10,10 +10,13 @@ function(
return this.props.onValueChange(e);
},
render: function() {
const isChecked = !!(this.props.item[this.props.field.name]);
if (this.props.field.values === undefined) {
return false;
}
const isChecked = !!(this.props.item[this.props.field.name]);
const options = Object.keys(this.props.field.values).map(
function(value, index) {
(value, index) => {
return (
<p key={ 'checkbox-' + index }>
<label>
@ -29,7 +32,7 @@ function(
</label>
</p>
);
}.bind(this)
}
);
return (

View File

@ -4,12 +4,15 @@ define([
function(
React
) {
var FormFieldRadio = React.createClass({
const FormFieldRadio = React.createClass({
render: function() {
var selected_value = this.props.item[this.props.field.name];
if (this.props.field.values === undefined) {
return false;
}
var options = Object.keys(this.props.field.values).map(
function(value, index) {
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>
@ -23,7 +26,7 @@ function(
</label>
</p>
);
}.bind(this)
}
);
return (

View File

@ -4,10 +4,14 @@ define([
function(
React
) {
var FormFieldSelect = React.createClass({
const FormFieldSelect = React.createClass({
render: function() {
var options =
Object.keys(this.props.field.values).map(function(value, index) {
if (this.props.field.values === undefined) {
return false;
}
const options = Object.keys(this.props.field.values).map(
(value, index) => {
return (
<option
key={ 'option-' + index }
@ -15,7 +19,7 @@ function(
{ this.props.field.values[value] }
</option>
);
}.bind(this)
}
);
return (