aboutsummaryrefslogtreecommitdiffstats
path: root/app
AgeCommit message (Collapse)Author
2018-03-21Refs #6132 Set current breadcrumb linkable6132-forms-breadcrumbcedricnjanga
2018-03-20Add log messages in Import::Base#child_change process. Refs #6243Alban Peignier
2018-03-20Don't use Import::Base#status_changed? into #notify_parent (status can be ↵Alban Peignier
changed by java side). Refs #6243
2018-03-19Merge pull request #392 from af83/6240-fix-compliance-check-set-index-bugLuc Donnet
Refs #6240 Fix ComplianceCheckSet#index bug on filters label
2018-03-18Refs #6210 Remove status value attribue from Chouette::VehicleJourney and ↵6210-remove-attributes-from-modelscedricnjanga
section status fron Chouette::JourneyPattern
2018-03-18Refs #6240 Fix ComplianceCheckSet#index bug on filters label6240-fix-compliance-check-set-index-bugcedricnjanga
2018-03-16Fix stop_area state for filter and display. Update reflex sync to use ↵Luc Donnet
confirmed_at. Refs #6141
2018-03-15Use current locale to pluralize Chouette::Network. Refs #6035Alban Peignier
2018-03-15Rename `RouteWayCostJSONSerializer` to `RouteWayCostUnitConverter`Teddy Wing
Because we need to pass a Ruby hash to Rabl instead of a JSON string, get rid of our serialiser and instead turn it into a function that just converts the distance & time units. Fix a bug in the test that had the `'1-2'` key as a symbol instead of a string which was caused by a copy-paste from JSON and not being thorough enough in search-and-replace. Refs #6203
2018-03-15Add `RouteWayCostJSONSerializer`Teddy Wing
This serialiser will take `Route#costs` and convert the distance and time fields from meters to kilometres and seconds to minutes respectively. We need this because the frontend uses kilometre and minute units while the TomTom API gives us the others (and we store the data we get from TomTom without treatment). Unfortunately, due to the way that Rabl works, this doesn't quite work just yet. The serializer returns a string, and Rabl just puts this string into the JSON output instead of a real JSON hash. Looks like I'm going to have to convert my serializer into a generic converter. Refs #6203
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-15Routes: Add `/costs` routeTeddy Wing
Render the `costs` field of a `Chouette::Route` as JSON. This lives at: http://stif-boiv.dev:3000/referentials/4/lines/1857/routes/7/costs.json I want this in order to get the distance & time costs of a route so that I can merge them with `JourneyPattern#costs` on the frontend on `JourneyPatternsCollection#show`. Refs #6203
2018-03-15Merge pull request #379 from ↵Alban Peignier
af83/6095-route--calculate-distance-and-time-cost-between-stops Calculate distance and time cost between Route stops. Refs #6095
2018-03-15Merge pull request #372 from af83/6146-line-statesLuc Donnet
6146 Line state update
2018-03-15Small fixes for i18n state Refs #6146 @16146-line-statesLuc Donnet
2018-03-15Hide full_journey_time/commercial_journey_time labels when ↵Alban Peignier
costs_in_journey_patterns feature is not present. Refs #6102
2018-03-15Merge pull request #370 from af83/6102-commercial-missionsAlban Peignier
Add label in JourneyPattern Editor header. Refs #6102
2018-03-15Fixes extraHeaders position in VehicleJourneys component. Refs #61436143-extra-rows-in-vjs-editor-headerAlban Peignier
2018-03-15Ignore undefined CustomFields in extra headers for ↵Alban Peignier
VehicleJourneysController. Refs #6143
2018-03-15Refs #6143; Configurable extra headers on VJs editorZog
2018-03-15Merge pull request #355 from af83/5113-update-logoAlban Peignier
Refs #5113. Refs #5126. Update LineReferential icon
2018-03-15Route: Don't run `#calculate_costs!` on callback if TomTom disabledTeddy Wing
We say `TomTom` is disabled when no API key is present. If this is the case, the `after_save` callback that uses it shouldn't be executed. I had to change my `API_KEY` constant to an instance variable to be able to change it for testing. Refs #6095
2018-03-15Merge pull request #377 from af83/6107-bind-stop_area_referential-and-workgroupsAlban Peignier
Refs 6106 & 6107. Binds LineReferentials and StopAreaReferentials to Workgroups
2018-03-15Merge pull request #376 from af83/6006-fix-stops-filterAlban Peignier
Fix VehicleJourney#with_ordered_stop_area_ids scope. Refs #6006
2018-03-15Merge pull request #375 from af83/6040-fix-stop-points-poitions-in-merged-routesAlban Peignier
Enforce stop points positions in merged Referential. Refs #6040
2018-03-15Add StopArea#status in stop_areas#_form. Refs #60336033-stop-area-statesAlban Peignier
2018-03-15Refs #6033 Fix stop areas spec featurecedricnjanga
2018-03-15Refs #6033 Update activate and deactivate methodscedricnjanga
2018-03-15Refs #6033 Changes for StopArea#index and StopArea#showcedricnjanga
2018-03-15Fix netex import key message in csv export Refs #5873 @1Luc Donnet
2018-03-14Fix access for import ressources Refs #6133 @3Luc Donnet
2018-03-14Fix bug on VJs editor when invalid journeys are already in db.Zog
2018-03-14Route#duplicate: Use `#slice!` instead of `#slice`Teddy Wing
Johan suggested simplifying this method by changing the `slice` call: http://api.rubyonrails.org/classes/Hash.html#method-i-slice-21 I had modified this to fix the whitespace while working on the `WayCost` calculation function for `Chouette::Route`s, so don't really have a brain cache hit on this code, but the change makes sense and seems to work. Refs #6095
2018-03-14RouteWayCostWorker: Add comment about recursive workersTeddy Wing
Explain why we need to skip and un-skip the callback. Refs #6095
2018-03-14RouteWayCostWorker: Fix recursive worker callTeddy Wing
Since this method was run on `after_save` and in it `RouteWayCostCalculator` calls `#update` on the given route, it caused an infinite recursive call to the worker. To prevent this, wrap the `#calculate!` call in methods that unset and reset the callback. Refs #6095
2018-03-14RouteWayCostWorker: Switch to referential in order to find RouteTeddy Wing
Just running `Chouette::Route.find(id)` doesn't give us anything if we don't have a `Referential` selected. In order to properly get the correct route, pass the referential ID to the worker and switch to that referential before trying to select the route. Refs #6095
2018-03-14Route: Run `#calculate_costs!` on `after_save`Teddy Wing
Not efficient to send a request to the TomTom API every time we save a Route, but I'm banking on developing a cache system soon to avoid having to make the requests, so hopefully that will stop this from making expensive remote calls all the time. Refs #6095
2018-03-14Route: Fix whitespaceTeddy Wing
This method wasn't indented to the same level as the rest of the file. Refs #6095
2018-03-14Route: Add `#calculate_costs!` to populate `#costs` with `WayCost`sTeddy Wing
This new method will launch a worker that takes the route's `StopArea`s, converts them to `WayCost`s, sends them to the TomTom API to calculate distance and time costs, and saves those costs to the route's `costs` field. Refs #6095
2018-03-14Route: Get rid of unnecessary whitespaceTeddy Wing
Refs #6095
2018-03-14Merge pull request #348 from af83/6036-fix-journeys-editorAlban Peignier
Fix the journeys time editor. Refs #6036
2018-03-14Merge pull request #367 from af83/6042-detailed_purchase_windowsAlban Peignier
Add detailed view for purchase windows. Refs #6042
2018-03-14Refs #6021: Make DAY_OFFSET_MAX configurableZog
2018-03-14Refs #6021 @1h; Allow journeys to span over 3 daysZog
And fix the way offsets are computed to use the timezones
2018-03-14Replace hardcoded AAA by expression sized by registration_number_format. ↵Alban Peignier
Refs #5972
2018-03-14Refs #5972 @1h; Automatic registration_number generationZog
2018-03-14Small fixes/improvements in SimpleInterfacesZog
2018-03-14Refs #61066107-bind-stop_area_referential-and-workgroupsZog
Refs #6107 Binds LineReferentials and StopAreaReferentials to Workgroups, and enforce uniqueness
2018-03-14Refs #6146; Fix display in tablesZog
2018-03-14Refs #6146; Fix typoZog