{"action":"created","comment":{"url":"https://api.github.com/repos/zanata/zanata-spa/pulls/comments/48222862","id":48222862,"diff_hunk":"@@ -0,0 +1,73 @@\n+import cx from 'classnames'\n+import React from 'react'\n+import { IntlMixin } from 'react-intl'\n+import SuggestionsHeader from '../SuggestionsHeader'\n+import SuggestionsBody from '../SuggestionsBody'\n+import { assign, pick } from 'lodash'\n+import { connect } from 'react-redux'\n+\n+const DO_NOT_RENDER = null\n+\n+/**\n+ * Panel to search for and display suggestions.\n+ */\n+let SuggestionsPanel = React.createClass({\n+  mixins: [IntlMixin],\n+\n+  propTypes: {\n+    // likely want to move this switching to a higher level\n+    showPanel: React.PropTypes.bool.isRequired,\n+    searchType: React.PropTypes.oneOf(['phrase', 'text']).isRequired\n+  },\n+\n+  render: function () {\n+    if (!this.props.showPanel) {\n+      return DO_NOT_RENDER\n+    }\n+\n+    const className = cx('Editor-suggestions Editor-panel u-bgHigh', {\n+      'is-search-active': this.props.searchType === 'text'\n+    })\n+\n+    const headerProps = pick(this.props, ['showDiff', 'onDiffChange',\n+      'closeSuggestions', 'search', 'transUnitSelected', 'searchType'])\n+\n+    const bodyProps = pick(this.props, ['showDiff', 'transUnitSelected',\n+      'search', 'searchType'])\n+\n+    return (\n+      <aside\n+        id=\"editor-suggestions\"\n+        className={className}>\n+        <SuggestionsHeader {...headerProps}/>\n+        <SuggestionsBody {...bodyProps}/>\n+      </aside>\n+    )\n+  }\n+})\n+\n+function selector (state) {","path":"app/components/SuggestionsPanel/index.jsx","position":49,"original_position":49,"commit_id":"550b6af43b3d1afcb18a33ed011189f169adc384","original_commit_id":"b59d8ef11118578795a090e7e30b8e5c475fa684","user":{"login":"lukebrooker","id":1305265,"avatar_url":"https://avatars.githubusercontent.com/u/1305265?v=3","gravatar_id":"","url":"https://api.github.com/users/lukebrooker","html_url":"https://github.com/lukebrooker","followers_url":"https://api.github.com/users/lukebrooker/followers","following_url":"https://api.github.com/users/lukebrooker/following{/other_user}","gists_url":"https://api.github.com/users/lukebrooker/gists{/gist_id}","starred_url":"https://api.github.com/users/lukebrooker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukebrooker/subscriptions","organizations_url":"https://api.github.com/users/lukebrooker/orgs","repos_url":"https://api.github.com/users/lukebrooker/repos","events_url":"https://api.github.com/users/lukebrooker/events{/privacy}","received_events_url":"https://api.github.com/users/lukebrooker/received_events","type":"User","site_admin":false},"body":"I thought the convention for this function was to call it `mapStateToProps`?","created_at":"2015-12-22T05:21:56Z","updated_at":"2015-12-22T05:21:56Z","html_url":"https://github.com/zanata/zanata-spa/pull/95#discussion_r48222862","pull_request_url":"https://api.github.com/repos/zanata/zanata-spa/pulls/95","_links":{"self":{"href":"https://api.github.com/repos/zanata/zanata-spa/pulls/comments/48222862"},"html":{"href":"https://github.com/zanata/zanata-spa/pull/95#discussion_r48222862"},"pull_request":{"href":"https://api.github.com/repos/zanata/zanata-spa/pulls/95"}}},"pull_request":{"url":"https://api.github.com/repos/zanata/zanata-spa/pulls/95","id":48290575,"html_url":"https://github.com/zanata/zanata-spa/pull/95","diff_url":"https://github.com/zanata/zanata-spa/pull/95.diff","patch_url":"https://github.com/zanata/zanata-spa/pull/95.patch","issue_url":"https://api.github.com/repos/zanata/zanata-spa/issues/95","number":95,"state":"open","locked":false,"title":"Convert suggestion panel to React ZNTA-684","user":{"login":"davidmason","id":482026,"avatar_url":"https://avatars.githubusercontent.com/u/482026?v=3","gravatar_id":"","url":"https://api.github.com/users/davidmason","html_url":"https://github.com/davidmason","followers_url":"https://api.github.com/users/davidmason/followers","following_url":"https://api.github.com/users/davidmason/following{/other_user}","gists_url":"https://api.github.com/users/davidmason/gists{/gist_id}","starred_url":"https://api.github.com/users/davidmason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidmason/subscriptions","organizations_url":"https://api.github.com/users/davidmason/orgs","repos_url":"https://api.github.com/users/davidmason/repos","events_url":"https://api.github.com/users/davidmason/events{/privacy}","received_events_url":"https://api.github.com/users/davidmason/received_events","type":"User","site_admin":false},"body":"Use React and Redux for suggestion panel.\r\n\r\n- The whole panel is rendered as a React component tree.\r\n- The component tree is all controlled from `suggestionsPanelDirective`, which is used to subscribe to all the relevant state from the remaining Angular components.\r\n- Redux is in charge of the state for the component tree.\r\n   - It is set up in `suggestionsPanelDirective`.\r\n   - It is a separate Redux store to the editor header, since they are still separate component trees. \r\n- `SuggestionsPanel` is `connect`ed to the Redux state from the `react-redux` `Provider`, and feeds state down to the rest of the component tree.\r\n","created_at":"2015-10-21T05:48:42Z","updated_at":"2015-12-22T05:21:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cdb9dc903a154ae3433884cacb60efc6ed885382","assignee":{"login":"huangp","id":1005842,"avatar_url":"https://avatars.githubusercontent.com/u/1005842?v=3","gravatar_id":"","url":"https://api.github.com/users/huangp","html_url":"https://github.com/huangp","followers_url":"https://api.github.com/users/huangp/followers","following_url":"https://api.github.com/users/huangp/following{/other_user}","gists_url":"https://api.github.com/users/huangp/gists{/gist_id}","starred_url":"https://api.github.com/users/huangp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huangp/subscriptions","organizations_url":"https://api.github.com/users/huangp/orgs","repos_url":"https://api.github.com/users/huangp/repos","events_url":"https://api.github.com/users/huangp/events{/privacy}","received_events_url":"https://api.github.com/users/huangp/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/zanata/zanata-spa/pulls/95/commits","review_comments_url":"https://api.github.com/repos/zanata/zanata-spa/pulls/95/comments","review_comment_url":"https://api.github.com/repos/zanata/zanata-spa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zanata/zanata-spa/issues/95/comments","statuses_url":"https://api.github.com/repos/zanata/zanata-spa/statuses/550b6af43b3d1afcb18a33ed011189f169adc384","head":{"label":"zanata:react-suggestions-ZNTA-684","ref":"react-suggestions-ZNTA-684","sha":"550b6af43b3d1afcb18a33ed011189f169adc384","user":{"login":"zanata","id":637455,"avatar_url":"https://avatars.githubusercontent.com/u/637455?v=3","gravatar_id":"","url":"https://api.github.com/users/zanata","html_url":"https://github.com/zanata","followers_url":"https://api.github.com/users/zanata/followers","following_url":"https://api.github.com/users/zanata/following{/other_user}","gists_url":"https://api.github.com/users/zanata/gists{/gist_id}","starred_url":"https://api.github.com/users/zanata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zanata/subscriptions","organizations_url":"https://api.github.com/users/zanata/orgs","repos_url":"https://api.github.com/users/zanata/repos","events_url":"https://api.github.com/users/zanata/events{/privacy}","received_events_url":"https://api.github.com/users/zanata/received_events","type":"Organization","site_admin":false},"repo":{"id":22827941,"name":"zanata-spa","full_name":"zanata/zanata-spa","owner":{"login":"zanata","id":637455,"avatar_url":"https://avatars.githubusercontent.com/u/637455?v=3","gravatar_id":"","url":"https://api.github.com/users/zanata","html_url":"https://github.com/zanata","followers_url":"https://api.github.com/users/zanata/followers","following_url":"https://api.github.com/users/zanata/following{/other_user}","gists_url":"https://api.github.com/users/zanata/gists{/gist_id}","starred_url":"https://api.github.com/users/zanata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zanata/subscriptions","organizations_url":"https://api.github.com/users/zanata/orgs","repos_url":"https://api.github.com/users/zanata/repos","events_url":"https://api.github.com/users/zanata/events{/privacy}","received_events_url":"https://api.github.com/users/zanata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zanata/zanata-spa","description":"Community Powered Translation","fork":false,"url":"https://api.github.com/repos/zanata/zanata-spa","forks_url":"https://api.github.com/repos/zanata/zanata-spa/forks","keys_url":"https://api.github.com/repos/zanata/zanata-spa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zanata/zanata-spa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zanata/zanata-spa/teams","hooks_url":"https://api.github.com/repos/zanata/zanata-spa/hooks","issue_events_url":"https://api.github.com/repos/zanata/zanata-spa/issues/events{/number}","events_url":"https://api.github.com/repos/zanata/zanata-spa/events","assignees_url":"https://api.github.com/repos/zanata/zanata-spa/assignees{/user}","branches_url":"https://api.github.com/repos/zanata/zanata-spa/branches{/branch}","tags_url":"https://api.github.com/repos/zanata/zanata-spa/tags","blobs_url":"https://api.github.com/repos/zanata/zanata-spa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zanata/zanata-spa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zanata/zanata-spa/git/refs{/sha}","trees_url":"https://api.github.com/repos/zanata/zanata-spa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zanata/zanata-spa/statuses/{sha}","languages_url":"https://api.github.com/repos/zanata/zanata-spa/languages","stargazers_url":"https://api.github.com/repos/zanata/zanata-spa/stargazers","contributors_url":"https://api.github.com/repos/zanata/zanata-spa/contributors","subscribers_url":"https://api.github.com/repos/zanata/zanata-spa/subscribers","subscription_url":"https://api.github.com/repos/zanata/zanata-spa/subscription","commits_url":"https://api.github.com/repos/zanata/zanata-spa/commits{/sha}","git_commits_url":"https://api.github.com/repos/zanata/zanata-spa/git/commits{/sha}","comments_url":"https://api.github.com/repos/zanata/zanata-spa/comments{/number}","issue_comment_url":"https://api.github.com/repos/zanata/zanata-spa/issues/comments{/number}","contents_url":"https://api.github.com/repos/zanata/zanata-spa/contents/{+path}","compare_url":"https://api.github.com/repos/zanata/zanata-spa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zanata/zanata-spa/merges","archive_url":"https://api.github.com/repos/zanata/zanata-spa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zanata/zanata-spa/downloads","issues_url":"https://api.github.com/repos/zanata/zanata-spa/issues{/number}","pulls_url":"https://api.github.com/repos/zanata/zanata-spa/pulls{/number}","milestones_url":"https://api.github.com/repos/zanata/zanata-spa/milestones{/number}","notifications_url":"https://api.github.com/repos/zanata/zanata-spa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zanata/zanata-spa/labels{/name}","releases_url":"https://api.github.com/repos/zanata/zanata-spa/releases{/id}","created_at":"2014-08-11T05:28:44Z","updated_at":"2015-05-04T02:16:28Z","pushed_at":"2015-12-22T02:00:47Z","git_url":"git://github.com/zanata/zanata-spa.git","ssh_url":"git@github.com:zanata/zanata-spa.git","clone_url":"https://github.com/zanata/zanata-spa.git","svn_url":"https://github.com/zanata/zanata-spa","homepage":"http://zanata.org","size":801,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":21,"forks":3,"open_issues":21,"watchers":0,"default_branch":"master"}},"base":{"label":"zanata:master","ref":"master","sha":"8f9445e2e166c49c66799bd3124be9ff2bbfec8f","user":{"login":"zanata","id":637455,"avatar_url":"https://avatars.githubusercontent.com/u/637455?v=3","gravatar_id":"","url":"https://api.github.com/users/zanata","html_url":"https://github.com/zanata","followers_url":"https://api.github.com/users/zanata/followers","following_url":"https://api.github.com/users/zanata/following{/other_user}","gists_url":"https://api.github.com/users/zanata/gists{/gist_id}","starred_url":"https://api.github.com/users/zanata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zanata/subscriptions","organizations_url":"https://api.github.com/users/zanata/orgs","repos_url":"https://api.github.com/users/zanata/repos","events_url":"https://api.github.com/users/zanata/events{/privacy}","received_events_url":"https://api.github.com/users/zanata/received_events","type":"Organization","site_admin":false},"repo":{"id":22827941,"name":"zanata-spa","full_name":"zanata/zanata-spa","owner":{"login":"zanata","id":637455,"avatar_url":"https://avatars.githubusercontent.com/u/637455?v=3","gravatar_id":"","url":"https://api.github.com/users/zanata","html_url":"https://github.com/zanata","followers_url":"https://api.github.com/users/zanata/followers","following_url":"https://api.github.com/users/zanata/following{/other_user}","gists_url":"https://api.github.com/users/zanata/gists{/gist_id}","starred_url":"https://api.github.com/users/zanata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zanata/subscriptions","organizations_url":"https://api.github.com/users/zanata/orgs","repos_url":"https://api.github.com/users/zanata/repos","events_url":"https://api.github.com/users/zanata/events{/privacy}","received_events_url":"https://api.github.com/users/zanata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zanata/zanata-spa","description":"Community Powered Translation","fork":false,"url":"https://api.github.com/repos/zanata/zanata-spa","forks_url":"https://api.github.com/repos/zanata/zanata-spa/forks","keys_url":"https://api.github.com/repos/zanata/zanata-spa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zanata/zanata-spa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zanata/zanata-spa/teams","hooks_url":"https://api.github.com/repos/zanata/zanata-spa/hooks","issue_events_url":"https://api.github.com/repos/zanata/zanata-spa/issues/events{/number}","events_url":"https://api.github.com/repos/zanata/zanata-spa/events","assignees_url":"https://api.github.com/repos/zanata/zanata-spa/assignees{/user}","branches_url":"https://api.github.com/repos/zanata/zanata-spa/branches{/branch}","tags_url":"https://api.github.com/repos/zanata/zanata-spa/tags","blobs_url":"https://api.github.com/repos/zanata/zanata-spa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zanata/zanata-spa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zanata/zanata-spa/git/refs{/sha}","trees_url":"https://api.github.com/repos/zanata/zanata-spa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zanata/zanata-spa/statuses/{sha}","languages_url":"https://api.github.com/repos/zanata/zanata-spa/languages","stargazers_url":"https://api.github.com/repos/zanata/zanata-spa/stargazers","contributors_url":"https://api.github.com/repos/zanata/zanata-spa/contributors","subscribers_url":"https://api.github.com/repos/zanata/zanata-spa/subscribers","subscription_url":"https://api.github.com/repos/zanata/zanata-spa/subscription","commits_url":"https://api.github.com/repos/zanata/zanata-spa/commits{/sha}","git_commits_url":"https://api.github.com/repos/zanata/zanata-spa/git/commits{/sha}","comments_url":"https://api.github.com/repos/zanata/zanata-spa/comments{/number}","issue_comment_url":"https://api.github.com/repos/zanata/zanata-spa/issues/comments{/number}","contents_url":"https://api.github.com/repos/zanata/zanata-spa/contents/{+path}","compare_url":"https://api.github.com/repos/zanata/zanata-spa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zanata/zanata-spa/merges","archive_url":"https://api.github.com/repos/zanata/zanata-spa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zanata/zanata-spa/downloads","issues_url":"https://api.github.com/repos/zanata/zanata-spa/issues{/number}","pulls_url":"https://api.github.com/repos/zanata/zanata-spa/pulls{/number}","milestones_url":"https://api.github.com/repos/zanata/zanata-spa/milestones{/number}","notifications_url":"https://api.github.com/repos/zanata/zanata-spa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zanata/zanata-spa/labels{/name}","releases_url":"https://api.github.com/repos/zanata/zanata-spa/releases{/id}","created_at":"2014-08-11T05:28:44Z","updated_at":"2015-05-04T02:16:28Z","pushed_at":"2015-12-22T02:00:47Z","git_url":"git://github.com/zanata/zanata-spa.git","ssh_url":"git@github.com:zanata/zanata-spa.git","clone_url":"https://github.com/zanata/zanata-spa.git","svn_url":"https://github.com/zanata/zanata-spa","homepage":"http://zanata.org","size":801,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":21,"forks":3,"open_issues":21,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zanata/zanata-spa/pulls/95"},"html":{"href":"https://github.com/zanata/zanata-spa/pull/95"},"issue":{"href":"https://api.github.com/repos/zanata/zanata-spa/issues/95"},"comments":{"href":"https://api.github.com/repos/zanata/zanata-spa/issues/95/comments"},"review_comments":{"href":"https://api.github.com/repos/zanata/zanata-spa/pulls/95/comments"},"review_comment":{"href":"https://api.github.com/repos/zanata/zanata-spa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zanata/zanata-spa/pulls/95/commits"},"statuses":{"href":"https://api.github.com/repos/zanata/zanata-spa/statuses/550b6af43b3d1afcb18a33ed011189f169adc384"}}}}