aboutsummaryrefslogtreecommitdiffstats
path: root/app/javascript
diff options
context:
space:
mode:
authorZog2018-05-11 10:47:42 +0200
committerZog2018-05-11 10:47:42 +0200
commit193b8419e3a4445d9c14536ca8a461685b6be415 (patch)
treed16c8347e9a67e119b9f5abf4c701c2e7ae70139 /app/javascript
parent7b7a7b44a9c8d016e1c0cadc7b8f887de9dcac0a (diff)
downloadchouette-core-6852-make-capacity-optional.tar.bz2
Refs #6852; Update Customfields6852-make-capacity-optional
Better validations for List with an hash as `list_values`
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/helpers/CustomFieldsInputs.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/javascript/helpers/CustomFieldsInputs.js b/app/javascript/helpers/CustomFieldsInputs.js
index 93611538e..5240a9649 100644
--- a/app/javascript/helpers/CustomFieldsInputs.js
+++ b/app/javascript/helpers/CustomFieldsInputs.js
@@ -18,9 +18,11 @@ export default class CustomFieldsInputs extends Component {
}
listInput(cf){
+ let keys = _.orderBy(_.keys(this.options(cf).list_values), function(i){ return parseInt(i)})
return(
<Select2
- data={_.map(this.options(cf).list_values, (v, k) => {
+ data={_.map(keys, (k) => {
+ let v = this.options(cf).list_values[k]
return {id: k, text: (v.length > 0 ? v : '\u00A0')}
})}
ref={'custom_fields.' + cf.code}