{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/comments/135155419","pull_request_review_id":58537817,"id":135155419,"diff_hunk":"@@ -0,0 +1,241 @@\n+import React from 'react';\n+import PropTypes from 'prop-types';\n+import { connect } from 'react-redux';\n+import { compose } from 'redux';\n+import Autosuggest from 'react-autosuggest';\n+import { withRouter } from 'react-router';\n+import defaultDebounce from 'simple-debounce';\n+\n+import {\n+  ADDON_TYPE_EXTENSION,\n+  ADDON_TYPE_THEME,\n+  validAddonTypes,\n+} from 'core/constants';\n+import log from 'core/logger';\n+import translate from 'core/i18n/translate';\n+import { convertFiltersToQueryParams } from 'core/searchUtils';\n+import SearchInput from 'ui/components/SearchInput';\n+import { withErrorHandler } from 'core/errorHandler';\n+import { getAddonIconUrl } from 'core/imageUtils';\n+import {\n+  autocompleteCancel,\n+  autocompleteStart,\n+} from 'core/reducers/autocomplete';\n+import Suggestion from 'amo/components/SearchForm/Suggestion';\n+\n+import 'core/css/inc/lib.scss';\n+import './styles.scss';\n+\n+\n+export class SearchFormBase extends React.Component {\n+  static propTypes = {\n+    addonType: PropTypes.string,\n+    api: PropTypes.object.isRequired,\n+    i18n: PropTypes.object.isRequired,\n+    pathname: PropTypes.string.isRequired,\n+    query: PropTypes.string.isRequired,\n+    dispatch: PropTypes.func.isRequired,\n+    errorHandler: PropTypes.object.isRequired,\n+    suggestions: PropTypes.arrayOf(PropTypes.shape({\n+      name: PropTypes.string.isRequired,\n+      url: PropTypes.string.isRequired,\n+      iconUrl: PropTypes.string.isRequired,\n+    })).isRequired,\n+    loadingSuggestions: PropTypes.bool.isRequired,\n+    router: PropTypes.object.isRequired,\n+    debounce: PropTypes.func.isRequired,\n+  }\n+\n+  static defaultProps = {\n+    debounce: defaultDebounce,\n+  };\n+\n+  constructor(props: Object) {\n+    super(props);\n+\n+    this.state = {\n+      searchValue: props.query || '',\n+    };\n+  }\n+\n+  componentWillReceiveProps(nextProps) {\n+    const { query } = nextProps;\n+\n+    if (this.props.query !== query) {\n+      this.setState({ searchValue: query || '' });\n+    }\n+  }\n+\n+  getSuggestions() {\n+    if (this.props.loadingSuggestions) {\n+      // 10 is the maximum number of results returned by the API\n+      return Array(10).fill({\n+        name: 'loading-text',\n+        iconUrl: getAddonIconUrl(),\n+        loading: true,\n+      });\n+    }\n+\n+    return this.props.suggestions.map((suggestion) => ({\n+      ...suggestion,\n+      loading: false,","path":"src/amo/components/SearchForm/index.js","position":81,"original_position":81,"commit_id":"08405540923260ee8414370363e7da2cc72773cb","original_commit_id":"08405540923260ee8414370363e7da2cc72773cb","user":{"login":"willdurand","id":217628,"avatar_url":"https://avatars0.githubusercontent.com/u/217628?v=4","gravatar_id":"","url":"https://api.github.com/users/willdurand","html_url":"https://github.com/willdurand","followers_url":"https://api.github.com/users/willdurand/followers","following_url":"https://api.github.com/users/willdurand/following{/other_user}","gists_url":"https://api.github.com/users/willdurand/gists{/gist_id}","starred_url":"https://api.github.com/users/willdurand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willdurand/subscriptions","organizations_url":"https://api.github.com/users/willdurand/orgs","repos_url":"https://api.github.com/users/willdurand/repos","events_url":"https://api.github.com/users/willdurand/events{/privacy}","received_events_url":"https://api.github.com/users/willdurand/received_events","type":"User","site_admin":false},"body":"I wanted to keep a consistent \r\n shape for the Autosuggest `suggestions`.  ","created_at":"2017-08-24T23:30:20Z","updated_at":"2017-08-24T23:30:20Z","html_url":"https://github.com/mozilla/addons-frontend/pull/2971#discussion_r135155419","pull_request_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/2971","_links":{"self":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/comments/135155419"},"html":{"href":"https://github.com/mozilla/addons-frontend/pull/2971#discussion_r135155419"},"pull_request":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/2971"}},"in_reply_to_id":135139157},"pull_request":{"url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/2971","id":136751996,"html_url":"https://github.com/mozilla/addons-frontend/pull/2971","diff_url":"https://github.com/mozilla/addons-frontend/pull/2971.diff","patch_url":"https://github.com/mozilla/addons-frontend/pull/2971.patch","issue_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/2971","number":2971,"state":"open","locked":false,"title":"Search hints/autocomplete UI","user":{"login":"willdurand","id":217628,"avatar_url":"https://avatars0.githubusercontent.com/u/217628?v=4","gravatar_id":"","url":"https://api.github.com/users/willdurand","html_url":"https://github.com/willdurand","followers_url":"https://api.github.com/users/willdurand/followers","following_url":"https://api.github.com/users/willdurand/following{/other_user}","gists_url":"https://api.github.com/users/willdurand/gists{/gist_id}","starred_url":"https://api.github.com/users/willdurand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willdurand/subscriptions","organizations_url":"https://api.github.com/users/willdurand/orgs","repos_url":"https://api.github.com/users/willdurand/repos","events_url":"https://api.github.com/users/willdurand/events{/privacy}","received_events_url":"https://api.github.com/users/willdurand/received_events","type":"User","site_admin":false},"body":"Fix #2747 \r\n~~⚠️  depends on #2958~~\r\n\r\n---\r\n\r\nThis PR adds the UI components for the autocomplete search feature. I tried to use the most recent style as much as possible, but did not change the search UI. I have added a new mixin `arrow-big-blue()`, similar to the other arrow mixins. The name comes from the icon in Sketch.\r\n\r\n![2017-08-24 17 49 49](https://user-images.githubusercontent.com/217628/29675180-ae1d6a72-88f4-11e7-9f9f-32d6d8f72f84.gif)\r\n\r\n![2017-08-24 17 49 27](https://user-images.githubusercontent.com/217628/29675181-ae3d09e0-88f4-11e7-9d7c-d74ae49f189a.gif)\r\n\r\n","created_at":"2017-08-21T12:44:16Z","updated_at":"2017-08-24T23:30:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5829fef8905a741cd0582321e3ed41d18bd5328a","assignee":null,"assignees":[],"requested_reviewers":[{"login":"tofumatt","id":90871,"avatar_url":"https://avatars2.githubusercontent.com/u/90871?v=4","gravatar_id":"","url":"https://api.github.com/users/tofumatt","html_url":"https://github.com/tofumatt","followers_url":"https://api.github.com/users/tofumatt/followers","following_url":"https://api.github.com/users/tofumatt/following{/other_user}","gists_url":"https://api.github.com/users/tofumatt/gists{/gist_id}","starred_url":"https://api.github.com/users/tofumatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tofumatt/subscriptions","organizations_url":"https://api.github.com/users/tofumatt/orgs","repos_url":"https://api.github.com/users/tofumatt/repos","events_url":"https://api.github.com/users/tofumatt/events{/privacy}","received_events_url":"https://api.github.com/users/tofumatt/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/2971/commits","review_comments_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/2971/comments","review_comment_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/2971/comments","statuses_url":"https://api.github.com/repos/mozilla/addons-frontend/statuses/08405540923260ee8414370363e7da2cc72773cb","head":{"label":"willdurand:autocomplete-ui","ref":"autocomplete-ui","sha":"08405540923260ee8414370363e7da2cc72773cb","user":{"login":"willdurand","id":217628,"avatar_url":"https://avatars0.githubusercontent.com/u/217628?v=4","gravatar_id":"","url":"https://api.github.com/users/willdurand","html_url":"https://github.com/willdurand","followers_url":"https://api.github.com/users/willdurand/followers","following_url":"https://api.github.com/users/willdurand/following{/other_user}","gists_url":"https://api.github.com/users/willdurand/gists{/gist_id}","starred_url":"https://api.github.com/users/willdurand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willdurand/subscriptions","organizations_url":"https://api.github.com/users/willdurand/orgs","repos_url":"https://api.github.com/users/willdurand/repos","events_url":"https://api.github.com/users/willdurand/events{/privacy}","received_events_url":"https://api.github.com/users/willdurand/received_events","type":"User","site_admin":false},"repo":{"id":100354578,"name":"addons-frontend","full_name":"willdurand/addons-frontend","owner":{"login":"willdurand","id":217628,"avatar_url":"https://avatars0.githubusercontent.com/u/217628?v=4","gravatar_id":"","url":"https://api.github.com/users/willdurand","html_url":"https://github.com/willdurand","followers_url":"https://api.github.com/users/willdurand/followers","following_url":"https://api.github.com/users/willdurand/following{/other_user}","gists_url":"https://api.github.com/users/willdurand/gists{/gist_id}","starred_url":"https://api.github.com/users/willdurand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willdurand/subscriptions","organizations_url":"https://api.github.com/users/willdurand/orgs","repos_url":"https://api.github.com/users/willdurand/repos","events_url":"https://api.github.com/users/willdurand/events{/privacy}","received_events_url":"https://api.github.com/users/willdurand/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/willdurand/addons-frontend","description":"Front-end to complement mozilla/addons-server","fork":true,"url":"https://api.github.com/repos/willdurand/addons-frontend","forks_url":"https://api.github.com/repos/willdurand/addons-frontend/forks","keys_url":"https://api.github.com/repos/willdurand/addons-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/willdurand/addons-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/willdurand/addons-frontend/teams","hooks_url":"https://api.github.com/repos/willdurand/addons-frontend/hooks","issue_events_url":"https://api.github.com/repos/willdurand/addons-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/willdurand/addons-frontend/events","assignees_url":"https://api.github.com/repos/willdurand/addons-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/willdurand/addons-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/willdurand/addons-frontend/tags","blobs_url":"https://api.github.com/repos/willdurand/addons-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/willdurand/addons-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/willdurand/addons-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/willdurand/addons-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/willdurand/addons-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/willdurand/addons-frontend/languages","stargazers_url":"https://api.github.com/repos/willdurand/addons-frontend/stargazers","contributors_url":"https://api.github.com/repos/willdurand/addons-frontend/contributors","subscribers_url":"https://api.github.com/repos/willdurand/addons-frontend/subscribers","subscription_url":"https://api.github.com/repos/willdurand/addons-frontend/subscription","commits_url":"https://api.github.com/repos/willdurand/addons-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/willdurand/addons-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/willdurand/addons-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/willdurand/addons-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/willdurand/addons-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/willdurand/addons-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/willdurand/addons-frontend/merges","archive_url":"https://api.github.com/repos/willdurand/addons-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/willdurand/addons-frontend/downloads","issues_url":"https://api.github.com/repos/willdurand/addons-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/willdurand/addons-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/willdurand/addons-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/willdurand/addons-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/willdurand/addons-frontend/labels{/name}","releases_url":"https://api.github.com/repos/willdurand/addons-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/willdurand/addons-frontend/deployments","created_at":"2017-08-15T08:07:49Z","updated_at":"2017-08-15T08:07:54Z","pushed_at":"2017-08-24T16:44:40Z","git_url":"git://github.com/willdurand/addons-frontend.git","ssh_url":"git@github.com:willdurand/addons-frontend.git","clone_url":"https://github.com/willdurand/addons-frontend.git","svn_url":"https://github.com/willdurand/addons-frontend","homepage":"","size":304142,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"c75ef37a59e8020ae15ee6dac0636c9e7fce7193","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":52104368,"name":"addons-frontend","full_name":"mozilla/addons-frontend","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/addons-frontend","description":"Front-end to complement mozilla/addons-server","fork":false,"url":"https://api.github.com/repos/mozilla/addons-frontend","forks_url":"https://api.github.com/repos/mozilla/addons-frontend/forks","keys_url":"https://api.github.com/repos/mozilla/addons-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/addons-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/addons-frontend/teams","hooks_url":"https://api.github.com/repos/mozilla/addons-frontend/hooks","issue_events_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/addons-frontend/events","assignees_url":"https://api.github.com/repos/mozilla/addons-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/addons-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/addons-frontend/tags","blobs_url":"https://api.github.com/repos/mozilla/addons-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/addons-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/addons-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/addons-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/addons-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/addons-frontend/languages","stargazers_url":"https://api.github.com/repos/mozilla/addons-frontend/stargazers","contributors_url":"https://api.github.com/repos/mozilla/addons-frontend/contributors","subscribers_url":"https://api.github.com/repos/mozilla/addons-frontend/subscribers","subscription_url":"https://api.github.com/repos/mozilla/addons-frontend/subscription","commits_url":"https://api.github.com/repos/mozilla/addons-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/addons-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/addons-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/addons-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/addons-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/addons-frontend/merges","archive_url":"https://api.github.com/repos/mozilla/addons-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/addons-frontend/downloads","issues_url":"https://api.github.com/repos/mozilla/addons-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/addons-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/addons-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/addons-frontend/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/addons-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/addons-frontend/deployments","created_at":"2016-02-19T17:25:57Z","updated_at":"2017-08-13T20:28:44Z","pushed_at":"2017-08-24T21:52:00Z","git_url":"git://github.com/mozilla/addons-frontend.git","ssh_url":"git@github.com:mozilla/addons-frontend.git","clone_url":"https://github.com/mozilla/addons-frontend.git","svn_url":"https://github.com/mozilla/addons-frontend","homepage":"","size":306869,"stargazers_count":53,"watchers_count":53,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":50,"mirror_url":null,"open_issues_count":300,"forks":50,"open_issues":300,"watchers":53,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/2971"},"html":{"href":"https://github.com/mozilla/addons-frontend/pull/2971"},"issue":{"href":"https://api.github.com/repos/mozilla/addons-frontend/issues/2971"},"comments":{"href":"https://api.github.com/repos/mozilla/addons-frontend/issues/2971/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/2971/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/2971/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/addons-frontend/statuses/08405540923260ee8414370363e7da2cc72773cb"}}}}
{"actor":{"display_login":"willdurand"}}