{"action":"created","comment":{"url":"https://api.github.com/repos/rackerlabs/canon-react/pulls/comments/67152275","id":67152275,"diff_hunk":"@@ -0,0 +1,88 @@\n+import React from 'react';\n+import Button from './Button';\n+import Form from './Form';\n+import FormFieldValidationBlock from './FormFieldValidationBlock';\n+import Popover from './Popover';\n+import PopoverOverlay from './PopoverOverlay';\n+import PopoverBody from './PopoverBody';\n+import PopoverFooter from './PopoverFooter';\n+import ProcessingIndicator from './ProcessingIndicator';\n+\n+class FormPopover extends React.Component {\n+  render() {\n+    let submitComponent, cancelComponent, popoverProps;\n+\n+    submitComponent = React.cloneElement(\n+      this.props.submitButton,\n+      { onClick: this._submit.bind(this), enabled: !this.props.processing }\n+    );\n+    cancelComponent = React.cloneElement(\n+      this.props.cancelButton,\n+      { onClick: this._cancel.bind(this), hidden: this.props.processing }\n+    );\n+\n+    popoverProps = Object.assign({}, this.props);\n+    delete popoverProps.children;\n+\n+    return (\n+      <Popover {...this.props} >\n+        <PopoverOverlay>\n+          <Form onSubmit={this.props.onSubmit} size={this.props.formSize} >\n+            <PopoverBody>\n+              {this.props.children}\n+            </PopoverBody>\n+            <PopoverFooter>\n+              {submitComponent}\n+              {cancelComponent}\n+              <ProcessingIndicator hidden={ !this.props.processing }/>\n+              <FormFieldValidationBlock value={this.props.error} />\n+            </PopoverFooter>\n+          </Form>\n+        </PopoverOverlay>\n+      </Popover>\n+    );\n+  }\n+\n+  _cancel(event) {\n+    if (event && event.preventDefault) {\n+      event.preventDefault();\n+    }\n+    this.props.onRequestClose();\n+  }\n+\n+  _submit(event) {\n+    if (event && event.preventDefault) {\n+      event.preventDefault();\n+    }\n+    this.props.onSubmit(event);\n+  }\n+}\n+\n+FormPopover.propTypes = {\n+  // form\n+  formSize: React.PropTypes.string,\n+  error: React.PropTypes.node,\n+  processing: React.PropTypes.bool.isRequired,\n+  onSubmit: React.PropTypes.func.isRequired,\n+  // popover layout\n+  cancelButton: React.PropTypes.element.isRequired,\n+  submitButton: React.PropTypes.element.isRequired,\n+  // popover content\n+  children: React.PropTypes.node.isRequired,\n+  // popover\n+  isOpen: React.PropTypes.bool.isRequired,\n+  target: React.PropTypes.string.isRequired,\n+  placement: React.PropTypes.string.isRequired,\n+  onRequestClose: React.PropTypes.func.isRequired\n+};\n+\n+FormPopover.defaultProps = {\n+  error: null,\n+  cancelButton: <Button canonStyle=\"link\">Cancel</Button>,","path":"src/FormPopover.jsx","position":81,"original_position":81,"commit_id":"af8daba2d06cd3340ccbfcc45e707d7b81e10b46","original_commit_id":"af8daba2d06cd3340ccbfcc45e707d7b81e10b46","user":{"login":"MACSkeptic","id":53897,"avatar_url":"https://avatars.githubusercontent.com/u/53897?v=3","gravatar_id":"","url":"https://api.github.com/users/MACSkeptic","html_url":"https://github.com/MACSkeptic","followers_url":"https://api.github.com/users/MACSkeptic/followers","following_url":"https://api.github.com/users/MACSkeptic/following{/other_user}","gists_url":"https://api.github.com/users/MACSkeptic/gists{/gist_id}","starred_url":"https://api.github.com/users/MACSkeptic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MACSkeptic/subscriptions","organizations_url":"https://api.github.com/users/MACSkeptic/orgs","repos_url":"https://api.github.com/users/MACSkeptic/repos","events_url":"https://api.github.com/users/MACSkeptic/events{/privacy}","received_events_url":"https://api.github.com/users/MACSkeptic/received_events","type":"User","site_admin":false},"body":"cancel is a button?","created_at":"2016-06-15T12:33:36Z","updated_at":"2016-06-15T12:33:36Z","html_url":"https://github.com/rackerlabs/canon-react/pull/105#discussion_r67152275","pull_request_url":"https://api.github.com/repos/rackerlabs/canon-react/pulls/105","_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/canon-react/pulls/comments/67152275"},"html":{"href":"https://github.com/rackerlabs/canon-react/pull/105#discussion_r67152275"},"pull_request":{"href":"https://api.github.com/repos/rackerlabs/canon-react/pulls/105"}}},"pull_request":{"url":"https://api.github.com/repos/rackerlabs/canon-react/pulls/105","id":72940396,"html_url":"https://github.com/rackerlabs/canon-react/pull/105","diff_url":"https://github.com/rackerlabs/canon-react/pull/105.diff","patch_url":"https://github.com/rackerlabs/canon-react/pull/105.patch","issue_url":"https://api.github.com/repos/rackerlabs/canon-react/issues/105","number":105,"state":"open","locked":false,"title":"feat: added form and field components","user":{"login":"willcumbie","id":805335,"avatar_url":"https://avatars.githubusercontent.com/u/805335?v=3","gravatar_id":"","url":"https://api.github.com/users/willcumbie","html_url":"https://github.com/willcumbie","followers_url":"https://api.github.com/users/willcumbie/followers","following_url":"https://api.github.com/users/willcumbie/following{/other_user}","gists_url":"https://api.github.com/users/willcumbie/gists{/gist_id}","starred_url":"https://api.github.com/users/willcumbie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willcumbie/subscriptions","organizations_url":"https://api.github.com/users/willcumbie/orgs","repos_url":"https://api.github.com/users/willcumbie/repos","events_url":"https://api.github.com/users/willcumbie/events{/privacy}","received_events_url":"https://api.github.com/users/willcumbie/received_events","type":"User","site_admin":false},"body":"Added Form, FormField, and related components to encapsulate Canon forms and form validation messages\r\n\r\nChanges are based on the Apollo changes here, updated to Canon-React patterns: https://github.com/racker/apollo/pull/45/files\r\n\r\nI've removed FormButton and related, since they reproduce button logic we already have in other places.","created_at":"2016-06-07T20:14:01Z","updated_at":"2016-06-15T12:33:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"40a15546c44bf134a3490b52c7a5fe90a6ab9d32","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rackerlabs/canon-react/pulls/105/commits","review_comments_url":"https://api.github.com/repos/rackerlabs/canon-react/pulls/105/comments","review_comment_url":"https://api.github.com/repos/rackerlabs/canon-react/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rackerlabs/canon-react/issues/105/comments","statuses_url":"https://api.github.com/repos/rackerlabs/canon-react/statuses/af8daba2d06cd3340ccbfcc45e707d7b81e10b46","head":{"label":"rackerlabs:add-forms-and-fields","ref":"add-forms-and-fields","sha":"af8daba2d06cd3340ccbfcc45e707d7b81e10b46","user":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":31282707,"name":"canon-react","full_name":"rackerlabs/canon-react","owner":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rackerlabs/canon-react","description":"React components for Rackspace's Canon framework","fork":false,"url":"https://api.github.com/repos/rackerlabs/canon-react","forks_url":"https://api.github.com/repos/rackerlabs/canon-react/forks","keys_url":"https://api.github.com/repos/rackerlabs/canon-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rackerlabs/canon-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rackerlabs/canon-react/teams","hooks_url":"https://api.github.com/repos/rackerlabs/canon-react/hooks","issue_events_url":"https://api.github.com/repos/rackerlabs/canon-react/issues/events{/number}","events_url":"https://api.github.com/repos/rackerlabs/canon-react/events","assignees_url":"https://api.github.com/repos/rackerlabs/canon-react/assignees{/user}","branches_url":"https://api.github.com/repos/rackerlabs/canon-react/branches{/branch}","tags_url":"https://api.github.com/repos/rackerlabs/canon-react/tags","blobs_url":"https://api.github.com/repos/rackerlabs/canon-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rackerlabs/canon-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rackerlabs/canon-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/rackerlabs/canon-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rackerlabs/canon-react/statuses/{sha}","languages_url":"https://api.github.com/repos/rackerlabs/canon-react/languages","stargazers_url":"https://api.github.com/repos/rackerlabs/canon-react/stargazers","contributors_url":"https://api.github.com/repos/rackerlabs/canon-react/contributors","subscribers_url":"https://api.github.com/repos/rackerlabs/canon-react/subscribers","subscription_url":"https://api.github.com/repos/rackerlabs/canon-react/subscription","commits_url":"https://api.github.com/repos/rackerlabs/canon-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/rackerlabs/canon-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/rackerlabs/canon-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/rackerlabs/canon-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/rackerlabs/canon-react/contents/{+path}","compare_url":"https://api.github.com/repos/rackerlabs/canon-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rackerlabs/canon-react/merges","archive_url":"https://api.github.com/repos/rackerlabs/canon-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rackerlabs/canon-react/downloads","issues_url":"https://api.github.com/repos/rackerlabs/canon-react/issues{/number}","pulls_url":"https://api.github.com/repos/rackerlabs/canon-react/pulls{/number}","milestones_url":"https://api.github.com/repos/rackerlabs/canon-react/milestones{/number}","notifications_url":"https://api.github.com/repos/rackerlabs/canon-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rackerlabs/canon-react/labels{/name}","releases_url":"https://api.github.com/repos/rackerlabs/canon-react/releases{/id}","deployments_url":"https://api.github.com/repos/rackerlabs/canon-react/deployments","created_at":"2015-02-24T21:23:09Z","updated_at":"2016-06-07T20:30:51Z","pushed_at":"2016-06-13T14:10:38Z","git_url":"git://github.com/rackerlabs/canon-react.git","ssh_url":"git@github.com:rackerlabs/canon-react.git","clone_url":"https://github.com/rackerlabs/canon-react.git","svn_url":"https://github.com/rackerlabs/canon-react","homepage":"http://rackerlabs.github.io/canon-react/","size":1639,"stargazers_count":10,"watchers_count":10,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":8,"forks":13,"open_issues":8,"watchers":10,"default_branch":"master"}},"base":{"label":"rackerlabs:master","ref":"master","sha":"cd22e232c6145a0aeb4a339ee2a828c9347d4fb8","user":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":31282707,"name":"canon-react","full_name":"rackerlabs/canon-react","owner":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rackerlabs/canon-react","description":"React components for Rackspace's Canon framework","fork":false,"url":"https://api.github.com/repos/rackerlabs/canon-react","forks_url":"https://api.github.com/repos/rackerlabs/canon-react/forks","keys_url":"https://api.github.com/repos/rackerlabs/canon-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rackerlabs/canon-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rackerlabs/canon-react/teams","hooks_url":"https://api.github.com/repos/rackerlabs/canon-react/hooks","issue_events_url":"https://api.github.com/repos/rackerlabs/canon-react/issues/events{/number}","events_url":"https://api.github.com/repos/rackerlabs/canon-react/events","assignees_url":"https://api.github.com/repos/rackerlabs/canon-react/assignees{/user}","branches_url":"https://api.github.com/repos/rackerlabs/canon-react/branches{/branch}","tags_url":"https://api.github.com/repos/rackerlabs/canon-react/tags","blobs_url":"https://api.github.com/repos/rackerlabs/canon-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rackerlabs/canon-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rackerlabs/canon-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/rackerlabs/canon-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rackerlabs/canon-react/statuses/{sha}","languages_url":"https://api.github.com/repos/rackerlabs/canon-react/languages","stargazers_url":"https://api.github.com/repos/rackerlabs/canon-react/stargazers","contributors_url":"https://api.github.com/repos/rackerlabs/canon-react/contributors","subscribers_url":"https://api.github.com/repos/rackerlabs/canon-react/subscribers","subscription_url":"https://api.github.com/repos/rackerlabs/canon-react/subscription","commits_url":"https://api.github.com/repos/rackerlabs/canon-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/rackerlabs/canon-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/rackerlabs/canon-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/rackerlabs/canon-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/rackerlabs/canon-react/contents/{+path}","compare_url":"https://api.github.com/repos/rackerlabs/canon-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rackerlabs/canon-react/merges","archive_url":"https://api.github.com/repos/rackerlabs/canon-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rackerlabs/canon-react/downloads","issues_url":"https://api.github.com/repos/rackerlabs/canon-react/issues{/number}","pulls_url":"https://api.github.com/repos/rackerlabs/canon-react/pulls{/number}","milestones_url":"https://api.github.com/repos/rackerlabs/canon-react/milestones{/number}","notifications_url":"https://api.github.com/repos/rackerlabs/canon-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rackerlabs/canon-react/labels{/name}","releases_url":"https://api.github.com/repos/rackerlabs/canon-react/releases{/id}","deployments_url":"https://api.github.com/repos/rackerlabs/canon-react/deployments","created_at":"2015-02-24T21:23:09Z","updated_at":"2016-06-07T20:30:51Z","pushed_at":"2016-06-13T14:10:38Z","git_url":"git://github.com/rackerlabs/canon-react.git","ssh_url":"git@github.com:rackerlabs/canon-react.git","clone_url":"https://github.com/rackerlabs/canon-react.git","svn_url":"https://github.com/rackerlabs/canon-react","homepage":"http://rackerlabs.github.io/canon-react/","size":1639,"stargazers_count":10,"watchers_count":10,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":8,"forks":13,"open_issues":8,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/canon-react/pulls/105"},"html":{"href":"https://github.com/rackerlabs/canon-react/pull/105"},"issue":{"href":"https://api.github.com/repos/rackerlabs/canon-react/issues/105"},"comments":{"href":"https://api.github.com/repos/rackerlabs/canon-react/issues/105/comments"},"review_comments":{"href":"https://api.github.com/repos/rackerlabs/canon-react/pulls/105/comments"},"review_comment":{"href":"https://api.github.com/repos/rackerlabs/canon-react/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rackerlabs/canon-react/pulls/105/commits"},"statuses":{"href":"https://api.github.com/repos/rackerlabs/canon-react/statuses/af8daba2d06cd3340ccbfcc45e707d7b81e10b46"}}}}
{"actor":{"display_login":"MACSkeptic"}}