{"action":"created","comment":{"url":"https://api.github.com/repos/umts/pvta-multiplatform/pulls/comments/85192612","pull_request_review_id":5922093,"id":85192612,"diff_hunk":"@@ -217,66 +219,78 @@ angular.module('pvta.controllers').controller('PlanTripController', function ($s\n     if (!$scope.params.origin.id || !$scope.params.destination.id) {\n       return;\n     }\n-    $scope.route = {\n-      directions: [],\n-      arrivalTime: null,\n-      departureTime: null,\n-      origin: null,\n-      destination: null\n-    };\n+\n     // Google won't return trips for times past.\n     // Instead of throwing an error, assume the user wants\n     // directions for right now.\n     if ($scope.params.time.datetime < Date.now()) {\n       $scope.updateASAP(true);\n     }\n+\n     $ionicLoading.show({\n       template: 'Routing..'\n     });\n-    // The Trip factory takes care of the forming/sending\n-    // the request and retrieving the response for us.\n-    Trips.route($scope.params, $scope.directionsDisplay, function (tripDetails) {\n-      // Now, we have a crude trip object!\n-      $ionicLoading.hide();\n-      $scope.route = tripDetails;\n-      if ($scope.route.status === google.maps.DirectionsStatus.OK) {\n-        // Trip factory will parse the trip and return a clean\n-        // array of directions.\n-        Trips.generateDirections(function (tripDetails) {\n-          $scope.route.directions = tripDetails;\n-          $scope.$apply();\n-          $scope.scrollTo('route');\n-          // Force a map redraw because it was hidden before.\n-          // There's an angular bug with ng-show that will cause\n-          // the map to draw only grey after being hidden\n-          // unless we force a redraw.\n-          google.maps.event.trigger($scope.map, 'resize');\n-          ga('send', 'event', 'TripStepsRetrieved', 'PlanTripController.getRoute()', 'Received steps for a planned trip!');\n-        });\n+\n+    transitOptions = {\n+      modes: [google.maps.TransitMode.BUS]\n+    };\n+\n+  if ($scope.params.time.asap !== true) {\n+      if ($scope.params.time.type === 'departure') {\n+        transitOptions['departureTime'] = $scope.params.time.datetime;\n+      }\n+      else if ($scope.params.time.type === 'arrival') {\n+        transitOptions['arrivalTime'] = $scope.params.time.datetime;\n       }\n-      // If Google doesn't have directions for us,\n-      // handle it gracefully.\n       else {\n+        console.error(\"Determining route for Plan Trip failed due to unexpected input. Expected 'arrival' or 'departure', received\" + params.time.type);","path":"www/pages/plan-trip/plan-trip-controller.js","position":74,"original_position":74,"commit_id":"ebfa085f56032a4edeb1e0d57e1e24fecf4aa83e","original_commit_id":"ebfa085f56032a4edeb1e0d57e1e24fecf4aa83e","user":{"login":"akaplo","id":7144148,"avatar_url":"https://avatars.githubusercontent.com/u/7144148?v=3","gravatar_id":"","url":"https://api.github.com/users/akaplo","html_url":"https://github.com/akaplo","followers_url":"https://api.github.com/users/akaplo/followers","following_url":"https://api.github.com/users/akaplo/following{/other_user}","gists_url":"https://api.github.com/users/akaplo/gists{/gist_id}","starred_url":"https://api.github.com/users/akaplo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akaplo/subscriptions","organizations_url":"https://api.github.com/users/akaplo/orgs","repos_url":"https://api.github.com/users/akaplo/repos","events_url":"https://api.github.com/users/akaplo/events{/privacy}","received_events_url":"https://api.github.com/users/akaplo/received_events","type":"User","site_admin":false},"body":"Can you add a Google Analytics event in here?  See [line 270](https://github.com/umts/pvta-multiplatform/pull/245/files#diff-c2cca39ec92cc35caca7992082d316c2R270) for an example.","created_at":"2016-10-26T18:45:23Z","updated_at":"2016-10-26T18:45:23Z","html_url":"https://github.com/umts/pvta-multiplatform/pull/245#discussion_r85192612","pull_request_url":"https://api.github.com/repos/umts/pvta-multiplatform/pulls/245","_links":{"self":{"href":"https://api.github.com/repos/umts/pvta-multiplatform/pulls/comments/85192612"},"html":{"href":"https://github.com/umts/pvta-multiplatform/pull/245#discussion_r85192612"},"pull_request":{"href":"https://api.github.com/repos/umts/pvta-multiplatform/pulls/245"}}},"pull_request":{"url":"https://api.github.com/repos/umts/pvta-multiplatform/pulls/245","id":90695958,"html_url":"https://github.com/umts/pvta-multiplatform/pull/245","diff_url":"https://github.com/umts/pvta-multiplatform/pull/245.diff","patch_url":"https://github.com/umts/pvta-multiplatform/pull/245.patch","issue_url":"https://api.github.com/repos/umts/pvta-multiplatform/issues/245","number":245,"state":"open","locked":false,"title":"Plan trip timeline","user":{"login":"petermarathas","id":6088239,"avatar_url":"https://avatars.githubusercontent.com/u/6088239?v=3","gravatar_id":"","url":"https://api.github.com/users/petermarathas","html_url":"https://github.com/petermarathas","followers_url":"https://api.github.com/users/petermarathas/followers","following_url":"https://api.github.com/users/petermarathas/following{/other_user}","gists_url":"https://api.github.com/users/petermarathas/gists{/gist_id}","starred_url":"https://api.github.com/users/petermarathas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petermarathas/subscriptions","organizations_url":"https://api.github.com/users/petermarathas/orgs","repos_url":"https://api.github.com/users/petermarathas/repos","events_url":"https://api.github.com/users/petermarathas/events{/privacy}","received_events_url":"https://api.github.com/users/petermarathas/received_events","type":"User","site_admin":false},"body":"![screen shot 2016-10-24 at 5 14 18 pm](https://cloud.githubusercontent.com/assets/6088239/19664374/07a832ec-9a0e-11e6-829b-d9e0273b3e31.png)\r\n\r\nNew format for plan trip that uses timeline and links directions to their respective stop page. Also cleaned up and moved routing logic out of trips-factory and back into plan-trip-controller.\r\n\r\nPlease constructively criticize the UI if you see room for improvements :bowtie: ","created_at":"2016-10-24T21:25:53Z","updated_at":"2016-10-26T18:45:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"adfb14917957fb429ad3a27e843ba338c9e1b34e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/umts/pvta-multiplatform/pulls/245/commits","review_comments_url":"https://api.github.com/repos/umts/pvta-multiplatform/pulls/245/comments","review_comment_url":"https://api.github.com/repos/umts/pvta-multiplatform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/umts/pvta-multiplatform/issues/245/comments","statuses_url":"https://api.github.com/repos/umts/pvta-multiplatform/statuses/ebfa085f56032a4edeb1e0d57e1e24fecf4aa83e","head":{"label":"umts:plan-trip-timeline","ref":"plan-trip-timeline","sha":"ebfa085f56032a4edeb1e0d57e1e24fecf4aa83e","user":{"login":"umts","id":398175,"avatar_url":"https://avatars.githubusercontent.com/u/398175?v=3","gravatar_id":"","url":"https://api.github.com/users/umts","html_url":"https://github.com/umts","followers_url":"https://api.github.com/users/umts/followers","following_url":"https://api.github.com/users/umts/following{/other_user}","gists_url":"https://api.github.com/users/umts/gists{/gist_id}","starred_url":"https://api.github.com/users/umts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umts/subscriptions","organizations_url":"https://api.github.com/users/umts/orgs","repos_url":"https://api.github.com/users/umts/repos","events_url":"https://api.github.com/users/umts/events{/privacy}","received_events_url":"https://api.github.com/users/umts/received_events","type":"Organization","site_admin":false},"repo":{"id":49676297,"name":"pvta-multiplatform","full_name":"umts/pvta-multiplatform","owner":{"login":"umts","id":398175,"avatar_url":"https://avatars.githubusercontent.com/u/398175?v=3","gravatar_id":"","url":"https://api.github.com/users/umts","html_url":"https://github.com/umts","followers_url":"https://api.github.com/users/umts/followers","following_url":"https://api.github.com/users/umts/following{/other_user}","gists_url":"https://api.github.com/users/umts/gists{/gist_id}","starred_url":"https://api.github.com/users/umts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umts/subscriptions","organizations_url":"https://api.github.com/users/umts/orgs","repos_url":"https://api.github.com/users/umts/repos","events_url":"https://api.github.com/users/umts/events{/privacy}","received_events_url":"https://api.github.com/users/umts/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/umts/pvta-multiplatform","description":"Transit realtime app for mobile devices","fork":true,"url":"https://api.github.com/repos/umts/pvta-multiplatform","forks_url":"https://api.github.com/repos/umts/pvta-multiplatform/forks","keys_url":"https://api.github.com/repos/umts/pvta-multiplatform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/umts/pvta-multiplatform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/umts/pvta-multiplatform/teams","hooks_url":"https://api.github.com/repos/umts/pvta-multiplatform/hooks","issue_events_url":"https://api.github.com/repos/umts/pvta-multiplatform/issues/events{/number}","events_url":"https://api.github.com/repos/umts/pvta-multiplatform/events","assignees_url":"https://api.github.com/repos/umts/pvta-multiplatform/assignees{/user}","branches_url":"https://api.github.com/repos/umts/pvta-multiplatform/branches{/branch}","tags_url":"https://api.github.com/repos/umts/pvta-multiplatform/tags","blobs_url":"https://api.github.com/repos/umts/pvta-multiplatform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/umts/pvta-multiplatform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/umts/pvta-multiplatform/git/refs{/sha}","trees_url":"https://api.github.com/repos/umts/pvta-multiplatform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/umts/pvta-multiplatform/statuses/{sha}","languages_url":"https://api.github.com/repos/umts/pvta-multiplatform/languages","stargazers_url":"https://api.github.com/repos/umts/pvta-multiplatform/stargazers","contributors_url":"https://api.github.com/repos/umts/pvta-multiplatform/contributors","subscribers_url":"https://api.github.com/repos/umts/pvta-multiplatform/subscribers","subscription_url":"https://api.github.com/repos/umts/pvta-multiplatform/subscription","commits_url":"https://api.github.com/repos/umts/pvta-multiplatform/commits{/sha}","git_commits_url":"https://api.github.com/repos/umts/pvta-multiplatform/git/commits{/sha}","comments_url":"https://api.github.com/repos/umts/pvta-multiplatform/comments{/number}","issue_comment_url":"https://api.github.com/repos/umts/pvta-multiplatform/issues/comments{/number}","contents_url":"https://api.github.com/repos/umts/pvta-multiplatform/contents/{+path}","compare_url":"https://api.github.com/repos/umts/pvta-multiplatform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/umts/pvta-multiplatform/merges","archive_url":"https://api.github.com/repos/umts/pvta-multiplatform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/umts/pvta-multiplatform/downloads","issues_url":"https://api.github.com/repos/umts/pvta-multiplatform/issues{/number}","pulls_url":"https://api.github.com/repos/umts/pvta-multiplatform/pulls{/number}","milestones_url":"https://api.github.com/repos/umts/pvta-multiplatform/milestones{/number}","notifications_url":"https://api.github.com/repos/umts/pvta-multiplatform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/umts/pvta-multiplatform/labels{/name}","releases_url":"https://api.github.com/repos/umts/pvta-multiplatform/releases{/id}","deployments_url":"https://api.github.com/repos/umts/pvta-multiplatform/deployments","created_at":"2016-01-14T21:28:36Z","updated_at":"2016-04-13T20:30:02Z","pushed_at":"2016-10-26T17:13:30Z","git_url":"git://github.com/umts/pvta-multiplatform.git","ssh_url":"git@github.com:umts/pvta-multiplatform.git","clone_url":"https://github.com/umts/pvta-multiplatform.git","svn_url":"https://github.com/umts/pvta-multiplatform","homepage":"","size":53575,"stargazers_count":2,"watchers_count":2,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":14,"forks":3,"open_issues":14,"watchers":2,"default_branch":"master"}},"base":{"label":"umts:master","ref":"master","sha":"8510159d135cd92835b6616f831c7c7b5ea933eb","user":{"login":"umts","id":398175,"avatar_url":"https://avatars.githubusercontent.com/u/398175?v=3","gravatar_id":"","url":"https://api.github.com/users/umts","html_url":"https://github.com/umts","followers_url":"https://api.github.com/users/umts/followers","following_url":"https://api.github.com/users/umts/following{/other_user}","gists_url":"https://api.github.com/users/umts/gists{/gist_id}","starred_url":"https://api.github.com/users/umts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umts/subscriptions","organizations_url":"https://api.github.com/users/umts/orgs","repos_url":"https://api.github.com/users/umts/repos","events_url":"https://api.github.com/users/umts/events{/privacy}","received_events_url":"https://api.github.com/users/umts/received_events","type":"Organization","site_admin":false},"repo":{"id":49676297,"name":"pvta-multiplatform","full_name":"umts/pvta-multiplatform","owner":{"login":"umts","id":398175,"avatar_url":"https://avatars.githubusercontent.com/u/398175?v=3","gravatar_id":"","url":"https://api.github.com/users/umts","html_url":"https://github.com/umts","followers_url":"https://api.github.com/users/umts/followers","following_url":"https://api.github.com/users/umts/following{/other_user}","gists_url":"https://api.github.com/users/umts/gists{/gist_id}","starred_url":"https://api.github.com/users/umts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umts/subscriptions","organizations_url":"https://api.github.com/users/umts/orgs","repos_url":"https://api.github.com/users/umts/repos","events_url":"https://api.github.com/users/umts/events{/privacy}","received_events_url":"https://api.github.com/users/umts/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/umts/pvta-multiplatform","description":"Transit realtime app for mobile devices","fork":true,"url":"https://api.github.com/repos/umts/pvta-multiplatform","forks_url":"https://api.github.com/repos/umts/pvta-multiplatform/forks","keys_url":"https://api.github.com/repos/umts/pvta-multiplatform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/umts/pvta-multiplatform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/umts/pvta-multiplatform/teams","hooks_url":"https://api.github.com/repos/umts/pvta-multiplatform/hooks","issue_events_url":"https://api.github.com/repos/umts/pvta-multiplatform/issues/events{/number}","events_url":"https://api.github.com/repos/umts/pvta-multiplatform/events","assignees_url":"https://api.github.com/repos/umts/pvta-multiplatform/assignees{/user}","branches_url":"https://api.github.com/repos/umts/pvta-multiplatform/branches{/branch}","tags_url":"https://api.github.com/repos/umts/pvta-multiplatform/tags","blobs_url":"https://api.github.com/repos/umts/pvta-multiplatform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/umts/pvta-multiplatform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/umts/pvta-multiplatform/git/refs{/sha}","trees_url":"https://api.github.com/repos/umts/pvta-multiplatform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/umts/pvta-multiplatform/statuses/{sha}","languages_url":"https://api.github.com/repos/umts/pvta-multiplatform/languages","stargazers_url":"https://api.github.com/repos/umts/pvta-multiplatform/stargazers","contributors_url":"https://api.github.com/repos/umts/pvta-multiplatform/contributors","subscribers_url":"https://api.github.com/repos/umts/pvta-multiplatform/subscribers","subscription_url":"https://api.github.com/repos/umts/pvta-multiplatform/subscription","commits_url":"https://api.github.com/repos/umts/pvta-multiplatform/commits{/sha}","git_commits_url":"https://api.github.com/repos/umts/pvta-multiplatform/git/commits{/sha}","comments_url":"https://api.github.com/repos/umts/pvta-multiplatform/comments{/number}","issue_comment_url":"https://api.github.com/repos/umts/pvta-multiplatform/issues/comments{/number}","contents_url":"https://api.github.com/repos/umts/pvta-multiplatform/contents/{+path}","compare_url":"https://api.github.com/repos/umts/pvta-multiplatform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/umts/pvta-multiplatform/merges","archive_url":"https://api.github.com/repos/umts/pvta-multiplatform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/umts/pvta-multiplatform/downloads","issues_url":"https://api.github.com/repos/umts/pvta-multiplatform/issues{/number}","pulls_url":"https://api.github.com/repos/umts/pvta-multiplatform/pulls{/number}","milestones_url":"https://api.github.com/repos/umts/pvta-multiplatform/milestones{/number}","notifications_url":"https://api.github.com/repos/umts/pvta-multiplatform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/umts/pvta-multiplatform/labels{/name}","releases_url":"https://api.github.com/repos/umts/pvta-multiplatform/releases{/id}","deployments_url":"https://api.github.com/repos/umts/pvta-multiplatform/deployments","created_at":"2016-01-14T21:28:36Z","updated_at":"2016-04-13T20:30:02Z","pushed_at":"2016-10-26T17:13:30Z","git_url":"git://github.com/umts/pvta-multiplatform.git","ssh_url":"git@github.com:umts/pvta-multiplatform.git","clone_url":"https://github.com/umts/pvta-multiplatform.git","svn_url":"https://github.com/umts/pvta-multiplatform","homepage":"","size":53575,"stargazers_count":2,"watchers_count":2,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":14,"forks":3,"open_issues":14,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/umts/pvta-multiplatform/pulls/245"},"html":{"href":"https://github.com/umts/pvta-multiplatform/pull/245"},"issue":{"href":"https://api.github.com/repos/umts/pvta-multiplatform/issues/245"},"comments":{"href":"https://api.github.com/repos/umts/pvta-multiplatform/issues/245/comments"},"review_comments":{"href":"https://api.github.com/repos/umts/pvta-multiplatform/pulls/245/comments"},"review_comment":{"href":"https://api.github.com/repos/umts/pvta-multiplatform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/umts/pvta-multiplatform/pulls/245/commits"},"statuses":{"href":"https://api.github.com/repos/umts/pvta-multiplatform/statuses/ebfa085f56032a4edeb1e0d57e1e24fecf4aa83e"}}}}
{"actor":{"display_login":"akaplo"}}