aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZog2018-05-04 09:51:37 +0200
committerZog2018-05-04 09:51:37 +0200
commit15c9a1a6c307f2c9ef73fdf37edcf4890edfc4c0 (patch)
tree1c5bb409ad6ee6b51994f7479edebca6b401a04d
parentdb65c0ffc7ccc76a144689ec3db43fbc2e61ee82 (diff)
downloadchouette-core-6550-custom)fiezlds-in-journey-patterns.tar.bz2
Refs #6550; Fix CustomFields edition for JourneyPatterns6550-custom)fiezlds-in-journey-patterns
-rw-r--r--app/javascript/helpers/CustomFieldsInputs.js4
-rw-r--r--app/javascript/journey_patterns/reducers/journeyPatterns.js1
2 files changed, 3 insertions, 2 deletions
diff --git a/app/javascript/helpers/CustomFieldsInputs.js b/app/javascript/helpers/CustomFieldsInputs.js
index 0a57e7566..93611538e 100644
--- a/app/javascript/helpers/CustomFieldsInputs.js
+++ b/app/javascript/helpers/CustomFieldsInputs.js
@@ -43,7 +43,7 @@ export default class CustomFieldsInputs extends Component {
ref={'custom_fields.' + cf.code}
className='form-control'
disabled={this.props.disabled}
- value={cf.value || this.options(cf).default}
+ value={cf.value || this.options(cf).default || ""}
onChange={(e) => {this.props.onUpdate(cf.code, e.target.value); this.forceUpdate()} }
/>
)
@@ -56,7 +56,7 @@ export default class CustomFieldsInputs extends Component {
ref={'custom_fields.' + cf.code}
className='form-control'
disabled={this.props.disabled}
- value={cf.value || this.options(cf).default}
+ value={cf.value || this.options(cf).default || ""}
onChange={(e) => {this.props.onUpdate(cf.code, e.target.value); this.forceUpdate()} }
/>
)
diff --git a/app/javascript/journey_patterns/reducers/journeyPatterns.js b/app/javascript/journey_patterns/reducers/journeyPatterns.js
index 1a6a27da6..9dcd82082 100644
--- a/app/javascript/journey_patterns/reducers/journeyPatterns.js
+++ b/app/javascript/journey_patterns/reducers/journeyPatterns.js
@@ -18,6 +18,7 @@ const journeyPattern = (state = {}, action) =>{
registration_number: action.data.registration_number.value,
stop_points: stopPoints,
costs: {},
+ custom_fields: action.data.custom_fields,
deletable: false
}
case 'UPDATE_CHECKBOX_VALUE':