{"action":"created","issue":{"url":"https://api.github.com/repos/percy/percy-web/issues/790","repository_url":"https://api.github.com/repos/percy/percy-web","labels_url":"https://api.github.com/repos/percy/percy-web/issues/790/labels{/name}","comments_url":"https://api.github.com/repos/percy/percy-web/issues/790/comments","events_url":"https://api.github.com/repos/percy/percy-web/issues/790/events","html_url":"https://github.com/percy/percy-web/pull/790","id":365031743,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5MDc5MTMy","number":790,"title":"New default org routes","user":{"login":"cadeParade","id":3179218,"node_id":"MDQ6VXNlcjMxNzkyMTg=","avatar_url":"https://avatars3.githubusercontent.com/u/3179218?v=4","gravatar_id":"","url":"https://api.github.com/users/cadeParade","html_url":"https://github.com/cadeParade","followers_url":"https://api.github.com/users/cadeParade/followers","following_url":"https://api.github.com/users/cadeParade/following{/other_user}","gists_url":"https://api.github.com/users/cadeParade/gists{/gist_id}","starred_url":"https://api.github.com/users/cadeParade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cadeParade/subscriptions","organizations_url":"https://api.github.com/users/cadeParade/orgs","repos_url":"https://api.github.com/users/cadeParade/repos","events_url":"https://api.github.com/users/cadeParade/events{/privacy}","received_events_url":"https://api.github.com/users/cadeParade/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-28T20:36:07Z","updated_at":"2018-10-01T15:12:15Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/percy/percy-web/pulls/790","html_url":"https://github.com/percy/percy-web/pull/790","diff_url":"https://github.com/percy/percy-web/pull/790.diff","patch_url":"https://github.com/percy/percy-web/pull/790.patch"},"body":"## Description\r\nThis PR solves a problem that will come up in the new banner for the PVP project. In it, we will have a button that says \"Jump to your projects\". This could link to the current `redirectToCurrentOrganization` method, but this method uses localStorage preferentially which has **the most recently visited org** stored in it. This means that whenever a user clicked that button, they would be taken to the same org they were on, which would not be their org.\r\nSo we need two options for redirecting to \"default\" org -- 1) Redirect to most recently viewed org and 2) Redirect to default org _that belongs to the viewer_.\r\n\r\n\r\nTo this end, this PR introduces two new things: \r\n1) A service that controls which org should be the default org a user should be redirected to. This method has been a pain for a while, but is exacerbated by the PVP project. The service has a method of the same name, `redirectToDefaultOrganzation` but now has an optional parameter `useMostRecentOrg`. When this is false, it skips the localStorage lookup.\r\n2) Two new routes, one that redirects to default org and one that redirects to most recent org. With these routes we can reference them in `link-to`s in the template and not worry about passing any actions down or importing the service.\r\n\r\n## Reviewing this PR\r\nWhatchu think of these patterns?\r\n\r\n_**Is Covered by Automated Tests?: Yesish -- the service functionality is tested through the new route acceptance tests.**_\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/percy/percy-web/issues/comments/425944421","html_url":"https://github.com/percy/percy-web/pull/790#issuecomment-425944421","issue_url":"https://api.github.com/repos/percy/percy-web/issues/790","id":425944421,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTk0NDQyMQ==","user":{"login":"maprules1000","id":1929735,"node_id":"MDQ6VXNlcjE5Mjk3MzU=","avatar_url":"https://avatars0.githubusercontent.com/u/1929735?v=4","gravatar_id":"","url":"https://api.github.com/users/maprules1000","html_url":"https://github.com/maprules1000","followers_url":"https://api.github.com/users/maprules1000/followers","following_url":"https://api.github.com/users/maprules1000/following{/other_user}","gists_url":"https://api.github.com/users/maprules1000/gists{/gist_id}","starred_url":"https://api.github.com/users/maprules1000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maprules1000/subscriptions","organizations_url":"https://api.github.com/users/maprules1000/orgs","repos_url":"https://api.github.com/users/maprules1000/repos","events_url":"https://api.github.com/users/maprules1000/events{/privacy}","received_events_url":"https://api.github.com/users/maprules1000/received_events","type":"User","site_admin":false},"created_at":"2018-10-01T15:12:15Z","updated_at":"2018-10-01T15:12:15Z","author_association":"MEMBER","body":"It looks like there's a missing service injection in the tests when I run it all in a browser. \r\n\r\nThe `application-test.js` unit test needs `service:redirects` added to the needs array."}}
{"actor":{"display_login":"maprules1000"}}