{"action":"created","comment":{"url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/pulls/comments/52312515","id":52312515,"diff_hunk":"@@ -15,31 +15,47 @@\n  * along with MystudiesMyteaching application.  If not, see <http://www.gnu.org/licenses/>.\n  */\n \n-angular.module('directives.stateChange', [\n+angular.module('services.stateChange', [\n   'services.state',\n   'services.session'])\n \n-  .service('StateChangeService', function(Role, SessionService, $q,\n-                                          localStorageService, State, $window) {\n+  .factory('StateChangeService', function($q,\n+                                          $window,\n+                                          Role,\n+                                          SessionService,\n+                                          localStorageService,\n+                                          StateService,\n+                                          State) {\n     function isStateChangeAvailable() {\n       var defer = $q.defer();","path":"src/app/services/stateChange.service.js","position":19,"original_position":19,"commit_id":"2078d26c932ff06ff689ff701fbdddf23c178232","original_commit_id":"2078d26c932ff06ff689ff701fbdddf23c178232","user":{"login":"hheiskanen","id":6654979,"avatar_url":"https://avatars.githubusercontent.com/u/6654979?v=3","gravatar_id":"","url":"https://api.github.com/users/hheiskanen","html_url":"https://github.com/hheiskanen","followers_url":"https://api.github.com/users/hheiskanen/followers","following_url":"https://api.github.com/users/hheiskanen/following{/other_user}","gists_url":"https://api.github.com/users/hheiskanen/gists{/gist_id}","starred_url":"https://api.github.com/users/hheiskanen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hheiskanen/subscriptions","organizations_url":"https://api.github.com/users/hheiskanen/orgs","repos_url":"https://api.github.com/users/hheiskanen/repos","events_url":"https://api.github.com/users/hheiskanen/events{/privacy}","received_events_url":"https://api.github.com/users/hheiskanen/received_events","type":"User","site_admin":false},"body":"Turha `defer`in käyttö, funktiosta voi palauttaa promisen suoraan: `return SessionService.getSession.then...`","created_at":"2016-02-09T14:21:22Z","updated_at":"2016-02-09T14:21:22Z","html_url":"https://github.com/UH-StudentServices/mystudies-myteaching-frontend/pull/28#discussion_r52312515","pull_request_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/pulls/comments/52312515"},"html":{"href":"https://github.com/UH-StudentServices/mystudies-myteaching-frontend/pull/28#discussion_r52312515"},"pull_request":{"href":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/pulls/28","id":58745300,"html_url":"https://github.com/UH-StudentServices/mystudies-myteaching-frontend/pull/28","diff_url":"https://github.com/UH-StudentServices/mystudies-myteaching-frontend/pull/28.diff","patch_url":"https://github.com/UH-StudentServices/mystudies-myteaching-frontend/pull/28.patch","issue_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/issues/28","number":28,"state":"open","locked":false,"title":"Fix hybrid user state change and tests","user":{"login":"markorautajoki","id":1059322,"avatar_url":"https://avatars.githubusercontent.com/u/1059322?v=3","gravatar_id":"","url":"https://api.github.com/users/markorautajoki","html_url":"https://github.com/markorautajoki","followers_url":"https://api.github.com/users/markorautajoki/followers","following_url":"https://api.github.com/users/markorautajoki/following{/other_user}","gists_url":"https://api.github.com/users/markorautajoki/gists{/gist_id}","starred_url":"https://api.github.com/users/markorautajoki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markorautajoki/subscriptions","organizations_url":"https://api.github.com/users/markorautajoki/orgs","repos_url":"https://api.github.com/users/markorautajoki/repos","events_url":"https://api.github.com/users/markorautajoki/events{/privacy}","received_events_url":"https://api.github.com/users/markorautajoki/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-09T13:13:22Z","updated_at":"2016-02-09T14:21:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"12ee54a5ae5977d7ade03b112459c87e75388bb0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/pulls/28/commits","review_comments_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/pulls/28/comments","review_comment_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/issues/28/comments","statuses_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/statuses/2078d26c932ff06ff689ff701fbdddf23c178232","head":{"label":"UH-StudentServices:fix-hybrid-user-state-change-and-tests","ref":"fix-hybrid-user-state-change-and-tests","sha":"2078d26c932ff06ff689ff701fbdddf23c178232","user":{"login":"UH-StudentServices","id":11271527,"avatar_url":"https://avatars.githubusercontent.com/u/11271527?v=3","gravatar_id":"","url":"https://api.github.com/users/UH-StudentServices","html_url":"https://github.com/UH-StudentServices","followers_url":"https://api.github.com/users/UH-StudentServices/followers","following_url":"https://api.github.com/users/UH-StudentServices/following{/other_user}","gists_url":"https://api.github.com/users/UH-StudentServices/gists{/gist_id}","starred_url":"https://api.github.com/users/UH-StudentServices/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UH-StudentServices/subscriptions","organizations_url":"https://api.github.com/users/UH-StudentServices/orgs","repos_url":"https://api.github.com/users/UH-StudentServices/repos","events_url":"https://api.github.com/users/UH-StudentServices/events{/privacy}","received_events_url":"https://api.github.com/users/UH-StudentServices/received_events","type":"Organization","site_admin":false},"repo":{"id":46274112,"name":"mystudies-myteaching-frontend","full_name":"UH-StudentServices/mystudies-myteaching-frontend","owner":{"login":"UH-StudentServices","id":11271527,"avatar_url":"https://avatars.githubusercontent.com/u/11271527?v=3","gravatar_id":"","url":"https://api.github.com/users/UH-StudentServices","html_url":"https://github.com/UH-StudentServices","followers_url":"https://api.github.com/users/UH-StudentServices/followers","following_url":"https://api.github.com/users/UH-StudentServices/following{/other_user}","gists_url":"https://api.github.com/users/UH-StudentServices/gists{/gist_id}","starred_url":"https://api.github.com/users/UH-StudentServices/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UH-StudentServices/subscriptions","organizations_url":"https://api.github.com/users/UH-StudentServices/orgs","repos_url":"https://api.github.com/users/UH-StudentServices/repos","events_url":"https://api.github.com/users/UH-StudentServices/events{/privacy}","received_events_url":"https://api.github.com/users/UH-StudentServices/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UH-StudentServices/mystudies-myteaching-frontend","description":"","fork":false,"url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend","forks_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/forks","keys_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/teams","hooks_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/hooks","issue_events_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/events","assignees_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/tags","blobs_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/languages","stargazers_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/stargazers","contributors_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/contributors","subscribers_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/subscribers","subscription_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/subscription","commits_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/merges","archive_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/downloads","issues_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/labels{/name}","releases_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/deployments","created_at":"2015-11-16T12:46:34Z","updated_at":"2016-01-13T12:36:22Z","pushed_at":"2016-02-09T13:13:23Z","git_url":"git://github.com/UH-StudentServices/mystudies-myteaching-frontend.git","ssh_url":"git@github.com:UH-StudentServices/mystudies-myteaching-frontend.git","clone_url":"https://github.com/UH-StudentServices/mystudies-myteaching-frontend.git","svn_url":"https://github.com/UH-StudentServices/mystudies-myteaching-frontend","homepage":null,"size":961,"stargazers_count":1,"watchers_count":1,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"develop"}},"base":{"label":"UH-StudentServices:develop","ref":"develop","sha":"e6a04915a4bfb8a6ecafde03b83c2a073cce09bd","user":{"login":"UH-StudentServices","id":11271527,"avatar_url":"https://avatars.githubusercontent.com/u/11271527?v=3","gravatar_id":"","url":"https://api.github.com/users/UH-StudentServices","html_url":"https://github.com/UH-StudentServices","followers_url":"https://api.github.com/users/UH-StudentServices/followers","following_url":"https://api.github.com/users/UH-StudentServices/following{/other_user}","gists_url":"https://api.github.com/users/UH-StudentServices/gists{/gist_id}","starred_url":"https://api.github.com/users/UH-StudentServices/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UH-StudentServices/subscriptions","organizations_url":"https://api.github.com/users/UH-StudentServices/orgs","repos_url":"https://api.github.com/users/UH-StudentServices/repos","events_url":"https://api.github.com/users/UH-StudentServices/events{/privacy}","received_events_url":"https://api.github.com/users/UH-StudentServices/received_events","type":"Organization","site_admin":false},"repo":{"id":46274112,"name":"mystudies-myteaching-frontend","full_name":"UH-StudentServices/mystudies-myteaching-frontend","owner":{"login":"UH-StudentServices","id":11271527,"avatar_url":"https://avatars.githubusercontent.com/u/11271527?v=3","gravatar_id":"","url":"https://api.github.com/users/UH-StudentServices","html_url":"https://github.com/UH-StudentServices","followers_url":"https://api.github.com/users/UH-StudentServices/followers","following_url":"https://api.github.com/users/UH-StudentServices/following{/other_user}","gists_url":"https://api.github.com/users/UH-StudentServices/gists{/gist_id}","starred_url":"https://api.github.com/users/UH-StudentServices/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UH-StudentServices/subscriptions","organizations_url":"https://api.github.com/users/UH-StudentServices/orgs","repos_url":"https://api.github.com/users/UH-StudentServices/repos","events_url":"https://api.github.com/users/UH-StudentServices/events{/privacy}","received_events_url":"https://api.github.com/users/UH-StudentServices/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UH-StudentServices/mystudies-myteaching-frontend","description":"","fork":false,"url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend","forks_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/forks","keys_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/teams","hooks_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/hooks","issue_events_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/events","assignees_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/tags","blobs_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/languages","stargazers_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/stargazers","contributors_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/contributors","subscribers_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/subscribers","subscription_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/subscription","commits_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/merges","archive_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/downloads","issues_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/labels{/name}","releases_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/deployments","created_at":"2015-11-16T12:46:34Z","updated_at":"2016-01-13T12:36:22Z","pushed_at":"2016-02-09T13:13:23Z","git_url":"git://github.com/UH-StudentServices/mystudies-myteaching-frontend.git","ssh_url":"git@github.com:UH-StudentServices/mystudies-myteaching-frontend.git","clone_url":"https://github.com/UH-StudentServices/mystudies-myteaching-frontend.git","svn_url":"https://github.com/UH-StudentServices/mystudies-myteaching-frontend","homepage":null,"size":961,"stargazers_count":1,"watchers_count":1,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/pulls/28"},"html":{"href":"https://github.com/UH-StudentServices/mystudies-myteaching-frontend/pull/28"},"issue":{"href":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/issues/28"},"comments":{"href":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-frontend/statuses/2078d26c932ff06ff689ff701fbdddf23c178232"}}}}