diff options
| author | Zog | 2018-02-27 16:05:51 +0100 |
|---|---|---|
| committer | Zog | 2018-02-27 16:05:51 +0100 |
| commit | 9c82d307f71caf58c142ee28035f7f20eab5f7e9 (patch) | |
| tree | 53f00717efdcfe5f0673fe78e2e4f0f86078733c | |
| parent | ccbb8172d1e2463890d4138dae307e5526393cee (diff) | |
| download | chouette-core-9c82d307f71caf58c142ee28035f7f20eab5f7e9.tar.bz2 | |
Refs #6008; Use same time for arrival & departure in 1st and last stops6008-no-transition-time-for-journeys-start-and-end
| -rw-r--r-- | app/javascript/vehicle_journeys/reducers/vehicleJourneys.js | 5 | ||||
| -rw-r--r-- | spec/javascript/vehicle_journeys/reducers/vehicleJourneys_spec.js | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/app/javascript/vehicle_journeys/reducers/vehicleJourneys.js b/app/javascript/vehicle_journeys/reducers/vehicleJourneys.js index 8705b3cf2..e7f68761e 100644 --- a/app/javascript/vehicle_journeys/reducers/vehicleJourneys.js +++ b/app/javascript/vehicle_journeys/reducers/vehicleJourneys.js @@ -90,6 +90,11 @@ const vehicleJourney= (state = {}, action, keep) => { } }) + let lastStop = action.selectedJourneyPattern.stop_areas && action.selectedJourneyPattern.stop_areas[action.selectedJourneyPattern.stop_areas.length - 1] + if(lastStop && lastStop.stop_area_short_description.id == sp.id){ + newVjas.departure_time = newVjas.arrival_time + } + if(newVjas.dummy){ newVjas.departure_time = {hour: "00", minute: "00"} newVjas.arrival_time = {hour: "00", minute: "00"} diff --git a/spec/javascript/vehicle_journeys/reducers/vehicleJourneys_spec.js b/spec/javascript/vehicle_journeys/reducers/vehicleJourneys_spec.js index 608115727..bfa0942c6 100644 --- a/spec/javascript/vehicle_journeys/reducers/vehicleJourneys_spec.js +++ b/spec/javascript/vehicle_journeys/reducers/vehicleJourneys_spec.js @@ -219,7 +219,7 @@ describe('vehicleJourneys reducer', () => { type: 'ADD_VEHICLEJOURNEY', data: fakeData, selectedJourneyPattern: fakeSelectedJourneyPattern, - stopPointsList: [{object_id: 'test-1', city_name: 'city', stop_area_id: 1, id: 1, time_zone_offset: 0, waiting_time: null}, {object_id: 'test-2', city_name: 'city', stop_area_id: 2, id: 2, time_zone_offset: -3600, waiting_time: 10}, {object_id: 'test-3', city_name: 'city', stop_area_id: 3, id: 3, time_zone_offset: 0, waiting_time: 20}, {object_id: 'test-4', city_name: 'city', stop_area_id: 4, id: 4, time_zone_offset: 0}], + stopPointsList: [{object_id: 'test-1', city_name: 'city', stop_area_id: 1, id: 1, time_zone_offset: 0, waiting_time: 10}, {object_id: 'test-2', city_name: 'city', stop_area_id: 2, id: 2, time_zone_offset: -3600, waiting_time: 10}, {object_id: 'test-3', city_name: 'city', stop_area_id: 3, id: 3, time_zone_offset: 0, waiting_time: 20}, {object_id: 'test-4', city_name: 'city', stop_area_id: 4, id: 4, time_zone_offset: 0, waiting_time: 100}], selectedCompany: fakeSelectedCompany }) ).toEqual([{ |
