{"action":"created","comment":{"url":"https://api.github.com/repos/influunt/influunt/pulls/comments/83747164","pull_request_review_id":4570494,"id":83747164,"diff_hunk":"@@ -0,0 +1,104 @@\n+'use strict';\n+\n+/**\n+ * @ngdoc function\n+ * @name influuntApp.controller:HistoricoCtrl\n+ * @description\n+ * # HistoricoCtrl\n+ * Controller of the influuntApp\n+ */\n+angular.module('influuntApp')\n+  .controller('HistoricoCtrl', ['$scope', '$state', '$filter', '$q', 'Restangular', 'influuntBlockui', 'toast', 'influuntAlert', 'handleValidations',\n+    function HistoricoCtrl($scope, $state, $filter, $q, Restangular, influuntBlockui, toast, influuntAlert, handleValidations) {\n+\n+      var handleErroEditar, sortPlanos;\n+      var resourceName = null;\n+\n+      $scope.inicializaResourceHistorico = function(param) {\n+        resourceName = param;\n+      };\n+\n+      $scope.editar = function(controladorId) {\n+        return Restangular.one('controladores', controladorId).all('pode_editar').customGET()\n+          .then(function() {\n+            $state.go('app.' + resourceName + '_edit', { id: controladorId });\n+          })\n+          .catch(handleErroEditar)\n+          .finally(influuntBlockui.unblock);\n+      };\n+\n+      $scope.clonar = function(controladorId) {\n+        return Restangular\n+          .one('controladores', controladorId).all('pode_editar').customGET()\n+          .then(function() {\n+            return Restangular.one('controladores', controladorId).all('editar_' + resourceName + '').customGET();\n+          })\n+          .then(function() {\n+            $state.go('app.' + resourceName + '_edit', { id: controladorId });\n+          })\n+          .catch(handleErroEditar)\n+          .finally(influuntBlockui.unblock);\n+      };\n+\n+      $scope.cancelar = function(obj) {\n+        influuntAlert.delete().then(function(confirmado) {\n+          if (obj && obj.id) {\n+            return confirmado && Restangular.one(resourceName, obj.id).all('cancelar_edicao').customDELETE()\n+              .then(function() {\n+                toast.success($filter('translate')('geral.mensagens.removido_com_sucesso'));\n+                $state.go('app.controladores');\n+              })\n+              .catch(handleErroEditar)\n+              .finally(influuntBlockui.unblock);\n+          } else {\n+            $state.go('app.controladores');\n+          }\n+        });\n+      };\n+\n+      $scope.submit = function(refObjeto) {\n+        // planos são ordenados antes de submeter o form\n+        // para que os erros voltem ordenados da API.\n+        // @todo: Testar se isso pode causar problemas no submit de tabelas horárias.\n+        sortPlanos(refObjeto);\n+\n+        return Restangular.all(resourceName).post(refObjeto)\n+          .then(function(res) {\n+            influuntBlockui.unblock();","path":"influunt-app/app/scripts/controllers/concerns/historico.js","position":67,"original_position":67,"commit_id":"774faf4dea603344cd07c4de714f5b5ecf73da4e","original_commit_id":"774faf4dea603344cd07c4de714f5b5ecf73da4e","user":{"login":"ppires","id":194442,"avatar_url":"https://avatars.githubusercontent.com/u/194442?v=3","gravatar_id":"","url":"https://api.github.com/users/ppires","html_url":"https://github.com/ppires","followers_url":"https://api.github.com/users/ppires/followers","following_url":"https://api.github.com/users/ppires/following{/other_user}","gists_url":"https://api.github.com/users/ppires/gists{/gist_id}","starred_url":"https://api.github.com/users/ppires/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppires/subscriptions","organizations_url":"https://api.github.com/users/ppires/orgs","repos_url":"https://api.github.com/users/ppires/repos","events_url":"https://api.github.com/users/ppires/events{/privacy}","received_events_url":"https://api.github.com/users/ppires/received_events","type":"User","site_admin":false},"body":"Já está no `finally()`, não é necessário aqui.","created_at":"2016-10-17T22:21:31Z","updated_at":"2016-10-17T22:21:31Z","html_url":"https://github.com/influunt/influunt/pull/1192#discussion_r83747164","pull_request_url":"https://api.github.com/repos/influunt/influunt/pulls/1192","_links":{"self":{"href":"https://api.github.com/repos/influunt/influunt/pulls/comments/83747164"},"html":{"href":"https://github.com/influunt/influunt/pull/1192#discussion_r83747164"},"pull_request":{"href":"https://api.github.com/repos/influunt/influunt/pulls/1192"}}},"pull_request":{"url":"https://api.github.com/repos/influunt/influunt/pulls/1192","id":89709722,"html_url":"https://github.com/influunt/influunt/pull/1192","diff_url":"https://github.com/influunt/influunt/pull/1192.diff","patch_url":"https://github.com/influunt/influunt/pull/1192.patch","issue_url":"https://api.github.com/repos/influunt/influunt/issues/1192","number":1192,"state":"open","locked":false,"title":"1079 teste planos","user":{"login":"pauloFernandes","id":2263368,"avatar_url":"https://avatars.githubusercontent.com/u/2263368?v=3","gravatar_id":"","url":"https://api.github.com/users/pauloFernandes","html_url":"https://github.com/pauloFernandes","followers_url":"https://api.github.com/users/pauloFernandes/followers","following_url":"https://api.github.com/users/pauloFernandes/following{/other_user}","gists_url":"https://api.github.com/users/pauloFernandes/gists{/gist_id}","starred_url":"https://api.github.com/users/pauloFernandes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pauloFernandes/subscriptions","organizations_url":"https://api.github.com/users/pauloFernandes/orgs","repos_url":"https://api.github.com/users/pauloFernandes/repos","events_url":"https://api.github.com/users/pauloFernandes/events{/privacy}","received_events_url":"https://api.github.com/users/pauloFernandes/received_events","type":"User","site_admin":false},"body":"fixes #1176  - bug na tabela horária.\r\nPossui também o progresso parcial da atualização dos testes de planos e tabelas horárias (+refactors)","created_at":"2016-10-17T21:47:08Z","updated_at":"2016-10-17T22:40:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8be46e83754a499ea7be870f4c1ec484aa933496","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/influunt/influunt/pulls/1192/commits","review_comments_url":"https://api.github.com/repos/influunt/influunt/pulls/1192/comments","review_comment_url":"https://api.github.com/repos/influunt/influunt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/influunt/influunt/issues/1192/comments","statuses_url":"https://api.github.com/repos/influunt/influunt/statuses/774faf4dea603344cd07c4de714f5b5ecf73da4e","head":{"label":"influunt:1079-teste-planos","ref":"1079-teste-planos","sha":"774faf4dea603344cd07c4de714f5b5ecf73da4e","user":{"login":"influunt","id":19677350,"avatar_url":"https://avatars.githubusercontent.com/u/19677350?v=3","gravatar_id":"","url":"https://api.github.com/users/influunt","html_url":"https://github.com/influunt","followers_url":"https://api.github.com/users/influunt/followers","following_url":"https://api.github.com/users/influunt/following{/other_user}","gists_url":"https://api.github.com/users/influunt/gists{/gist_id}","starred_url":"https://api.github.com/users/influunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influunt/subscriptions","organizations_url":"https://api.github.com/users/influunt/orgs","repos_url":"https://api.github.com/users/influunt/repos","events_url":"https://api.github.com/users/influunt/events{/privacy}","received_events_url":"https://api.github.com/users/influunt/received_events","type":"Organization","site_admin":false},"repo":{"id":60134030,"name":"influunt","full_name":"influunt/influunt","owner":{"login":"influunt","id":19677350,"avatar_url":"https://avatars.githubusercontent.com/u/19677350?v=3","gravatar_id":"","url":"https://api.github.com/users/influunt","html_url":"https://github.com/influunt","followers_url":"https://api.github.com/users/influunt/followers","following_url":"https://api.github.com/users/influunt/following{/other_user}","gists_url":"https://api.github.com/users/influunt/gists{/gist_id}","starred_url":"https://api.github.com/users/influunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influunt/subscriptions","organizations_url":"https://api.github.com/users/influunt/orgs","repos_url":"https://api.github.com/users/influunt/repos","events_url":"https://api.github.com/users/influunt/events{/privacy}","received_events_url":"https://api.github.com/users/influunt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influunt/influunt","description":null,"fork":false,"url":"https://api.github.com/repos/influunt/influunt","forks_url":"https://api.github.com/repos/influunt/influunt/forks","keys_url":"https://api.github.com/repos/influunt/influunt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influunt/influunt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influunt/influunt/teams","hooks_url":"https://api.github.com/repos/influunt/influunt/hooks","issue_events_url":"https://api.github.com/repos/influunt/influunt/issues/events{/number}","events_url":"https://api.github.com/repos/influunt/influunt/events","assignees_url":"https://api.github.com/repos/influunt/influunt/assignees{/user}","branches_url":"https://api.github.com/repos/influunt/influunt/branches{/branch}","tags_url":"https://api.github.com/repos/influunt/influunt/tags","blobs_url":"https://api.github.com/repos/influunt/influunt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influunt/influunt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influunt/influunt/git/refs{/sha}","trees_url":"https://api.github.com/repos/influunt/influunt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influunt/influunt/statuses/{sha}","languages_url":"https://api.github.com/repos/influunt/influunt/languages","stargazers_url":"https://api.github.com/repos/influunt/influunt/stargazers","contributors_url":"https://api.github.com/repos/influunt/influunt/contributors","subscribers_url":"https://api.github.com/repos/influunt/influunt/subscribers","subscription_url":"https://api.github.com/repos/influunt/influunt/subscription","commits_url":"https://api.github.com/repos/influunt/influunt/commits{/sha}","git_commits_url":"https://api.github.com/repos/influunt/influunt/git/commits{/sha}","comments_url":"https://api.github.com/repos/influunt/influunt/comments{/number}","issue_comment_url":"https://api.github.com/repos/influunt/influunt/issues/comments{/number}","contents_url":"https://api.github.com/repos/influunt/influunt/contents/{+path}","compare_url":"https://api.github.com/repos/influunt/influunt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influunt/influunt/merges","archive_url":"https://api.github.com/repos/influunt/influunt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influunt/influunt/downloads","issues_url":"https://api.github.com/repos/influunt/influunt/issues{/number}","pulls_url":"https://api.github.com/repos/influunt/influunt/pulls{/number}","milestones_url":"https://api.github.com/repos/influunt/influunt/milestones{/number}","notifications_url":"https://api.github.com/repos/influunt/influunt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influunt/influunt/labels{/name}","releases_url":"https://api.github.com/repos/influunt/influunt/releases{/id}","deployments_url":"https://api.github.com/repos/influunt/influunt/deployments","created_at":"2016-06-01T00:55:14Z","updated_at":"2016-10-05T00:20:04Z","pushed_at":"2016-10-17T21:47:08Z","git_url":"git://github.com/influunt/influunt.git","ssh_url":"git@github.com:influunt/influunt.git","clone_url":"https://github.com/influunt/influunt.git","svn_url":"https://github.com/influunt/influunt","homepage":null,"size":79625,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":83,"forks":0,"open_issues":83,"watchers":0,"default_branch":"staging"}},"base":{"label":"influunt:staging","ref":"staging","sha":"990c857c2256f70800d4855319f0fd349ce0b86c","user":{"login":"influunt","id":19677350,"avatar_url":"https://avatars.githubusercontent.com/u/19677350?v=3","gravatar_id":"","url":"https://api.github.com/users/influunt","html_url":"https://github.com/influunt","followers_url":"https://api.github.com/users/influunt/followers","following_url":"https://api.github.com/users/influunt/following{/other_user}","gists_url":"https://api.github.com/users/influunt/gists{/gist_id}","starred_url":"https://api.github.com/users/influunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influunt/subscriptions","organizations_url":"https://api.github.com/users/influunt/orgs","repos_url":"https://api.github.com/users/influunt/repos","events_url":"https://api.github.com/users/influunt/events{/privacy}","received_events_url":"https://api.github.com/users/influunt/received_events","type":"Organization","site_admin":false},"repo":{"id":60134030,"name":"influunt","full_name":"influunt/influunt","owner":{"login":"influunt","id":19677350,"avatar_url":"https://avatars.githubusercontent.com/u/19677350?v=3","gravatar_id":"","url":"https://api.github.com/users/influunt","html_url":"https://github.com/influunt","followers_url":"https://api.github.com/users/influunt/followers","following_url":"https://api.github.com/users/influunt/following{/other_user}","gists_url":"https://api.github.com/users/influunt/gists{/gist_id}","starred_url":"https://api.github.com/users/influunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influunt/subscriptions","organizations_url":"https://api.github.com/users/influunt/orgs","repos_url":"https://api.github.com/users/influunt/repos","events_url":"https://api.github.com/users/influunt/events{/privacy}","received_events_url":"https://api.github.com/users/influunt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influunt/influunt","description":null,"fork":false,"url":"https://api.github.com/repos/influunt/influunt","forks_url":"https://api.github.com/repos/influunt/influunt/forks","keys_url":"https://api.github.com/repos/influunt/influunt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influunt/influunt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influunt/influunt/teams","hooks_url":"https://api.github.com/repos/influunt/influunt/hooks","issue_events_url":"https://api.github.com/repos/influunt/influunt/issues/events{/number}","events_url":"https://api.github.com/repos/influunt/influunt/events","assignees_url":"https://api.github.com/repos/influunt/influunt/assignees{/user}","branches_url":"https://api.github.com/repos/influunt/influunt/branches{/branch}","tags_url":"https://api.github.com/repos/influunt/influunt/tags","blobs_url":"https://api.github.com/repos/influunt/influunt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influunt/influunt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influunt/influunt/git/refs{/sha}","trees_url":"https://api.github.com/repos/influunt/influunt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influunt/influunt/statuses/{sha}","languages_url":"https://api.github.com/repos/influunt/influunt/languages","stargazers_url":"https://api.github.com/repos/influunt/influunt/stargazers","contributors_url":"https://api.github.com/repos/influunt/influunt/contributors","subscribers_url":"https://api.github.com/repos/influunt/influunt/subscribers","subscription_url":"https://api.github.com/repos/influunt/influunt/subscription","commits_url":"https://api.github.com/repos/influunt/influunt/commits{/sha}","git_commits_url":"https://api.github.com/repos/influunt/influunt/git/commits{/sha}","comments_url":"https://api.github.com/repos/influunt/influunt/comments{/number}","issue_comment_url":"https://api.github.com/repos/influunt/influunt/issues/comments{/number}","contents_url":"https://api.github.com/repos/influunt/influunt/contents/{+path}","compare_url":"https://api.github.com/repos/influunt/influunt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influunt/influunt/merges","archive_url":"https://api.github.com/repos/influunt/influunt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influunt/influunt/downloads","issues_url":"https://api.github.com/repos/influunt/influunt/issues{/number}","pulls_url":"https://api.github.com/repos/influunt/influunt/pulls{/number}","milestones_url":"https://api.github.com/repos/influunt/influunt/milestones{/number}","notifications_url":"https://api.github.com/repos/influunt/influunt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influunt/influunt/labels{/name}","releases_url":"https://api.github.com/repos/influunt/influunt/releases{/id}","deployments_url":"https://api.github.com/repos/influunt/influunt/deployments","created_at":"2016-06-01T00:55:14Z","updated_at":"2016-10-05T00:20:04Z","pushed_at":"2016-10-17T21:47:08Z","git_url":"git://github.com/influunt/influunt.git","ssh_url":"git@github.com:influunt/influunt.git","clone_url":"https://github.com/influunt/influunt.git","svn_url":"https://github.com/influunt/influunt","homepage":null,"size":79625,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":83,"forks":0,"open_issues":83,"watchers":0,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/influunt/influunt/pulls/1192"},"html":{"href":"https://github.com/influunt/influunt/pull/1192"},"issue":{"href":"https://api.github.com/repos/influunt/influunt/issues/1192"},"comments":{"href":"https://api.github.com/repos/influunt/influunt/issues/1192/comments"},"review_comments":{"href":"https://api.github.com/repos/influunt/influunt/pulls/1192/comments"},"review_comment":{"href":"https://api.github.com/repos/influunt/influunt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/influunt/influunt/pulls/1192/commits"},"statuses":{"href":"https://api.github.com/repos/influunt/influunt/statuses/774faf4dea603344cd07c4de714f5b5ecf73da4e"}}}}
{"actor":{"display_login":"ppires"}}