aboutsummaryrefslogtreecommitdiffstats
path: root/spec/javascript
AgeCommit message (Collapse)Author
2018-05-14Refs #6998: Fix JS specs6998-fix-jest-specsZog
2018-03-15JourneyPatternsCollection#show: Fallback to route costsTeddy Wing
When editing a `JourneyPattern`, you can edit the distance & time costs between stops. We want to pre-fill these cost values (in the input fields) if they haven't already been set by a user. This way, they get an existing estimate of the cost and don't have to enter a value manually unless the default doesn't work. The pre-filled values come from `Route#costs`, which get calculated ahead of time via the TomTom API. Add a new `fetchRouteCosts` function that will fetch the costs for the current route from the API. This function also caches the value on `actions` so we don't keep making requests since the data isn't going to change. Put the cached fetch in a `requestAnimationFrame` as a sort of timeout to prevent a warning from React complaining about doing this during a `render()` call. Update `getTimeAndDistanceBetweenStops` to use the cost value from the route costs instead of the journey pattern costs if it doesn't exist. The `totalDistance` and `totalTime` we moved into `componentWillUpdate` instead of `render()` because we thought that might be the cause of the `render()` warning I mentioned above. Decided to leave this part in even though it doesn't have anything to do with the goal of the changes here, because it seemed like an okay change. The `RECEIVE_ROUTE_COSTS` reducer will update the state with route costs. We need the default distance:0 time:0 to avoid infinitely fetching the costs API if a cost with the given key can't be found. Put the route cost API URL in `window.routeCostsUrl` to allow us to get it from the Rails URL helper. Huge thanks to Johan for pairing with me on this code and walking me through the setup for integrating the route costs JSON response into the frontend interface. Refs #6203
2018-03-15Fixes VehicleJourneys javascript spec. Refs #6143Alban Peignier
2018-03-15Fix javascript specsZog
2018-03-14Merge pull request #348 from af83/6036-fix-journeys-editorAlban Peignier
Fix the journeys time editor. Refs #6036
2018-02-27Refs #6008; Use same time for arrival & departure in 1st and last stops6008-no-transition-time-for-journeys-start-and-endZog
2018-02-27Refs #6063; Fix the journeys time editor6036-fix-journeys-editorZog
2018-02-21Refs #5942; Apply users TZ when computing a schedule5942-apply-user-tzZog
2018-02-21Refs #5944; Skip automated times calculation when no start time is set5944-skip-schedule-calculation-when-no-time-is-setZog
2018-02-19Merge pull request #303 from af83/5899-use-waiting-time-in-schedulesAlban Peignier
Use waiting_time in schedules computation. Refs #5899
2018-02-19Fixes javascript VehicleJourneys snapshot. Refs #58535853-detailed-calendar-view-in-vjs-indexAlban Peignier
2018-02-19Merge branch 'master' into 0000-dockerLuc Donnet
2018-02-12Refs #5899 @1h; Use waiting_time in schedules computation5899-use-waiting-time-in-schedulesZog
2018-02-09Refs #4126 @6h; Add i18n to JSZog
2018-01-31Fix specsZog
2018-01-31Merge pull request #263 from af83/5750-non-commercial-stop-areasLuc Donnet
5750 non commercial stop areas
2018-01-29Refs #5750; Add a validation on VehicleJourneysZog
Ensure a time is set for all non-commercial stops
2018-01-25Refs #5598 @1h; Add specs5598-fix-journey-patterns-collectionZog
2018-01-17Refs #5614 @0.5h; Fix schedule computation when departure minutes are not set5614-fix-schedule-computationZog
2018-01-12Fix Jest specs on timetablesfix-timetables-specsZog
2018-01-11Refs #5535; Fix specsZog
2018-01-11Fix specsZog
2018-01-11Add tests, but I'm unable to run them for now :-(Zog
2018-01-11Refs #5551 @0.5h; Implement the custom fields in the creation modalZog
And Refactor the component in the process
2018-01-11Merge pull request #225 from af83/5535-compute-vehicle-journeys-timesLuc Donnet
5535 compute vehicle journeys times
2018-01-10Merge pull request #217 from af83/5502-remove-search-from-selectsAlban Peignier
Don't use Ajax in JP selector in VJs editor. Refs #5502
2018-01-10Refs #5535 @2H; Automatically fill VJs tilmes when possibleZog
2018-01-10Refs #5437 @1h; Refactor codeZog
2018-01-10Refs #5437 @0.5h; Propagate behaviour to the JourneyPatterns editorZog
2018-01-10Refs #5437 @0.5h; Show country name instead of city in the journeys editorZog
When the organisation has the "long_distance_routes" features. Mind the `StopArea#country_name` method which is pending until we merge the branch which adds the countries support.
2018-01-09Refs #5502 @4h; Don't use Ajax in JP selector in VJs editor5502-remove-search-from-selectsZog
When the number of possible values is low (<10), display the values right away, don't use an Ajax query
2018-01-08Refs #5455 @6h; Add time and distance between stops in Journey PatternsZog
- Adds a `JSON` attribute in the model - Adds the fields in the editor
2017-12-28Refs #5435 @0.5h; Fix Company select in VehicleJourney edition modalZog
2017-12-28Refs #5435 @0.5h; Fix EditModal validation in VehicleJourneys#indexZog
2017-12-28Fixes vehicleJourneys reducer spec. Refs #5407Alban Peignier
2017-12-27Merge pull request #183 from af83/5407-add-purchase-windows-to-vehicle-journeysAlban Peignier
Add purchase windows to vehicle journeys. Refs #5407
2017-12-27Merge pull request #177 from af83/5376-fix-vehicle-journeys-uiAlban Peignier
Fix vehicle journeys ui. Refs #5376
2017-12-27Refs #5407; Fix CIZog
2017-12-27Refs #5407 @4h; First UI implementationZog
- Add most of the react code - And the specs where possible Still remains: - Link PurchaseWindows to VehicleJourneys in the model - Add an autocompletion endpoint
2017-12-27Refs #5376 @1h; Change the behaviour of the inputs on VehicleJourney#indexZog
We don't block user actions anymore. Instead, when the departure time is set prior to the arrival time, we shift the arrival time accordingly (and reversed when the user sets the arrival time)
2017-12-22Update Specs to what should be the correct behaviourZog
2017-12-22Refactor stopPointsReducer spec;Zog
For now no bug has been fixed :-)
2017-12-13Merge branch 'master' into stagingcedricnjanga
2017-12-13Fix VJ speccedricnjanga
2017-10-17Merge branch 'master' into stagingAlban Peignier
2017-10-17fix ci spec task Refs #4737Guillaume
2017-10-16Merge branch 'master' into stagingLuc Donnet
2017-10-16add jest for js test, fix js test errors, remove unused config in ↵Guillaume
config/environement
2017-10-10Need to test webpack config and to configure teaspoon to run React Apps specscedricnjanga