{"action":"created","comment":{"url":"https://api.github.com/repos/jdrush89/canon-react/pulls/comments/45513854","id":45513854,"diff_hunk":"@@ -0,0 +1,53 @@\n+import React from 'react';\n+\n+class Criteria extends React.Component {\n+\n+  render() {\n+    let countText, itemClasses;\n+\n+    if (this.props.count !== undefined) {\n+      countText = '(' + this.props.count + ')';\n+    }\n+\n+    itemClasses = ['rs-facet-item'];\n+    if (this.props.isSelected) {\n+      itemClasses.push('selected');\n+    }\n+    if (this.props.disabled) {\n+      itemClasses.push('disabled');\n+    }\n+    if (this.props.hidden) {\n+      itemClasses.push('rs-hidden');\n+    }\n+\n+    return (\n+      <span>\n+        <li className={ itemClasses.join(' ') } onClick={ this._handleSelectionChange.bind(this) } title={ this.props.label }>\n+          <span className={ this.props.iconClass } />\n+          <div className='rs-facet-label'>{ this.props.label }</div>\n+          <div className='rs-facet-count'>{ countText }</div>\n+        </li>\n+      </span>\n+    );\n+  };\n+\n+  _handleSelectionChange() {\n+    if (this.props.onSelectionChanged) {\n+      this.props.onSelectionChanged(!this.props.isSelected, this.props.label);\n+    }\n+  };\n+}\n+\n+/** @inheritDoc */\n+Criteria.propTypes = {\n+  label: React.PropTypes.string.isRequired,\n+  count: React.PropTypes.number,\n+  filter: React.PropTypes.func,\n+  iconClass: React.PropTypes.string,\n+  isSelected: React.PropTypes.bool,\n+  disabled: React.PropTypes.bool,\n+  hidden: React.PropTypes.bool,\n+  onSelectionChanged: React.PropTypes.func","path":"src/Criteria.jsx","position":50,"original_position":50,"commit_id":"ed29f269c889d5ff3b3caed73c45a8e9b1601401","original_commit_id":"ed29f269c889d5ff3b3caed73c45a8e9b1601401","user":{"login":"jdrush89","id":955442,"avatar_url":"https://avatars.githubusercontent.com/u/955442?v=3","gravatar_id":"","url":"https://api.github.com/users/jdrush89","html_url":"https://github.com/jdrush89","followers_url":"https://api.github.com/users/jdrush89/followers","following_url":"https://api.github.com/users/jdrush89/following{/other_user}","gists_url":"https://api.github.com/users/jdrush89/gists{/gist_id}","starred_url":"https://api.github.com/users/jdrush89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdrush89/subscriptions","organizations_url":"https://api.github.com/users/jdrush89/orgs","repos_url":"https://api.github.com/users/jdrush89/repos","events_url":"https://api.github.com/users/jdrush89/events{/privacy}","received_events_url":"https://api.github.com/users/jdrush89/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2015-11-20T20:22:03Z","updated_at":"2015-11-20T20:22:03Z","html_url":"https://github.com/jdrush89/canon-react/pull/1#discussion_r45513854","pull_request_url":"https://api.github.com/repos/jdrush89/canon-react/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/jdrush89/canon-react/pulls/comments/45513854"},"html":{"href":"https://github.com/jdrush89/canon-react/pull/1#discussion_r45513854"},"pull_request":{"href":"https://api.github.com/repos/jdrush89/canon-react/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/jdrush89/canon-react/pulls/1","id":50301862,"html_url":"https://github.com/jdrush89/canon-react/pull/1","diff_url":"https://github.com/jdrush89/canon-react/pull/1.diff","patch_url":"https://github.com/jdrush89/canon-react/pull/1.patch","issue_url":"https://api.github.com/repos/jdrush89/canon-react/issues/1","number":1,"state":"open","locked":false,"title":"Facets (In Progress)","user":{"login":"jdrush89","id":955442,"avatar_url":"https://avatars.githubusercontent.com/u/955442?v=3","gravatar_id":"","url":"https://api.github.com/users/jdrush89","html_url":"https://github.com/jdrush89","followers_url":"https://api.github.com/users/jdrush89/followers","following_url":"https://api.github.com/users/jdrush89/following{/other_user}","gists_url":"https://api.github.com/users/jdrush89/gists{/gist_id}","starred_url":"https://api.github.com/users/jdrush89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdrush89/subscriptions","organizations_url":"https://api.github.com/users/jdrush89/orgs","repos_url":"https://api.github.com/users/jdrush89/repos","events_url":"https://api.github.com/users/jdrush89/events{/privacy}","received_events_url":"https://api.github.com/users/jdrush89/received_events","type":"User","site_admin":false},"body":"![image](https://cloud.githubusercontent.com/assets/955442/11073718/fac91f08-87b9-11e5-8308-97c61b24820a.png)\r\n\r\nStill working on tests, but would love some intitial feedback\r\n\r\nEdit:  Made some significant changes to the design.  Each component now clones and renders its children, so instead of rendering one FacetsSection component with a large facetsData object, the data is now passed in like so:\r\n```\r\n<FacetsSection>\r\n  <Facet label={\"TAGS\"}>\r\n    <Criteria label={\"Development\"} count={facetData['TAGS']['Development'].count} filter={facetData['TAGS']['Development'].filter} />\r\n  </Facet>\r\n</FacetsSection>\r\n```\r\nAlso, the selectedCriteria has been removed from the state of the FacetsSection, and is instead passed in as a prop.  When the selection changes, the FacetsSection figures out what the new selectedCriteria should be and fires a selectionChanged callback with that object.  It's up to the user of the component to update the state wherever they are storing it and rerender the FacetsSection with the new state.  ","created_at":"2015-11-10T19:49:49Z","updated_at":"2015-11-20T20:22:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd7d119da843349e89fe4c719359a747bcdb3887","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jdrush89/canon-react/pulls/1/commits","review_comments_url":"https://api.github.com/repos/jdrush89/canon-react/pulls/1/comments","review_comment_url":"https://api.github.com/repos/jdrush89/canon-react/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jdrush89/canon-react/issues/1/comments","statuses_url":"https://api.github.com/repos/jdrush89/canon-react/statuses/ed29f269c889d5ff3b3caed73c45a8e9b1601401","head":{"label":"jdrush89:Facets","ref":"Facets","sha":"ed29f269c889d5ff3b3caed73c45a8e9b1601401","user":{"login":"jdrush89","id":955442,"avatar_url":"https://avatars.githubusercontent.com/u/955442?v=3","gravatar_id":"","url":"https://api.github.com/users/jdrush89","html_url":"https://github.com/jdrush89","followers_url":"https://api.github.com/users/jdrush89/followers","following_url":"https://api.github.com/users/jdrush89/following{/other_user}","gists_url":"https://api.github.com/users/jdrush89/gists{/gist_id}","starred_url":"https://api.github.com/users/jdrush89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdrush89/subscriptions","organizations_url":"https://api.github.com/users/jdrush89/orgs","repos_url":"https://api.github.com/users/jdrush89/repos","events_url":"https://api.github.com/users/jdrush89/events{/privacy}","received_events_url":"https://api.github.com/users/jdrush89/received_events","type":"User","site_admin":false},"repo":{"id":45924408,"name":"canon-react","full_name":"jdrush89/canon-react","owner":{"login":"jdrush89","id":955442,"avatar_url":"https://avatars.githubusercontent.com/u/955442?v=3","gravatar_id":"","url":"https://api.github.com/users/jdrush89","html_url":"https://github.com/jdrush89","followers_url":"https://api.github.com/users/jdrush89/followers","following_url":"https://api.github.com/users/jdrush89/following{/other_user}","gists_url":"https://api.github.com/users/jdrush89/gists{/gist_id}","starred_url":"https://api.github.com/users/jdrush89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdrush89/subscriptions","organizations_url":"https://api.github.com/users/jdrush89/orgs","repos_url":"https://api.github.com/users/jdrush89/repos","events_url":"https://api.github.com/users/jdrush89/events{/privacy}","received_events_url":"https://api.github.com/users/jdrush89/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jdrush89/canon-react","description":"React components for Rackspace's Canon framework","fork":true,"url":"https://api.github.com/repos/jdrush89/canon-react","forks_url":"https://api.github.com/repos/jdrush89/canon-react/forks","keys_url":"https://api.github.com/repos/jdrush89/canon-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jdrush89/canon-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jdrush89/canon-react/teams","hooks_url":"https://api.github.com/repos/jdrush89/canon-react/hooks","issue_events_url":"https://api.github.com/repos/jdrush89/canon-react/issues/events{/number}","events_url":"https://api.github.com/repos/jdrush89/canon-react/events","assignees_url":"https://api.github.com/repos/jdrush89/canon-react/assignees{/user}","branches_url":"https://api.github.com/repos/jdrush89/canon-react/branches{/branch}","tags_url":"https://api.github.com/repos/jdrush89/canon-react/tags","blobs_url":"https://api.github.com/repos/jdrush89/canon-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jdrush89/canon-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jdrush89/canon-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/jdrush89/canon-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jdrush89/canon-react/statuses/{sha}","languages_url":"https://api.github.com/repos/jdrush89/canon-react/languages","stargazers_url":"https://api.github.com/repos/jdrush89/canon-react/stargazers","contributors_url":"https://api.github.com/repos/jdrush89/canon-react/contributors","subscribers_url":"https://api.github.com/repos/jdrush89/canon-react/subscribers","subscription_url":"https://api.github.com/repos/jdrush89/canon-react/subscription","commits_url":"https://api.github.com/repos/jdrush89/canon-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/jdrush89/canon-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/jdrush89/canon-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/jdrush89/canon-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/jdrush89/canon-react/contents/{+path}","compare_url":"https://api.github.com/repos/jdrush89/canon-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jdrush89/canon-react/merges","archive_url":"https://api.github.com/repos/jdrush89/canon-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jdrush89/canon-react/downloads","issues_url":"https://api.github.com/repos/jdrush89/canon-react/issues{/number}","pulls_url":"https://api.github.com/repos/jdrush89/canon-react/pulls{/number}","milestones_url":"https://api.github.com/repos/jdrush89/canon-react/milestones{/number}","notifications_url":"https://api.github.com/repos/jdrush89/canon-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jdrush89/canon-react/labels{/name}","releases_url":"https://api.github.com/repos/jdrush89/canon-react/releases{/id}","created_at":"2015-11-10T16:23:21Z","updated_at":"2015-11-10T16:23:22Z","pushed_at":"2015-11-18T15:50:37Z","git_url":"git://github.com/jdrush89/canon-react.git","ssh_url":"git@github.com:jdrush89/canon-react.git","clone_url":"https://github.com/jdrush89/canon-react.git","svn_url":"https://github.com/jdrush89/canon-react","homepage":"http://rackerlabs.github.io/canon-react/","size":575,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"jdrush89:master","ref":"master","sha":"3581c8bd7287b3f409b6fdc6b2a51d4f25ffb5bd","user":{"login":"jdrush89","id":955442,"avatar_url":"https://avatars.githubusercontent.com/u/955442?v=3","gravatar_id":"","url":"https://api.github.com/users/jdrush89","html_url":"https://github.com/jdrush89","followers_url":"https://api.github.com/users/jdrush89/followers","following_url":"https://api.github.com/users/jdrush89/following{/other_user}","gists_url":"https://api.github.com/users/jdrush89/gists{/gist_id}","starred_url":"https://api.github.com/users/jdrush89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdrush89/subscriptions","organizations_url":"https://api.github.com/users/jdrush89/orgs","repos_url":"https://api.github.com/users/jdrush89/repos","events_url":"https://api.github.com/users/jdrush89/events{/privacy}","received_events_url":"https://api.github.com/users/jdrush89/received_events","type":"User","site_admin":false},"repo":{"id":45924408,"name":"canon-react","full_name":"jdrush89/canon-react","owner":{"login":"jdrush89","id":955442,"avatar_url":"https://avatars.githubusercontent.com/u/955442?v=3","gravatar_id":"","url":"https://api.github.com/users/jdrush89","html_url":"https://github.com/jdrush89","followers_url":"https://api.github.com/users/jdrush89/followers","following_url":"https://api.github.com/users/jdrush89/following{/other_user}","gists_url":"https://api.github.com/users/jdrush89/gists{/gist_id}","starred_url":"https://api.github.com/users/jdrush89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdrush89/subscriptions","organizations_url":"https://api.github.com/users/jdrush89/orgs","repos_url":"https://api.github.com/users/jdrush89/repos","events_url":"https://api.github.com/users/jdrush89/events{/privacy}","received_events_url":"https://api.github.com/users/jdrush89/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jdrush89/canon-react","description":"React components for Rackspace's Canon framework","fork":true,"url":"https://api.github.com/repos/jdrush89/canon-react","forks_url":"https://api.github.com/repos/jdrush89/canon-react/forks","keys_url":"https://api.github.com/repos/jdrush89/canon-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jdrush89/canon-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jdrush89/canon-react/teams","hooks_url":"https://api.github.com/repos/jdrush89/canon-react/hooks","issue_events_url":"https://api.github.com/repos/jdrush89/canon-react/issues/events{/number}","events_url":"https://api.github.com/repos/jdrush89/canon-react/events","assignees_url":"https://api.github.com/repos/jdrush89/canon-react/assignees{/user}","branches_url":"https://api.github.com/repos/jdrush89/canon-react/branches{/branch}","tags_url":"https://api.github.com/repos/jdrush89/canon-react/tags","blobs_url":"https://api.github.com/repos/jdrush89/canon-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jdrush89/canon-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jdrush89/canon-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/jdrush89/canon-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jdrush89/canon-react/statuses/{sha}","languages_url":"https://api.github.com/repos/jdrush89/canon-react/languages","stargazers_url":"https://api.github.com/repos/jdrush89/canon-react/stargazers","contributors_url":"https://api.github.com/repos/jdrush89/canon-react/contributors","subscribers_url":"https://api.github.com/repos/jdrush89/canon-react/subscribers","subscription_url":"https://api.github.com/repos/jdrush89/canon-react/subscription","commits_url":"https://api.github.com/repos/jdrush89/canon-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/jdrush89/canon-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/jdrush89/canon-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/jdrush89/canon-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/jdrush89/canon-react/contents/{+path}","compare_url":"https://api.github.com/repos/jdrush89/canon-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jdrush89/canon-react/merges","archive_url":"https://api.github.com/repos/jdrush89/canon-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jdrush89/canon-react/downloads","issues_url":"https://api.github.com/repos/jdrush89/canon-react/issues{/number}","pulls_url":"https://api.github.com/repos/jdrush89/canon-react/pulls{/number}","milestones_url":"https://api.github.com/repos/jdrush89/canon-react/milestones{/number}","notifications_url":"https://api.github.com/repos/jdrush89/canon-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jdrush89/canon-react/labels{/name}","releases_url":"https://api.github.com/repos/jdrush89/canon-react/releases{/id}","created_at":"2015-11-10T16:23:21Z","updated_at":"2015-11-10T16:23:22Z","pushed_at":"2015-11-18T15:50:37Z","git_url":"git://github.com/jdrush89/canon-react.git","ssh_url":"git@github.com:jdrush89/canon-react.git","clone_url":"https://github.com/jdrush89/canon-react.git","svn_url":"https://github.com/jdrush89/canon-react","homepage":"http://rackerlabs.github.io/canon-react/","size":575,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jdrush89/canon-react/pulls/1"},"html":{"href":"https://github.com/jdrush89/canon-react/pull/1"},"issue":{"href":"https://api.github.com/repos/jdrush89/canon-react/issues/1"},"comments":{"href":"https://api.github.com/repos/jdrush89/canon-react/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/jdrush89/canon-react/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/jdrush89/canon-react/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jdrush89/canon-react/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/jdrush89/canon-react/statuses/ed29f269c889d5ff3b3caed73c45a8e9b1601401"}}}}