{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/kibana/pulls/comments/57242970","id":57242970,"diff_hunk":"@@ -0,0 +1,61 @@\n+import _ from 'lodash';\n+import uiModules from 'ui/modules';\n+import paginatedSelectableListTemplate from 'ui/partials/paginated_selectable_list.html';\n+\n+const module = uiModules.get('kibana');\n+\n+module.directive('paginatedSelectableList', function (kbnUrl) {\n+\n+  return {\n+    restrict: 'E',\n+    scope: {\n+      perPage: '=?',\n+      list: '=',\n+      listProperty: '=',\n+      userMakeUrl: '=?',\n+      userOnSelect: '=?'\n+    },\n+    template: paginatedSelectableListTemplate,\n+    controller: function ($scope, $element, $filter) {\n+      $scope.perPage = $scope.perPage || 10;\n+      $scope.hits = $scope.list = _.sortBy($scope.list, accessor);\n+      $scope.hitCount = $scope.hits.length;\n+\n+      /**\n+       * Boolean that keeps track of whether hits are sorted ascending (true)\n+       * or descending (false)\n+       * * @type {Boolean}\n+       */\n+      $scope.isAscending = true;\n+\n+      /**\n+       * Sorts saved object finder hits either ascending or descending\n+       * @param  {Array} hits Array of saved finder object hits\n+       * @return {Array} Array sorted either ascending or descending\n+       */\n+      $scope.sortHits = function (hits) {\n+        const sortedList = _.sortBy(hits, accessor);\n+\n+        $scope.isAscending = !$scope.isAscending;\n+        $scope.hits = $scope.isAscending ? sortedList : sortedList.reverse();\n+      };\n+\n+      $scope.makeUrl = function (hit) {\n+        if ($scope.userMakeUrl) {\n+          return $scope.userMakeUrl(hit);\n+        }\n+      };\n+\n+      $scope.onSelect = function (hit, $event) {\n+        if ($scope.userOnSelect) {","path":"src/ui/public/directives/paginated_selectable_list.js","position":50,"original_position":50,"commit_id":"d90baaeaa8a17fd0b16bbce8a360a33d19724ed4","original_commit_id":"d90baaeaa8a17fd0b16bbce8a360a33d19724ed4","user":{"login":"rashidkpc","id":1250387,"avatar_url":"https://avatars.githubusercontent.com/u/1250387?v=3","gravatar_id":"","url":"https://api.github.com/users/rashidkpc","html_url":"https://github.com/rashidkpc","followers_url":"https://api.github.com/users/rashidkpc/followers","following_url":"https://api.github.com/users/rashidkpc/following{/other_user}","gists_url":"https://api.github.com/users/rashidkpc/gists{/gist_id}","starred_url":"https://api.github.com/users/rashidkpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rashidkpc/subscriptions","organizations_url":"https://api.github.com/users/rashidkpc/orgs","repos_url":"https://api.github.com/users/rashidkpc/repos","events_url":"https://api.github.com/users/rashidkpc/events{/privacy}","received_events_url":"https://api.github.com/users/rashidkpc/received_events","type":"User","site_admin":false},"body":"Same here","created_at":"2016-03-23T21:47:09Z","updated_at":"2016-03-23T21:47:09Z","html_url":"https://github.com/elastic/kibana/pull/6630#discussion_r57242970","pull_request_url":"https://api.github.com/repos/elastic/kibana/pulls/6630","_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments/57242970"},"html":{"href":"https://github.com/elastic/kibana/pull/6630#discussion_r57242970"},"pull_request":{"href":"https://api.github.com/repos/elastic/kibana/pulls/6630"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/kibana/pulls/6630","id":63957892,"html_url":"https://github.com/elastic/kibana/pull/6630","diff_url":"https://github.com/elastic/kibana/pull/6630.diff","patch_url":"https://github.com/elastic/kibana/pull/6630.patch","issue_url":"https://api.github.com/repos/elastic/kibana/issues/6630","number":6630,"state":"open","locked":false,"title":"Selectable list directive","user":{"login":"rashidkpc","id":1250387,"avatar_url":"https://avatars.githubusercontent.com/u/1250387?v=3","gravatar_id":"","url":"https://api.github.com/users/rashidkpc","html_url":"https://github.com/rashidkpc","followers_url":"https://api.github.com/users/rashidkpc/followers","following_url":"https://api.github.com/users/rashidkpc/following{/other_user}","gists_url":"https://api.github.com/users/rashidkpc/gists{/gist_id}","starred_url":"https://api.github.com/users/rashidkpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rashidkpc/subscriptions","organizations_url":"https://api.github.com/users/rashidkpc/orgs","repos_url":"https://api.github.com/users/rashidkpc/repos","events_url":"https://api.github.com/users/rashidkpc/events{/privacy}","received_events_url":"https://api.github.com/users/rashidkpc/received_events","type":"User","site_admin":false},"body":"This is a replacement for https://github.com/elastic/kibana/pull/6550, which was against the already merged `feature/design` branch","created_at":"2016-03-23T21:44:07Z","updated_at":"2016-03-23T21:47:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5a132e9a38a1919cf9e1e89ba0579d2d011e79b0","assignee":{"login":"rashidkpc","id":1250387,"avatar_url":"https://avatars.githubusercontent.com/u/1250387?v=3","gravatar_id":"","url":"https://api.github.com/users/rashidkpc","html_url":"https://github.com/rashidkpc","followers_url":"https://api.github.com/users/rashidkpc/followers","following_url":"https://api.github.com/users/rashidkpc/following{/other_user}","gists_url":"https://api.github.com/users/rashidkpc/gists{/gist_id}","starred_url":"https://api.github.com/users/rashidkpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rashidkpc/subscriptions","organizations_url":"https://api.github.com/users/rashidkpc/orgs","repos_url":"https://api.github.com/users/rashidkpc/repos","events_url":"https://api.github.com/users/rashidkpc/events{/privacy}","received_events_url":"https://api.github.com/users/rashidkpc/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/elastic/kibana/pulls/6630/commits","review_comments_url":"https://api.github.com/repos/elastic/kibana/pulls/6630/comments","review_comment_url":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/6630/comments","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/d90baaeaa8a17fd0b16bbce8a360a33d19724ed4","head":{"label":"stormpython:selectable_list_directive","ref":"selectable_list_directive","sha":"d90baaeaa8a17fd0b16bbce8a360a33d19724ed4","user":{"login":"stormpython","id":3149785,"avatar_url":"https://avatars.githubusercontent.com/u/3149785?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpython","html_url":"https://github.com/stormpython","followers_url":"https://api.github.com/users/stormpython/followers","following_url":"https://api.github.com/users/stormpython/following{/other_user}","gists_url":"https://api.github.com/users/stormpython/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpython/subscriptions","organizations_url":"https://api.github.com/users/stormpython/orgs","repos_url":"https://api.github.com/users/stormpython/repos","events_url":"https://api.github.com/users/stormpython/events{/privacy}","received_events_url":"https://api.github.com/users/stormpython/received_events","type":"User","site_admin":false},"repo":{"id":24904921,"name":"kibana","full_name":"stormpython/kibana","owner":{"login":"stormpython","id":3149785,"avatar_url":"https://avatars.githubusercontent.com/u/3149785?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpython","html_url":"https://github.com/stormpython","followers_url":"https://api.github.com/users/stormpython/followers","following_url":"https://api.github.com/users/stormpython/following{/other_user}","gists_url":"https://api.github.com/users/stormpython/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpython/subscriptions","organizations_url":"https://api.github.com/users/stormpython/orgs","repos_url":"https://api.github.com/users/stormpython/repos","events_url":"https://api.github.com/users/stormpython/events{/privacy}","received_events_url":"https://api.github.com/users/stormpython/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stormpython/kibana","description":"Kibana","fork":true,"url":"https://api.github.com/repos/stormpython/kibana","forks_url":"https://api.github.com/repos/stormpython/kibana/forks","keys_url":"https://api.github.com/repos/stormpython/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stormpython/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stormpython/kibana/teams","hooks_url":"https://api.github.com/repos/stormpython/kibana/hooks","issue_events_url":"https://api.github.com/repos/stormpython/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/stormpython/kibana/events","assignees_url":"https://api.github.com/repos/stormpython/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/stormpython/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/stormpython/kibana/tags","blobs_url":"https://api.github.com/repos/stormpython/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stormpython/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stormpython/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/stormpython/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stormpython/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/stormpython/kibana/languages","stargazers_url":"https://api.github.com/repos/stormpython/kibana/stargazers","contributors_url":"https://api.github.com/repos/stormpython/kibana/contributors","subscribers_url":"https://api.github.com/repos/stormpython/kibana/subscribers","subscription_url":"https://api.github.com/repos/stormpython/kibana/subscription","commits_url":"https://api.github.com/repos/stormpython/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/stormpython/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/stormpython/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/stormpython/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/stormpython/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/stormpython/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stormpython/kibana/merges","archive_url":"https://api.github.com/repos/stormpython/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stormpython/kibana/downloads","issues_url":"https://api.github.com/repos/stormpython/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/stormpython/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/stormpython/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/stormpython/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stormpython/kibana/labels{/name}","releases_url":"https://api.github.com/repos/stormpython/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/stormpython/kibana/deployments","created_at":"2014-10-07T18:24:38Z","updated_at":"2016-01-11T17:55:48Z","pushed_at":"2016-03-23T18:36:12Z","git_url":"git://github.com/stormpython/kibana.git","ssh_url":"git@github.com:stormpython/kibana.git","clone_url":"https://github.com/stormpython/kibana.git","svn_url":"https://github.com/stormpython/kibana","homepage":"http://www.elasticsearch.org/overview/kibana/","size":88068,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"f64cb27d7d6059956e9949a3f3953f957c1b4d1c","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":7833168,"name":"kibana","full_name":"elastic/kibana","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/kibana","description":":bar_chart: Kibana analytics and search dashboard for Elasticsearch","fork":false,"url":"https://api.github.com/repos/elastic/kibana","forks_url":"https://api.github.com/repos/elastic/kibana/forks","keys_url":"https://api.github.com/repos/elastic/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/kibana/teams","hooks_url":"https://api.github.com/repos/elastic/kibana/hooks","issue_events_url":"https://api.github.com/repos/elastic/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/kibana/events","assignees_url":"https://api.github.com/repos/elastic/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/kibana/tags","blobs_url":"https://api.github.com/repos/elastic/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/kibana/languages","stargazers_url":"https://api.github.com/repos/elastic/kibana/stargazers","contributors_url":"https://api.github.com/repos/elastic/kibana/contributors","subscribers_url":"https://api.github.com/repos/elastic/kibana/subscribers","subscription_url":"https://api.github.com/repos/elastic/kibana/subscription","commits_url":"https://api.github.com/repos/elastic/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/kibana/merges","archive_url":"https://api.github.com/repos/elastic/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/kibana/downloads","issues_url":"https://api.github.com/repos/elastic/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/kibana/labels{/name}","releases_url":"https://api.github.com/repos/elastic/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/kibana/deployments","created_at":"2013-01-26T04:00:59Z","updated_at":"2016-03-23T20:52:08Z","pushed_at":"2016-03-23T21:44:07Z","git_url":"git://github.com/elastic/kibana.git","ssh_url":"git@github.com:elastic/kibana.git","clone_url":"https://github.com/elastic/kibana.git","svn_url":"https://github.com/elastic/kibana","homepage":"https://www.elastic.co/products/kibana","size":108945,"stargazers_count":5023,"watchers_count":5023,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1891,"mirror_url":null,"open_issues_count":935,"forks":1891,"open_issues":935,"watchers":5023,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/6630"},"html":{"href":"https://github.com/elastic/kibana/pull/6630"},"issue":{"href":"https://api.github.com/repos/elastic/kibana/issues/6630"},"comments":{"href":"https://api.github.com/repos/elastic/kibana/issues/6630/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/kibana/pulls/6630/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/kibana/pulls/6630/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/kibana/statuses/d90baaeaa8a17fd0b16bbce8a360a33d19724ed4"}}}}