{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/52916574","id":52916574,"diff_hunk":"@@ -0,0 +1,100 @@\n+/**\n+ * External dependencies\n+ */\n+import React, { PropTypes } from 'react';\n+import PureRenderMixin from 'react-pure-render/mixin';\n+import omit from 'lodash/object/omit';\n+\n+/**\n+ * Internal dependencies\n+ */\n+import Gridicon from 'components/gridicon';\n+import FieldHeader from './field-header';\n+import FoldableCard from 'components/foldable-card';\n+import FormFieldset from 'components/forms/form-fieldset';\n+import FormLabel from 'components/forms/form-label';\n+import FormTextInput from 'components/forms/form-text-input';\n+import FormCheckbox from 'components/forms/form-checkbox';\n+import SelectDropdown from 'components/select-dropdown';\n+import DropdownItem from 'components/select-dropdown/item';\n+import TokenField from 'components/token-field';\n+import getLabel from './locales';\n+\n+export default React.createClass( {\n+\tdisplayName: 'ContactFormDialogField',\n+\n+\tmixins: [ PureRenderMixin ],\n+\n+\tpropTypes: {\n+\t\tlabel: PropTypes.string.isRequired,\n+\t\ttype: PropTypes.string.isRequired,\n+\t\toptions: PropTypes.string,\n+\t\trequired: PropTypes.bool,\n+\t\tonUpdate: PropTypes.func.isRequired,\n+\t\tonRemove: PropTypes.func.isRequired\n+\t},\n+\n+\trenderOptions() {\n+\t\tif ( this.props.type === 'radio' || this.props.type === 'select' ) {\n+\t\t\tlet { options } = this.props;\n+\t\t\tif ( options && typeof options === 'string' ) {","path":"client/components/tinymce/plugins/contact-form/dialog/field.jsx","position":40,"original_position":40,"commit_id":"f8574f6302f59ef4f66a0a43d5e616e5b6d343ed","original_commit_id":"f8574f6302f59ef4f66a0a43d5e616e5b6d343ed","user":{"login":"aduth","id":1779930,"avatar_url":"https://avatars.githubusercontent.com/u/1779930?v=3","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"body":"It's not clear to me when `options` would be truthy and not a string?","created_at":"2016-02-15T16:13:21Z","updated_at":"2016-02-15T16:13:21Z","html_url":"https://github.com/Automattic/wp-calypso/pull/1885#discussion_r52916574","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1885","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/52916574"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/1885#discussion_r52916574"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1885"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1885","id":54283984,"html_url":"https://github.com/Automattic/wp-calypso/pull/1885","diff_url":"https://github.com/Automattic/wp-calypso/pull/1885.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/1885.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/1885","number":1885,"state":"open","locked":false,"title":"Editor: Form Builder Dialog","user":{"login":"rodrigoi","id":233601,"avatar_url":"https://avatars.githubusercontent.com/u/233601?v=3","gravatar_id":"","url":"https://api.github.com/users/rodrigoi","html_url":"https://github.com/rodrigoi","followers_url":"https://api.github.com/users/rodrigoi/followers","following_url":"https://api.github.com/users/rodrigoi/following{/other_user}","gists_url":"https://api.github.com/users/rodrigoi/gists{/gist_id}","starred_url":"https://api.github.com/users/rodrigoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodrigoi/subscriptions","organizations_url":"https://api.github.com/users/rodrigoi/orgs","repos_url":"https://api.github.com/users/rodrigoi/repos","events_url":"https://api.github.com/users/rodrigoi/events{/privacy}","received_events_url":"https://api.github.com/users/rodrigoi/received_events","type":"User","site_admin":false},"body":"As part of implementing support for contact formson the editor, a new dialog window has been implemented to host a building interface.\r\n\r\nA little reminder of cloudup's editor implementation:\r\n\r\n![cloudup](https://cloud.githubusercontent.com/assets/233601/11937254/e4357ea0-a7f1-11e5-89d4-9be977bb06b7.png)\r\n\r\nThe proposed solution uses a `FoldableCard` component for each of the form fields. \r\nThe card displays the field name and a human readable description of the field. Also, a remove button is added to the card header to simplify removal of fields. Otherwise, the user would have to expand the card and click on a hidden _remove_ button.\r\n\r\n![form fields](https://cloud.githubusercontent.com/assets/233601/11937261/eb43753a-a7f1-11e5-9d85-b272eac46b8c.png)\r\n\r\nThis is the proposed view for the expanded card for a text field:\r\n![text field](https://cloud.githubusercontent.com/assets/233601/11937274/fda046ea-a7f1-11e5-9060-0404eb342ffa.png)\r\n\r\nAnd this is the proposed view for a radio button list:\r\n![radio buttons](https://cloud.githubusercontent.com/assets/233601/11937265/f2e59124-a7f1-11e5-84e9-2021dabef778.png)\r\n\r\nCode is not complete. When design is agreed this PR will be updated for code review.\r\n\r\nChanging the order of the form fields and form preview will be reviewed in future pull requests.\r\n\r\nThis PR is part of #1404 and depends on #2069.","created_at":"2015-12-21T17:51:26Z","updated_at":"2016-02-15T16:13:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f78aee65a93717673405d05cf637ea628ce5302","assignee":{"login":"drw158","id":618551,"avatar_url":"https://avatars.githubusercontent.com/u/618551?v=3","gravatar_id":"","url":"https://api.github.com/users/drw158","html_url":"https://github.com/drw158","followers_url":"https://api.github.com/users/drw158/followers","following_url":"https://api.github.com/users/drw158/following{/other_user}","gists_url":"https://api.github.com/users/drw158/gists{/gist_id}","starred_url":"https://api.github.com/users/drw158/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drw158/subscriptions","organizations_url":"https://api.github.com/users/drw158/orgs","repos_url":"https://api.github.com/users/drw158/repos","events_url":"https://api.github.com/users/drw158/events{/privacy}","received_events_url":"https://api.github.com/users/drw158/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1885/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1885/comments","review_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/1885/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/f8574f6302f59ef4f66a0a43d5e616e5b6d343ed","head":{"label":"Automattic:add/editor/contact-form-dialog","ref":"add/editor/contact-form-dialog","sha":"f8574f6302f59ef4f66a0a43d5e616e5b6d343ed","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2016-02-15T15:21:57Z","pushed_at":"2016-02-15T16:09:32Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":54970,"stargazers_count":6805,"watchers_count":6805,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":781,"mirror_url":null,"open_issues_count":1233,"forks":781,"open_issues":1233,"watchers":6805,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"d224e8a4f49cb6275bf4dc50b7f70abd6761b4d5","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2016-02-15T15:21:57Z","pushed_at":"2016-02-15T16:09:32Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":54970,"stargazers_count":6805,"watchers_count":6805,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":781,"mirror_url":null,"open_issues_count":1233,"forks":781,"open_issues":1233,"watchers":6805,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1885"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/1885"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/1885"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/1885/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1885/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1885/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/f8574f6302f59ef4f66a0a43d5e616e5b6d343ed"}}}}