{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/kibana/pulls/comments/186722556","pull_request_review_id":118356176,"id":186722556,"diff_hunk":"@@ -1,16 +1,33 @@\n+import 'isomorphic-fetch';\n import { flatten, memoize } from 'lodash';\n import chrome from '../../chrome';\n import { escapeQuotes } from './escape_kuery';\n \n const baseUrl = chrome.addBasePath('/api/kibana/suggestions/values');\n const type = 'value';\n \n-export function getSuggestionsProvider({ $http, config, indexPatterns }) {\n-  const allFields = flatten(indexPatterns.map(indexPattern => indexPattern.fields.raw));\n-  const requestSuggestions = memoize((query, field) => {\n-    const queryParams = { query, field: field.name };\n-    return $http.post(`${baseUrl}/${field.indexPattern.title}`, queryParams);\n-  }, resolver);\n+const requestSuggestions = memoize(async (query, field) => {\n+  const response = await fetch(`${baseUrl}/${field.indexPatternTitle}`, {\n+    method: 'POST',\n+    body: JSON.stringify({ query, field: field.name }),\n+    headers: new Headers({\n+      'Content-Type': 'application/json',\n+      'kbn-xsrf': true\n+    }),","path":"src/ui/public/kuery/suggestions/value.js","position":null,"original_position":22,"commit_id":"f93d6befb3e1e7d4751d78ee82622d2309bd089a","original_commit_id":"c152882bcfc3860ee3cda73d9b0321230b8adbd7","user":{"login":"nreese","id":373691,"avatar_url":"https://avatars0.githubusercontent.com/u/373691?v=4","gravatar_id":"","url":"https://api.github.com/users/nreese","html_url":"https://github.com/nreese","followers_url":"https://api.github.com/users/nreese/followers","following_url":"https://api.github.com/users/nreese/following{/other_user}","gists_url":"https://api.github.com/users/nreese/gists{/gist_id}","starred_url":"https://api.github.com/users/nreese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nreese/subscriptions","organizations_url":"https://api.github.com/users/nreese/orgs","repos_url":"https://api.github.com/users/nreese/repos","events_url":"https://api.github.com/users/nreese/events{/privacy}","received_events_url":"https://api.github.com/users/nreese/received_events","type":"User","site_admin":false},"body":"@sqren you might want to chat with @spalger. I thought he was looking into a wrapper around fetch.","created_at":"2018-05-08T13:16:43Z","updated_at":"2018-05-08T13:16:43Z","html_url":"https://github.com/elastic/kibana/pull/17836#discussion_r186722556","pull_request_url":"https://api.github.com/repos/elastic/kibana/pulls/17836","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments/186722556"},"html":{"href":"https://github.com/elastic/kibana/pull/17836#discussion_r186722556"},"pull_request":{"href":"https://api.github.com/repos/elastic/kibana/pulls/17836"}},"in_reply_to_id":184810716},"pull_request":{"url":"https://api.github.com/repos/elastic/kibana/pulls/17836","id":183375734,"html_url":"https://github.com/elastic/kibana/pull/17836","diff_url":"https://github.com/elastic/kibana/pull/17836.diff","patch_url":"https://github.com/elastic/kibana/pull/17836.patch","issue_url":"https://api.github.com/repos/elastic/kibana/issues/17836","number":17836,"state":"open","locked":false,"title":"[Kuery] Remove Angular dependencies","user":{"login":"sqren","id":209966,"avatar_url":"https://avatars3.githubusercontent.com/u/209966?v=4","gravatar_id":"","url":"https://api.github.com/users/sqren","html_url":"https://github.com/sqren","followers_url":"https://api.github.com/users/sqren/followers","following_url":"https://api.github.com/users/sqren/following{/other_user}","gists_url":"https://api.github.com/users/sqren/gists{/gist_id}","starred_url":"https://api.github.com/users/sqren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqren/subscriptions","organizations_url":"https://api.github.com/users/sqren/orgs","repos_url":"https://api.github.com/users/sqren/repos","events_url":"https://api.github.com/users/sqren/events{/privacy}","received_events_url":"https://api.github.com/users/sqren/received_events","type":"User","site_admin":false},"body":" - Remove `$http` from `getSuggestionsProvider` for values\r\n - Replace `byName` method with static `getFieldByName`\r\n - Replace `Private(StubbedLogstashIndexPatternProvider)` with static `index_pattern_response.json`\r\n - Replace `filterable` prop with `isFilterable` method\r\n\r\n@lukasolson @epixa \r\n\r\nRelated to https://github.com/elastic/kibana/issues/17795","created_at":"2018-04-23T09:33:36Z","updated_at":"2018-05-08T13:16:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"960305134a867be67f9c6a4e9a3195075b4322aa","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":814044373,"url":"https://api.github.com/repos/elastic/kibana/labels/:apm","name":":apm","color":"ededed","default":false},{"id":899581484,"url":"https://api.github.com/repos/elastic/kibana/labels/[zube]:%20In%20Progress","name":"[zube]: In Progress","color":"ffffff","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/kibana/pulls/17836/commits","review_comments_url":"https://api.github.com/repos/elastic/kibana/pulls/17836/comments","review_comment_url":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/17836/comments","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/f93d6befb3e1e7d4751d78ee82622d2309bd089a","head":{"label":"sqren:kuery-remove-byName-dep","ref":"kuery-remove-byName-dep","sha":"f93d6befb3e1e7d4751d78ee82622d2309bd089a","user":{"login":"sqren","id":209966,"avatar_url":"https://avatars3.githubusercontent.com/u/209966?v=4","gravatar_id":"","url":"https://api.github.com/users/sqren","html_url":"https://github.com/sqren","followers_url":"https://api.github.com/users/sqren/followers","following_url":"https://api.github.com/users/sqren/following{/other_user}","gists_url":"https://api.github.com/users/sqren/gists{/gist_id}","starred_url":"https://api.github.com/users/sqren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqren/subscriptions","organizations_url":"https://api.github.com/users/sqren/orgs","repos_url":"https://api.github.com/users/sqren/repos","events_url":"https://api.github.com/users/sqren/events{/privacy}","received_events_url":"https://api.github.com/users/sqren/received_events","type":"User","site_admin":false},"repo":{"id":92858589,"name":"kibana","full_name":"sqren/kibana","owner":{"login":"sqren","id":209966,"avatar_url":"https://avatars3.githubusercontent.com/u/209966?v=4","gravatar_id":"","url":"https://api.github.com/users/sqren","html_url":"https://github.com/sqren","followers_url":"https://api.github.com/users/sqren/followers","following_url":"https://api.github.com/users/sqren/following{/other_user}","gists_url":"https://api.github.com/users/sqren/gists{/gist_id}","starred_url":"https://api.github.com/users/sqren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqren/subscriptions","organizations_url":"https://api.github.com/users/sqren/orgs","repos_url":"https://api.github.com/users/sqren/repos","events_url":"https://api.github.com/users/sqren/events{/privacy}","received_events_url":"https://api.github.com/users/sqren/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sqren/kibana","description":":bar_chart: Kibana analytics and search dashboard for Elasticsearch","fork":true,"url":"https://api.github.com/repos/sqren/kibana","forks_url":"https://api.github.com/repos/sqren/kibana/forks","keys_url":"https://api.github.com/repos/sqren/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sqren/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sqren/kibana/teams","hooks_url":"https://api.github.com/repos/sqren/kibana/hooks","issue_events_url":"https://api.github.com/repos/sqren/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/sqren/kibana/events","assignees_url":"https://api.github.com/repos/sqren/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/sqren/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/sqren/kibana/tags","blobs_url":"https://api.github.com/repos/sqren/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sqren/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sqren/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/sqren/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sqren/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/sqren/kibana/languages","stargazers_url":"https://api.github.com/repos/sqren/kibana/stargazers","contributors_url":"https://api.github.com/repos/sqren/kibana/contributors","subscribers_url":"https://api.github.com/repos/sqren/kibana/subscribers","subscription_url":"https://api.github.com/repos/sqren/kibana/subscription","commits_url":"https://api.github.com/repos/sqren/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/sqren/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/sqren/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/sqren/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/sqren/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/sqren/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sqren/kibana/merges","archive_url":"https://api.github.com/repos/sqren/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sqren/kibana/downloads","issues_url":"https://api.github.com/repos/sqren/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/sqren/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/sqren/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/sqren/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sqren/kibana/labels{/name}","releases_url":"https://api.github.com/repos/sqren/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/sqren/kibana/deployments","created_at":"2017-05-30T17:27:49Z","updated_at":"2017-05-30T17:27:57Z","pushed_at":"2018-05-08T09:49:48Z","git_url":"git://github.com/sqren/kibana.git","ssh_url":"git@github.com:sqren/kibana.git","clone_url":"https://github.com/sqren/kibana.git","svn_url":"https://github.com/sqren/kibana","homepage":"https://www.elastic.co/products/kibana","size":372913,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"6d52c9d119cf5c2246cb9362274402e11384fa06","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","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://avatars0.githubusercontent.com/u/6764390?v=4","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":"2018-05-08T12:58:34Z","pushed_at":"2018-05-08T13:10:35Z","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":384463,"stargazers_count":9308,"watchers_count":9308,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3609,"mirror_url":null,"archived":false,"open_issues_count":3096,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":3609,"open_issues":3096,"watchers":9308,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/17836"},"html":{"href":"https://github.com/elastic/kibana/pull/17836"},"issue":{"href":"https://api.github.com/repos/elastic/kibana/issues/17836"},"comments":{"href":"https://api.github.com/repos/elastic/kibana/issues/17836/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/kibana/pulls/17836/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/kibana/pulls/17836/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/kibana/statuses/f93d6befb3e1e7d4751d78ee82622d2309bd089a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"nreese"}}