From ed66fa64bcc20e1aba8212232c131b9eb25c638c Mon Sep 17 00:00:00 2001
From: cedricnjanga
Date: Thu, 27 Jul 2017 16:50:32 +0200
Subject: Revert "Add short id in Ransack query for MissionSelect2"
This reverts commit f27abef1479cf8fc14e78fdaa6d9d69aed0d8ba7.
---
.../vehicle_journeys/components/tools/select2s/MissionSelect2.js | 4 ++--
app/views/api/v1/journey_patterns/show.rabl | 8 +-------
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/MissionSelect2.js b/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/MissionSelect2.js
index 922a1e5ee..c04a1d642 100644
--- a/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/MissionSelect2.js
+++ b/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/MissionSelect2.js
@@ -34,7 +34,7 @@ class BSelect4 extends React.Component{
delay: '500',
data: function(params) {
return {
- q: {published_name_cont_or_short_id_or_registration_number_cont: params.term},
+ q: {published_name_or_objectid_or_registration_number_cont: params.term},
};
},
processResults: function(data, params) {
@@ -43,7 +43,7 @@ class BSelect4 extends React.Component{
item => _.assign(
{},
item,
- { text: "" + item.published_name + " - " + item.short_id + "
" + item.registration_number + "" }
+ { text: "" + item.published_name + _.last(_.split(item.object_id, ':')) + "
" + item.registration_number + "" }
)
)
};
diff --git a/app/views/api/v1/journey_patterns/show.rabl b/app/views/api/v1/journey_patterns/show.rabl
index 7c3af52fc..21f25e480 100644
--- a/app/views/api/v1/journey_patterns/show.rabl
+++ b/app/views/api/v1/journey_patterns/show.rabl
@@ -5,13 +5,6 @@ extends "api/v1/trident_objects/show"
attributes attr, :unless => lambda { |m| m.send( attr).nil?}
end
-node do |jp|
- {
- short_id: jp.objectid.parts.try(:third)
- }
-
-end
-
node(:route_short_description) do |journey_pattern|
partial("api/v1/routes/short_description", :object => journey_pattern.route)
end
@@ -25,3 +18,4 @@ child :stop_points => :stop_area_short_descriptions do |stop_points|
partial("api/v1/stop_areas/short_description", :object => stop_point.stop_area)
end
end
+
--
cgit v1.2.3