From 607fa5e03289a10b60a773bc40af38f1d721bbea Mon Sep 17 00:00:00 2001
From: Zog
Date: Wed, 27 Dec 2017 13:42:39 +0100
Subject: Refs #5407 @2h; Model implementation
- Link PurchaseWindows to VehicleJourneys in the model
- Add an autocompletion endpoint
---
app/javascript/vehicle_journeys/actions/index.js | 3 ++-
app/javascript/vehicle_journeys/components/Filters.js | 3 ++-
.../components/tools/PurchaseWindowsEditVehicleJourney.js | 1 +
.../components/tools/TimetablesEditVehicleJourney.js | 9 +++++----
.../components/tools/select2s/TimetableSelect2.js | 14 ++++++--------
5 files changed, 16 insertions(+), 14 deletions(-)
(limited to 'app/javascript')
diff --git a/app/javascript/vehicle_journeys/actions/index.js b/app/javascript/vehicle_journeys/actions/index.js
index d5eda629c..9a5ca940b 100644
--- a/app/javascript/vehicle_journeys/actions/index.js
+++ b/app/javascript/vehicle_journeys/actions/index.js
@@ -107,7 +107,8 @@ const actions = {
type: 'SELECT_PURCHASE_WINDOW_MODAL',
selectedItem:{
id: selectedTT.id,
- comment: selectedTT.comment,
+ name: selectedTT.name,
+ color: selectedTT.color,
objectid: selectedTT.objectid
}
}),
diff --git a/app/javascript/vehicle_journeys/components/Filters.js b/app/javascript/vehicle_journeys/components/Filters.js
index db6707520..3bc4f7ff7 100644
--- a/app/javascript/vehicle_journeys/components/Filters.js
+++ b/app/javascript/vehicle_journeys/components/Filters.js
@@ -33,6 +33,7 @@ export default function Filters({filters, pagination, onFilter, onResetFilters,
onSelect2Timetable={onSelect2Timetable}
hasRoute={true}
chunkURL={("/autocomplete_time_tables.json?route_id=" + String(window.route_id))}
+ searchKey={"comment_or_objectid_cont_any"}
filters={filters}
isFilter={true}
/>
@@ -165,4 +166,4 @@ Filters.propTypes = {
onSelect2Timetable: PropTypes.func.isRequired,
onSelect2JourneyPattern: PropTypes.func.isRequired,
onSelect2VehicleJourney: PropTypes.func.isRequired
-}
\ No newline at end of file
+}
diff --git a/app/javascript/vehicle_journeys/components/tools/PurchaseWindowsEditVehicleJourney.js b/app/javascript/vehicle_journeys/components/tools/PurchaseWindowsEditVehicleJourney.js
index cf51e50f0..5465127e8 100644
--- a/app/javascript/vehicle_journeys/components/tools/PurchaseWindowsEditVehicleJourney.js
+++ b/app/javascript/vehicle_journeys/components/tools/PurchaseWindowsEditVehicleJourney.js
@@ -95,6 +95,7 @@ export default class PurchaseWindowsEditVehicleJourney extends Component {