aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZog2018-05-17 10:29:36 +0200
committerZog2018-05-17 10:29:36 +0200
commitdd881ac27471ba3b20a5b1b42fad55b309ea8c4f (patch)
tree3d5349218e1a4dfc939b461f0fe76726fb7b8cca
parentb339918561c936b8055444cbbc734e4941d48215 (diff)
downloadchouette-core-7056-fix-jp-editor.tar.bz2
Refs #7056; Fix JourneyPattern Editor7056-fix-jp-editor
Fix a bug occuring if a route uses several times the same stops. In the JourneyPattern Editor, you wouldn't be able to select the stop only once
-rw-r--r--app/javascript/journey_patterns/actions/index.js2
-rw-r--r--app/views/api/v1/journey_patterns/show.rabl1
2 files changed, 2 insertions, 1 deletions
diff --git a/app/javascript/journey_patterns/actions/index.js b/app/javascript/journey_patterns/actions/index.js
index a813f4b9e..b5b39e514 100644
--- a/app/javascript/journey_patterns/actions/index.js
+++ b/app/javascript/journey_patterns/actions/index.js
@@ -196,7 +196,7 @@ const actions = {
let stop_point = val.route_short_description.stop_points[i]
stop_point.checked = false
val.stop_area_short_descriptions.map((element) => {
- if(element.stop_area_short_description.id === stop_point.id){
+ if(element.stop_area_short_description.position === stop_point.position){
stop_point.checked = true
}
})
diff --git a/app/views/api/v1/journey_patterns/show.rabl b/app/views/api/v1/journey_patterns/show.rabl
index d02781cfa..24c81265c 100644
--- a/app/views/api/v1/journey_patterns/show.rabl
+++ b/app/views/api/v1/journey_patterns/show.rabl
@@ -23,6 +23,7 @@ node(:vehicle_journey_object_ids) do |journey_pattern|
end unless root_object.vehicle_journeys.empty?
child :stop_points => :stop_area_short_descriptions do |stop_points|
+ attribute :position
node do |stop_point|
cache stop_point.stop_area_id
partial("api/v1/stop_areas/short_description", :object => stop_point.stop_area)