{"action":"created","comment":{"url":"https://api.github.com/repos/Talend/react-talend-components/pulls/comments/88494283","pull_request_review_id":9064831,"id":88494283,"diff_hunk":"@@ -0,0 +1,138 @@\n+import React, { PropTypes } from 'react';\n+import { Button } from 'react-bootstrap';\n+import Icon from '../../Icon';\n+\n+const TITLE_MODE_TEXT = 'text';\n+const TITLE_MODE_INPUT = 'input';\n+\n+function renderButton({ value, className, item, onClick }) {\n+\tconst click = (event) => {\n+\t\tevent.stopPropagation();\n+\t\tonClick(event, item);\n+\t};\n+\n+\treturn (\n+\t\t<Button className={className} onClick={click} role=\"link\" bsStyle=\"link\">\n+\t\t\t{value}\n+\t\t</Button>\n+\t);\n+}\n+renderButton.propTypes = {\n+\tvalue: PropTypes.string,\n+\tclassName: PropTypes.string,\n+\titem: PropTypes.object, // eslint-disable-line react/forbid-prop-types\n+\tonClick: PropTypes.func,\n+};\n+\n+function renderText({ value, className }) {\n+\treturn (<span className={className}>{value}</span>);\n+}\n+renderText.propTypes = {\n+\tvalue: PropTypes.string,\n+\tclassName: PropTypes.string,\n+};\n+\n+function renderInput({ value, item, onChange, onCancel }) {\n+\tconst cancel = event => onCancel(event, item);\n+\tconst validate = event => onChange(event, item);\n+\tconst onKeyUp = (event) => {\n+\t\tswitch (event.keyCode) {\n+\t\tcase 27: // ESC\n+\t\t\tcancel(event);\n+\t\t\tbreak;\n+\t\tcase 13: // ENTER\n+\t\t\tvalidate(event);\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tbreak;\n+\t\t}\n+\t};\n+\n+\treturn (<input value={value} onKeyUp={onKeyUp} onBlur={validate} autoFocus />);\n+}\n+renderInput.propTypes = {\n+\tvalue: PropTypes.string,\n+\titem: PropTypes.object, // eslint-disable-line react/forbid-prop-types","path":"src/List/ItemTitle/ItemTitle.component.js","position":55,"original_position":55,"commit_id":"4652eccf309f1d6e0e4477266a53969cacddf079","original_commit_id":"4652eccf309f1d6e0e4477266a53969cacddf079","user":{"login":"talend-glorieux","id":19686241,"avatar_url":"https://avatars.githubusercontent.com/u/19686241?v=3","gravatar_id":"","url":"https://api.github.com/users/talend-glorieux","html_url":"https://github.com/talend-glorieux","followers_url":"https://api.github.com/users/talend-glorieux/followers","following_url":"https://api.github.com/users/talend-glorieux/following{/other_user}","gists_url":"https://api.github.com/users/talend-glorieux/gists{/gist_id}","starred_url":"https://api.github.com/users/talend-glorieux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talend-glorieux/subscriptions","organizations_url":"https://api.github.com/users/talend-glorieux/orgs","repos_url":"https://api.github.com/users/talend-glorieux/repos","events_url":"https://api.github.com/users/talend-glorieux/events{/privacy}","received_events_url":"https://api.github.com/users/talend-glorieux/received_events","type":"User","site_admin":false},"body":"Please remove the linting overwrite.  ","created_at":"2016-11-17T16:46:53Z","updated_at":"2016-11-17T17:02:06Z","html_url":"https://github.com/Talend/react-talend-components/pull/90#discussion_r88494283","pull_request_url":"https://api.github.com/repos/Talend/react-talend-components/pulls/90","_links":{"self":{"href":"https://api.github.com/repos/Talend/react-talend-components/pulls/comments/88494283"},"html":{"href":"https://github.com/Talend/react-talend-components/pull/90#discussion_r88494283"},"pull_request":{"href":"https://api.github.com/repos/Talend/react-talend-components/pulls/90"}}},"pull_request":{"url":"https://api.github.com/repos/Talend/react-talend-components/pulls/90","id":92944901,"html_url":"https://github.com/Talend/react-talend-components/pull/90","diff_url":"https://github.com/Talend/react-talend-components/pull/90.diff","patch_url":"https://github.com/Talend/react-talend-components/pull/90.patch","issue_url":"https://api.github.com/repos/Talend/react-talend-components/issues/90","number":90,"state":"open","locked":false,"title":"feat(list): allow title input mode","user":{"login":"jsomsanith","id":10761073,"avatar_url":"https://avatars.githubusercontent.com/u/10761073?v=3","gravatar_id":"","url":"https://api.github.com/users/jsomsanith","html_url":"https://github.com/jsomsanith","followers_url":"https://api.github.com/users/jsomsanith/followers","following_url":"https://api.github.com/users/jsomsanith/following{/other_user}","gists_url":"https://api.github.com/users/jsomsanith/gists{/gist_id}","starred_url":"https://api.github.com/users/jsomsanith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsomsanith/subscriptions","organizations_url":"https://api.github.com/users/jsomsanith/orgs","repos_url":"https://api.github.com/users/jsomsanith/repos","events_url":"https://api.github.com/users/jsomsanith/events{/privacy}","received_events_url":"https://api.github.com/users/jsomsanith/received_events","type":"User","site_admin":false},"body":"**Please check if the PR fulfills these requirements**\r\n\r\n- [x] The commit(s) message(s) follows our [guidelines](https://github.com/talend/tools/blob/master/tools-root-github/CONTRIBUTING.md#commit-message-format)\r\n- [x] Tests for the changes have been added (for bug fixes / features)\r\n- [ ] Docs have been added / updated (for bug fixes / features)\r\n\r\n\r\n**What kind of change does this PR introduce?**\r\n\r\n- [ ] Bugfix\r\n- [x] Feature\r\n- [ ] Code style update (formatting, local variables)\r\n- [ ] Refactoring (no functional changes, no api changes)\r\n- [ ] Build / CI related changes\r\n- [ ] Other... Please describe:\r\n\r\n**What is the current behavior?** (You can also link to an open issue here)\r\nThe title edit requirement is not fullfill with the current list.\r\n\r\n\r\n**What is the new behavior?**\r\nTo enable that, we introduce a title display mode that can be `input` or `text`(default). On the input, the ESC key trigger an `onCancel` callback, while ENTER key or blur event trigger an 'onChange`callback.\r\n\r\nThe number of props about the title, and the duplication code to render it increased a lot. So the title render logic has been externalized into an `ItemTitle` component. This component is responsible to render the title icon and the title as input, simple text, or button, based on the item and a configuration.\r\n\r\n**Does this PR introduce a breaking change?**\r\n\r\n- [x] Yes\r\n- [ ] No\r\n\r\nIf this PR contains a breaking change, please describe the impact and migration path for existing applications: ...\r\n\r\n\r\n**Other information**:\r\n","created_at":"2016-11-09T11:16:22Z","updated_at":"2016-11-17T17:02:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"be68571ea20c8dfd2aaebb2c5d74995cdd659351","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Talend/react-talend-components/pulls/90/commits","review_comments_url":"https://api.github.com/repos/Talend/react-talend-components/pulls/90/comments","review_comment_url":"https://api.github.com/repos/Talend/react-talend-components/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Talend/react-talend-components/issues/90/comments","statuses_url":"https://api.github.com/repos/Talend/react-talend-components/statuses/4652eccf309f1d6e0e4477266a53969cacddf079","head":{"label":"Talend:feat/list-title-input","ref":"feat/list-title-input","sha":"4652eccf309f1d6e0e4477266a53969cacddf079","user":{"login":"Talend","id":459687,"avatar_url":"https://avatars.githubusercontent.com/u/459687?v=3","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"repo":{"id":70495607,"name":"react-talend-components","full_name":"Talend/react-talend-components","owner":{"login":"Talend","id":459687,"avatar_url":"https://avatars.githubusercontent.com/u/459687?v=3","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Talend/react-talend-components","description":"Set of stateless react components which implement Talend guidelines","fork":false,"url":"https://api.github.com/repos/Talend/react-talend-components","forks_url":"https://api.github.com/repos/Talend/react-talend-components/forks","keys_url":"https://api.github.com/repos/Talend/react-talend-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Talend/react-talend-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Talend/react-talend-components/teams","hooks_url":"https://api.github.com/repos/Talend/react-talend-components/hooks","issue_events_url":"https://api.github.com/repos/Talend/react-talend-components/issues/events{/number}","events_url":"https://api.github.com/repos/Talend/react-talend-components/events","assignees_url":"https://api.github.com/repos/Talend/react-talend-components/assignees{/user}","branches_url":"https://api.github.com/repos/Talend/react-talend-components/branches{/branch}","tags_url":"https://api.github.com/repos/Talend/react-talend-components/tags","blobs_url":"https://api.github.com/repos/Talend/react-talend-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Talend/react-talend-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Talend/react-talend-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/Talend/react-talend-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Talend/react-talend-components/statuses/{sha}","languages_url":"https://api.github.com/repos/Talend/react-talend-components/languages","stargazers_url":"https://api.github.com/repos/Talend/react-talend-components/stargazers","contributors_url":"https://api.github.com/repos/Talend/react-talend-components/contributors","subscribers_url":"https://api.github.com/repos/Talend/react-talend-components/subscribers","subscription_url":"https://api.github.com/repos/Talend/react-talend-components/subscription","commits_url":"https://api.github.com/repos/Talend/react-talend-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/Talend/react-talend-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/Talend/react-talend-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/Talend/react-talend-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/Talend/react-talend-components/contents/{+path}","compare_url":"https://api.github.com/repos/Talend/react-talend-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Talend/react-talend-components/merges","archive_url":"https://api.github.com/repos/Talend/react-talend-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Talend/react-talend-components/downloads","issues_url":"https://api.github.com/repos/Talend/react-talend-components/issues{/number}","pulls_url":"https://api.github.com/repos/Talend/react-talend-components/pulls{/number}","milestones_url":"https://api.github.com/repos/Talend/react-talend-components/milestones{/number}","notifications_url":"https://api.github.com/repos/Talend/react-talend-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Talend/react-talend-components/labels{/name}","releases_url":"https://api.github.com/repos/Talend/react-talend-components/releases{/id}","deployments_url":"https://api.github.com/repos/Talend/react-talend-components/deployments","created_at":"2016-10-10T14:22:07Z","updated_at":"2016-10-23T15:08:43Z","pushed_at":"2016-11-17T16:21:23Z","git_url":"git://github.com/Talend/react-talend-components.git","ssh_url":"git@github.com:Talend/react-talend-components.git","clone_url":"https://github.com/Talend/react-talend-components.git","svn_url":"https://github.com/Talend/react-talend-components","homepage":"https://talend.github.io/react-talend-components","size":1261,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":16,"forks":2,"open_issues":16,"watchers":2,"default_branch":"master"}},"base":{"label":"Talend:master","ref":"master","sha":"f30687febd4682d4782212e136f5529da093ab18","user":{"login":"Talend","id":459687,"avatar_url":"https://avatars.githubusercontent.com/u/459687?v=3","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"repo":{"id":70495607,"name":"react-talend-components","full_name":"Talend/react-talend-components","owner":{"login":"Talend","id":459687,"avatar_url":"https://avatars.githubusercontent.com/u/459687?v=3","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Talend/react-talend-components","description":"Set of stateless react components which implement Talend guidelines","fork":false,"url":"https://api.github.com/repos/Talend/react-talend-components","forks_url":"https://api.github.com/repos/Talend/react-talend-components/forks","keys_url":"https://api.github.com/repos/Talend/react-talend-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Talend/react-talend-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Talend/react-talend-components/teams","hooks_url":"https://api.github.com/repos/Talend/react-talend-components/hooks","issue_events_url":"https://api.github.com/repos/Talend/react-talend-components/issues/events{/number}","events_url":"https://api.github.com/repos/Talend/react-talend-components/events","assignees_url":"https://api.github.com/repos/Talend/react-talend-components/assignees{/user}","branches_url":"https://api.github.com/repos/Talend/react-talend-components/branches{/branch}","tags_url":"https://api.github.com/repos/Talend/react-talend-components/tags","blobs_url":"https://api.github.com/repos/Talend/react-talend-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Talend/react-talend-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Talend/react-talend-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/Talend/react-talend-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Talend/react-talend-components/statuses/{sha}","languages_url":"https://api.github.com/repos/Talend/react-talend-components/languages","stargazers_url":"https://api.github.com/repos/Talend/react-talend-components/stargazers","contributors_url":"https://api.github.com/repos/Talend/react-talend-components/contributors","subscribers_url":"https://api.github.com/repos/Talend/react-talend-components/subscribers","subscription_url":"https://api.github.com/repos/Talend/react-talend-components/subscription","commits_url":"https://api.github.com/repos/Talend/react-talend-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/Talend/react-talend-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/Talend/react-talend-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/Talend/react-talend-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/Talend/react-talend-components/contents/{+path}","compare_url":"https://api.github.com/repos/Talend/react-talend-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Talend/react-talend-components/merges","archive_url":"https://api.github.com/repos/Talend/react-talend-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Talend/react-talend-components/downloads","issues_url":"https://api.github.com/repos/Talend/react-talend-components/issues{/number}","pulls_url":"https://api.github.com/repos/Talend/react-talend-components/pulls{/number}","milestones_url":"https://api.github.com/repos/Talend/react-talend-components/milestones{/number}","notifications_url":"https://api.github.com/repos/Talend/react-talend-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Talend/react-talend-components/labels{/name}","releases_url":"https://api.github.com/repos/Talend/react-talend-components/releases{/id}","deployments_url":"https://api.github.com/repos/Talend/react-talend-components/deployments","created_at":"2016-10-10T14:22:07Z","updated_at":"2016-10-23T15:08:43Z","pushed_at":"2016-11-17T16:21:23Z","git_url":"git://github.com/Talend/react-talend-components.git","ssh_url":"git@github.com:Talend/react-talend-components.git","clone_url":"https://github.com/Talend/react-talend-components.git","svn_url":"https://github.com/Talend/react-talend-components","homepage":"https://talend.github.io/react-talend-components","size":1261,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":16,"forks":2,"open_issues":16,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Talend/react-talend-components/pulls/90"},"html":{"href":"https://github.com/Talend/react-talend-components/pull/90"},"issue":{"href":"https://api.github.com/repos/Talend/react-talend-components/issues/90"},"comments":{"href":"https://api.github.com/repos/Talend/react-talend-components/issues/90/comments"},"review_comments":{"href":"https://api.github.com/repos/Talend/react-talend-components/pulls/90/comments"},"review_comment":{"href":"https://api.github.com/repos/Talend/react-talend-components/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Talend/react-talend-components/pulls/90/commits"},"statuses":{"href":"https://api.github.com/repos/Talend/react-talend-components/statuses/4652eccf309f1d6e0e4477266a53969cacddf079"}}}}
{"actor":{"display_login":"talend-glorieux"}}