<feed xmlns='http://www.w3.org/2005/Atom'>
<title>chouette-core/spec/javascript, branch 6960-workgroup-edition</title>
<subtitle>Chouette manage transport static data</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/'/>
<entry>
<title>JourneyPatternsCollection#show: Fallback to route costs</title>
<updated>2018-03-15T16:44:22+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-03-15T15:19:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=fa0fdbe92d441e1a226a56c792c014a032fd46e9'/>
<id>fa0fdbe92d441e1a226a56c792c014a032fd46e9</id>
<content type='text'>
When editing a `JourneyPattern`, you can edit the distance &amp; 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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When editing a `JourneyPattern`, you can edit the distance &amp; 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
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixes VehicleJourneys javascript spec. Refs #6143</title>
<updated>2018-03-15T13:07:04+00:00</updated>
<author>
<name>Alban Peignier</name>
</author>
<published>2018-03-15T13:07:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=e3177715d4734c4804c85c6a1a4b08cd34745818'/>
<id>e3177715d4734c4804c85c6a1a4b08cd34745818</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix javascript specs</title>
<updated>2018-03-15T13:00:06+00:00</updated>
<author>
<name>Zog</name>
</author>
<published>2018-03-15T12:59:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=e761d6fb5c70e060fc53f9119903b38a531d99c9'/>
<id>e761d6fb5c70e060fc53f9119903b38a531d99c9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #348 from af83/6036-fix-journeys-editor</title>
<updated>2018-03-14T15:29:36+00:00</updated>
<author>
<name>Alban Peignier</name>
</author>
<published>2018-03-14T15:29:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=6aa3c52c786717a709b1069583b5ffc75ef0b698'/>
<id>6aa3c52c786717a709b1069583b5ffc75ef0b698</id>
<content type='text'>
Fix the journeys time editor. Refs #6036 </content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix the journeys time editor. Refs #6036 </pre>
</div>
</content>
</entry>
<entry>
<title>Refs #6008; Use same time for arrival &amp; departure in 1st and last stops</title>
<updated>2018-02-27T15:05:51+00:00</updated>
<author>
<name>Zog</name>
</author>
<published>2018-02-27T15:05:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=9c82d307f71caf58c142ee28035f7f20eab5f7e9'/>
<id>9c82d307f71caf58c142ee28035f7f20eab5f7e9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refs #6063; Fix the journeys time editor</title>
<updated>2018-02-27T13:38:51+00:00</updated>
<author>
<name>Zog</name>
</author>
<published>2018-02-27T13:38:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=06ff047a212c8c1dd6eb1de10ce92f0059151d2a'/>
<id>06ff047a212c8c1dd6eb1de10ce92f0059151d2a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refs #5942; Apply users TZ when computing a schedule</title>
<updated>2018-02-21T15:42:04+00:00</updated>
<author>
<name>Zog</name>
</author>
<published>2018-02-21T15:42:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=020c42f3e5046377c71daab0e57abdbb1809bf0f'/>
<id>020c42f3e5046377c71daab0e57abdbb1809bf0f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refs #5944; Skip automated times calculation when no start time is set</title>
<updated>2018-02-21T15:19:08+00:00</updated>
<author>
<name>Zog</name>
</author>
<published>2018-02-21T15:05:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=d718159ff008c25ab7d51c6714444bd7bd24a77d'/>
<id>d718159ff008c25ab7d51c6714444bd7bd24a77d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #303 from af83/5899-use-waiting-time-in-schedules</title>
<updated>2018-02-19T20:20:54+00:00</updated>
<author>
<name>Alban Peignier</name>
</author>
<published>2018-02-19T20:20:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=688ed83020fc97396382905b1409e2c61159abe3'/>
<id>688ed83020fc97396382905b1409e2c61159abe3</id>
<content type='text'>
Use waiting_time in schedules computation. Refs #5899 </content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use waiting_time in schedules computation. Refs #5899 </pre>
</div>
</content>
</entry>
<entry>
<title>Fixes javascript VehicleJourneys snapshot. Refs #5853</title>
<updated>2018-02-19T20:15:58+00:00</updated>
<author>
<name>Alban Peignier</name>
</author>
<published>2018-02-19T20:08:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=3ff86c41e136fa58cb1bc2b2f772ba5a9f23a4bb'/>
<id>3ff86c41e136fa58cb1bc2b2f772ba5a9f23a4bb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
