aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/journey_patterns_collections
AgeCommit message (Collapse)Author
2018-04-16Refs #6551; Add CustomFields to JourneyPatterns6551-add_custom_field_values_to_journey_patternsZog
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
2017-12-28Fixes JS features list in journey_patterns_collections#show. Refs #5407Alban Peignier
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-01Fix override page header title call multiple time, using flush optionXinhui
2017-12-01Fix conflit with page header title & breadcrumb title on ↵Xinhui
journey_patterns_collections#show
2017-12-01Fix page title on journey_patterns_collection#showXinhui
Refs #5152
2017-11-28Refactoring move render pageheader into layoutXinhui
2017-11-28Replace pageheader by render partialXinhui
2017-10-20Breadcrumb for journey_patternsXinhui
2017-10-06Add webpacker gem and migrate the React appscedricnjanga
2017-08-30Updating project-specific iconfont for page headers (in views)jpl
2017-07-07Fix routing_constraint_zone validation for create refs #3962 @3Luc Donnet
2017-04-03Refs #3028: Add and update permissions for vj and jpThomas Haddad
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
2017-03-30Refs #3004: removing updated_at from index viewsjpl
2017-03-17Refs #2859: fix wording issuesjpl
2017-02-28Refs #2648: jp_collection refacto, to allow adding a jp from scratchjpl
2017-02-28Fix fetch API in jp when no entriesThomas Haddad
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com> Signed-off-by: Jean-Paul Lescouzeres <jean-paul.lescouzeres@af83.com>
2017-02-24Refs #2648: updating layout on jp_collection (second pass)jpl
2017-02-24Refs #2648: updating per_page management on journey_patterns_collectionjpl
2017-01-11Add update journey patterns length after submitting correct valuesThomas Haddad
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
2016-12-22Wip update journey_patterns collectionsXinhui
Refs #2213
2016-12-15JS gardening for journey_patternsThomas Haddad
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
2016-12-13Add paginate for journey_patterns Refs #2205Thomas Haddad
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
2016-12-13Add simple counter for pagination before plugging it for real Refs #2205Thomas Haddad
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
2016-12-08Add Journey_patterns display with initialized state Refs #2204Thomas Haddad
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com> Signed-off-by: Jean-Paul Lescouzeres <jean-paul.lescouzeres@af83.com>
2016-12-08Journey patterns collection controllerXinhui