<feed xmlns='http://www.w3.org/2005/Atom'>
<title>chouette-core/app/javascript/journey_patterns, branch enhanced-i18n</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>Hide full_journey_time/commercial_journey_time labels when costs_in_journey_patterns feature is not present. Refs #6102</title>
<updated>2018-03-15T13:02:53+00:00</updated>
<author>
<name>Alban Peignier</name>
</author>
<published>2018-03-15T13:02:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=5557c7f1cee12a4c8214342ab9a9f125eb8886de'/>
<id>5557c7f1cee12a4c8214342ab9a9f125eb8886de</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refs #6102; Add label in JourneyPattern Editor header</title>
<updated>2018-03-12T10:52:48+00:00</updated>
<author>
<name>Zog</name>
</author>
<published>2018-03-12T10:52:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=84c7eb8f171e1a353a06496b088f73837a3425ff'/>
<id>84c7eb8f171e1a353a06496b088f73837a3425ff</id>
<content type='text'>
Refs #6104; Add commercial-only journey time in JourneyPattern Editor
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Refs #6104; Add commercial-only journey time in JourneyPattern Editor
</pre>
</div>
</content>
</entry>
<entry>
<title>Refs #5796: Add some legroom in the JourneyPatterns editor</title>
<updated>2018-01-31T14:50:00+00:00</updated>
<author>
<name>Zog</name>
</author>
<published>2018-01-31T14:47:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=ee7fe7a4760c3fdde987ef666db45c161e788ee9'/>
<id>ee7fe7a4760c3fdde987ef666db45c161e788ee9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refs #5598; Enable button to view a JourneyPattern when the user is not allowed to edit it</title>
<updated>2018-01-25T10:39:32+00:00</updated>
<author>
<name>Zog</name>
</author>
<published>2018-01-25T10:39:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=050772225bdff8ef165c1e8e841b1eec664d6c99'/>
<id>050772225bdff8ef165c1e8e841b1eec664d6c99</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refs #5529 @0.5h; Refactor buttons</title>
<updated>2018-01-12T14:41:11+00:00</updated>
<author>
<name>Zog</name>
</author>
<published>2018-01-10T14:59:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=84f3edcfc7213d5a02f10ba002e091e1563f2e27'/>
<id>84f3edcfc7213d5a02f10ba002e091e1563f2e27</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refs #5529 @0.5h; Prevent double submitting of react forms</title>
<updated>2018-01-12T14:40:14+00:00</updated>
<author>
<name>Zog</name>
</author>
<published>2018-01-10T14:21:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=853c7494b908c8b9dea3b91332ab1265aa40f428'/>
<id>853c7494b908c8b9dea3b91332ab1265aa40f428</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixes icons and order of total. Refs #5556</title>
<updated>2018-01-11T17:58:42+00:00</updated>
<author>
<name>Alban Peignier</name>
</author>
<published>2018-01-11T17:58:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=5844565ac4e4fe6cc6572bbe42b850e3cce0b541'/>
<id>5844565ac4e4fe6cc6572bbe42b850e3cce0b541</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refs #5556 @0.25h; Show total time and distance in JP editor</title>
<updated>2018-01-11T16:47:21+00:00</updated>
<author>
<name>Zog</name>
</author>
<published>2018-01-11T16:47:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=69f4fe0c2ef6426282bb8315b185f2e13e37310c'/>
<id>69f4fe0c2ef6426282bb8315b185f2e13e37310c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refs #5536; Fix JourneyPattern creation</title>
<updated>2018-01-11T09:49:46+00:00</updated>
<author>
<name>Zog</name>
</author>
<published>2018-01-11T09:49:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=f7ed3ca6615bb4950b644d56136016c4482395a8'/>
<id>f7ed3ca6615bb4950b644d56136016c4482395a8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
