diff options
Diffstat (limited to 'app')
5 files changed, 10 insertions, 11 deletions
diff --git a/app/javascript/vehicle_journeys/actions/index.js b/app/javascript/vehicle_journeys/actions/index.js index 9a5ca940b..f1a7968fa 100644 --- a/app/javascript/vehicle_journeys/actions/index.js +++ b/app/javascript/vehicle_journeys/actions/index.js @@ -103,13 +103,13 @@ const actions = { type : 'EDIT_PURCHASE_WINDOWS_VEHICLEJOURNEY_MODAL', vehicleJourneys }), - selectPurchaseWindowsModal: (selectedTT) =>({ + selectPurchaseWindowsModal: (selectedWindow) =>({ type: 'SELECT_PURCHASE_WINDOW_MODAL', selectedItem:{ - id: selectedTT.id, - name: selectedTT.name, - color: selectedTT.color, - objectid: selectedTT.objectid + id: selectedWindow.id, + name: selectedWindow.name, + color: selectedWindow.color, + objectid: selectedWindow.objectid } }), addSelectedPurchaseWindow: () => ({ diff --git a/app/javascript/vehicle_journeys/components/Tools.js b/app/javascript/vehicle_journeys/components/Tools.js index be32552b9..d6e04f00e 100644 --- a/app/javascript/vehicle_journeys/components/Tools.js +++ b/app/javascript/vehicle_journeys/components/Tools.js @@ -53,5 +53,5 @@ export default class Tools extends Component { Tools.propTypes = { vehicleJourneys : PropTypes.array.isRequired, onCancelSelection: PropTypes.func.isRequired, - filters: PropTypes.object.isRequired, + filters: PropTypes.object.isRequired } diff --git a/app/javascript/vehicle_journeys/components/tools/PurchaseWindowsEditVehicleJourney.js b/app/javascript/vehicle_journeys/components/tools/PurchaseWindowsEditVehicleJourney.js index 5465127e8..d5f42b9dc 100644 --- a/app/javascript/vehicle_journeys/components/tools/PurchaseWindowsEditVehicleJourney.js +++ b/app/javascript/vehicle_journeys/components/tools/PurchaseWindowsEditVehicleJourney.js @@ -10,7 +10,7 @@ export default class PurchaseWindowsEditVehicleJourney extends Component { } handleSubmit() { - this.props.onTimetablesEditVehicleJourney(this.props.modal.modalProps.vehicleJourneys, this.props.modal.modalProps.purchase_windows) + this.props.onShoppingWindowsEditVehicleJourney(this.props.modal.modalProps.vehicleJourneys, this.props.modal.modalProps.purchase_windows) this.props.onModalClose() $('#PurchaseWindowsEditVehicleJourneyModal').modal('hide') } @@ -144,7 +144,7 @@ export default class PurchaseWindowsEditVehicleJourney extends Component { PurchaseWindowsEditVehicleJourney.propTypes = { onOpenCalendarsEditModal: PropTypes.func.isRequired, onModalClose: PropTypes.func.isRequired, - onTimetablesEditVehicleJourney: PropTypes.func.isRequired, + onShoppingWindowsEditVehicleJourney: PropTypes.func.isRequired, onDeleteCalendarModal: PropTypes.func.isRequired, onSelect2Timetable: PropTypes.func.isRequired, disabled: PropTypes.bool.isRequired diff --git a/app/javascript/vehicle_journeys/containers/tools/PurchaseWindowsEditVehicleJourney.js b/app/javascript/vehicle_journeys/containers/tools/PurchaseWindowsEditVehicleJourney.js index f81c8fa72..3fef44489 100644 --- a/app/javascript/vehicle_journeys/containers/tools/PurchaseWindowsEditVehicleJourney.js +++ b/app/javascript/vehicle_journeys/containers/tools/PurchaseWindowsEditVehicleJourney.js @@ -23,7 +23,7 @@ const mapDispatchToProps = (dispatch) => { onDeleteCalendarModal: (timetable) => { dispatch(actions.deletePurchaseWindowsModal(timetable)) }, - onTimetablesEditVehicleJourney: (vehicleJourneys, timetables) =>{ + onShoppingWindowsEditVehicleJourney: (vehicleJourneys, timetables) =>{ dispatch(actions.editVehicleJourneyPurchaseWindows(vehicleJourneys, timetables)) }, onSelect2Timetable: (e) =>{ diff --git a/app/models/chouette/purchase_window.rb b/app/models/chouette/purchase_window.rb index 742c18141..e89a0ec7f 100644 --- a/app/models/chouette/purchase_window.rb +++ b/app/models/chouette/purchase_window.rb @@ -16,8 +16,7 @@ module Chouette validates_presence_of :name, :referential scope :contains_date, ->(date) { where('date ? <@ any (date_ranges)', date) } - scope :text_search, ->(q) { where("unaccent(name) ILIKE unaccent(:q) OR objectid ILIKE :q", q: "%#{q}%")} - + def self.ransackable_scopes(auth_object = nil) [:contains_date] end |
