{"action":"created","comment":{"url":"https://api.github.com/repos/coveo/react-vapor/pulls/comments/169365827","pull_request_review_id":97880112,"id":169365827,"diff_hunk":"@@ -0,0 +1,45 @@\n+import * as React from 'react';\n+import * as _ from 'underscore';\n+import {IReactVaporState} from '../../ReactVapor';\n+import {ReduxConnect} from '../../utils/ReduxUtils';\n+import {FlatSelectConnected} from '../flatSelect/FlatSelectConnected';\n+import {IFlatSelectOptionProps} from '../flatSelect/FlatSelectOption';\n+import {IItemBoxProps} from '../itemBox/ItemBox';\n+import {ISelectProps} from './SelectConnected';\n+\n+export interface ISelectWithPredicateProps extends ISelectProps {\n+  options: IFlatSelectOptionProps[];\n+  matchPredicate: (predicate: string, item: IItemBoxProps) => boolean;\n+}\n+\n+export const selectWithPredicate = (Component: (React.ComponentClass<ISelectProps> | React.StatelessComponent<ISelectProps>)): React.ComponentClass<ISelectWithPredicateProps> => {\n+\n+  const mapStateToProps = (state: IReactVaporState, ownProps: ISelectWithPredicateProps): Partial<ISelectProps> => {\n+    const flatSelect = _.findWhere(state.flatSelect, {id: ownProps.id});\n+    const predicate = flatSelect && flatSelect.selectedOptionId || ownProps.options[0].id;\n+\n+    const items = _.map(ownProps.items, (item: IItemBoxProps) => {\n+      const visible = ownProps.matchPredicate(predicate, item);\n+\n+      return _.extend({}, item, {hidden: !visible || item.hidden});","path":"src/components/select/SelectWithPredicate.tsx","position":24,"original_position":24,"commit_id":"3989844302f44b78506bfe76ec5fcb1bb9f767bb","original_commit_id":"3989844302f44b78506bfe76ec5fcb1bb9f767bb","user":{"login":"MichelML","id":9539763,"avatar_url":"https://avatars3.githubusercontent.com/u/9539763?v=4","gravatar_id":"","url":"https://api.github.com/users/MichelML","html_url":"https://github.com/MichelML","followers_url":"https://api.github.com/users/MichelML/followers","following_url":"https://api.github.com/users/MichelML/following{/other_user}","gists_url":"https://api.github.com/users/MichelML/gists{/gist_id}","starred_url":"https://api.github.com/users/MichelML/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichelML/subscriptions","organizations_url":"https://api.github.com/users/MichelML/orgs","repos_url":"https://api.github.com/users/MichelML/repos","events_url":"https://api.github.com/users/MichelML/events{/privacy}","received_events_url":"https://api.github.com/users/MichelML/received_events","type":"User","site_admin":false},"body":"{...item, hidden: !visible || item.hidden}\r\n\r\n","created_at":"2018-02-20T15:57:16Z","updated_at":"2018-02-20T15:57:17Z","html_url":"https://github.com/coveo/react-vapor/pull/485#discussion_r169365827","pull_request_url":"https://api.github.com/repos/coveo/react-vapor/pulls/485","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/coveo/react-vapor/pulls/comments/169365827"},"html":{"href":"https://github.com/coveo/react-vapor/pull/485#discussion_r169365827"},"pull_request":{"href":"https://api.github.com/repos/coveo/react-vapor/pulls/485"}}},"pull_request":{"url":"https://api.github.com/repos/coveo/react-vapor/pulls/485","id":170049631,"html_url":"https://github.com/coveo/react-vapor/pull/485","diff_url":"https://github.com/coveo/react-vapor/pull/485.diff","patch_url":"https://github.com/coveo/react-vapor/pull/485.patch","issue_url":"https://api.github.com/repos/coveo/react-vapor/issues/485","number":485,"state":"open","locked":false,"title":"Feature dropdown++","user":{"login":"GermainBergeron","id":260007,"avatar_url":"https://avatars0.githubusercontent.com/u/260007?v=4","gravatar_id":"","url":"https://api.github.com/users/GermainBergeron","html_url":"https://github.com/GermainBergeron","followers_url":"https://api.github.com/users/GermainBergeron/followers","following_url":"https://api.github.com/users/GermainBergeron/following{/other_user}","gists_url":"https://api.github.com/users/GermainBergeron/gists{/gist_id}","starred_url":"https://api.github.com/users/GermainBergeron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GermainBergeron/subscriptions","organizations_url":"https://api.github.com/users/GermainBergeron/orgs","repos_url":"https://api.github.com/users/GermainBergeron/repos","events_url":"https://api.github.com/users/GermainBergeron/events{/privacy}","received_events_url":"https://api.github.com/users/GermainBergeron/received_events","type":"User","site_admin":false},"body":"Could replace the dropdown, chosen and dropdown with search\nStill need to have key handler for different use cases but the PR was growing rapidly in size so I thought it might be good to split it","created_at":"2018-02-19T20:47:27Z","updated_at":"2018-02-20T15:57:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5fd4b35156553b8983c825fee0747e22b80a1958","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/coveo/react-vapor/pulls/485/commits","review_comments_url":"https://api.github.com/repos/coveo/react-vapor/pulls/485/comments","review_comment_url":"https://api.github.com/repos/coveo/react-vapor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coveo/react-vapor/issues/485/comments","statuses_url":"https://api.github.com/repos/coveo/react-vapor/statuses/3989844302f44b78506bfe76ec5fcb1bb9f767bb","head":{"label":"coveo:feature-dropdown-plus-plus","ref":"feature-dropdown-plus-plus","sha":"3989844302f44b78506bfe76ec5fcb1bb9f767bb","user":{"login":"coveo","id":8632328,"avatar_url":"https://avatars2.githubusercontent.com/u/8632328?v=4","gravatar_id":"","url":"https://api.github.com/users/coveo","html_url":"https://github.com/coveo","followers_url":"https://api.github.com/users/coveo/followers","following_url":"https://api.github.com/users/coveo/following{/other_user}","gists_url":"https://api.github.com/users/coveo/gists{/gist_id}","starred_url":"https://api.github.com/users/coveo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveo/subscriptions","organizations_url":"https://api.github.com/users/coveo/orgs","repos_url":"https://api.github.com/users/coveo/repos","events_url":"https://api.github.com/users/coveo/events{/privacy}","received_events_url":"https://api.github.com/users/coveo/received_events","type":"Organization","site_admin":false},"repo":{"id":68227694,"name":"react-vapor","full_name":"coveo/react-vapor","owner":{"login":"coveo","id":8632328,"avatar_url":"https://avatars2.githubusercontent.com/u/8632328?v=4","gravatar_id":"","url":"https://api.github.com/users/coveo","html_url":"https://github.com/coveo","followers_url":"https://api.github.com/users/coveo/followers","following_url":"https://api.github.com/users/coveo/following{/other_user}","gists_url":"https://api.github.com/users/coveo/gists{/gist_id}","starred_url":"https://api.github.com/users/coveo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveo/subscriptions","organizations_url":"https://api.github.com/users/coveo/orgs","repos_url":"https://api.github.com/users/coveo/repos","events_url":"https://api.github.com/users/coveo/events{/privacy}","received_events_url":"https://api.github.com/users/coveo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coveo/react-vapor","description":"Vapor CSS components implemented with React!","fork":false,"url":"https://api.github.com/repos/coveo/react-vapor","forks_url":"https://api.github.com/repos/coveo/react-vapor/forks","keys_url":"https://api.github.com/repos/coveo/react-vapor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coveo/react-vapor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coveo/react-vapor/teams","hooks_url":"https://api.github.com/repos/coveo/react-vapor/hooks","issue_events_url":"https://api.github.com/repos/coveo/react-vapor/issues/events{/number}","events_url":"https://api.github.com/repos/coveo/react-vapor/events","assignees_url":"https://api.github.com/repos/coveo/react-vapor/assignees{/user}","branches_url":"https://api.github.com/repos/coveo/react-vapor/branches{/branch}","tags_url":"https://api.github.com/repos/coveo/react-vapor/tags","blobs_url":"https://api.github.com/repos/coveo/react-vapor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coveo/react-vapor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coveo/react-vapor/git/refs{/sha}","trees_url":"https://api.github.com/repos/coveo/react-vapor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coveo/react-vapor/statuses/{sha}","languages_url":"https://api.github.com/repos/coveo/react-vapor/languages","stargazers_url":"https://api.github.com/repos/coveo/react-vapor/stargazers","contributors_url":"https://api.github.com/repos/coveo/react-vapor/contributors","subscribers_url":"https://api.github.com/repos/coveo/react-vapor/subscribers","subscription_url":"https://api.github.com/repos/coveo/react-vapor/subscription","commits_url":"https://api.github.com/repos/coveo/react-vapor/commits{/sha}","git_commits_url":"https://api.github.com/repos/coveo/react-vapor/git/commits{/sha}","comments_url":"https://api.github.com/repos/coveo/react-vapor/comments{/number}","issue_comment_url":"https://api.github.com/repos/coveo/react-vapor/issues/comments{/number}","contents_url":"https://api.github.com/repos/coveo/react-vapor/contents/{+path}","compare_url":"https://api.github.com/repos/coveo/react-vapor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coveo/react-vapor/merges","archive_url":"https://api.github.com/repos/coveo/react-vapor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coveo/react-vapor/downloads","issues_url":"https://api.github.com/repos/coveo/react-vapor/issues{/number}","pulls_url":"https://api.github.com/repos/coveo/react-vapor/pulls{/number}","milestones_url":"https://api.github.com/repos/coveo/react-vapor/milestones{/number}","notifications_url":"https://api.github.com/repos/coveo/react-vapor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coveo/react-vapor/labels{/name}","releases_url":"https://api.github.com/repos/coveo/react-vapor/releases{/id}","deployments_url":"https://api.github.com/repos/coveo/react-vapor/deployments","created_at":"2016-09-14T17:25:21Z","updated_at":"2018-02-17T03:14:47Z","pushed_at":"2018-02-20T14:21:01Z","git_url":"git://github.com/coveo/react-vapor.git","ssh_url":"git@github.com:coveo/react-vapor.git","clone_url":"https://github.com/coveo/react-vapor.git","svn_url":"https://github.com/coveo/react-vapor","homepage":"","size":11026,"stargazers_count":6,"watchers_count":6,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":50,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":3,"open_issues":50,"watchers":6,"default_branch":"master"}},"base":{"label":"coveo:master","ref":"master","sha":"e0687faea75681ee61009af7d33ee568738c434e","user":{"login":"coveo","id":8632328,"avatar_url":"https://avatars2.githubusercontent.com/u/8632328?v=4","gravatar_id":"","url":"https://api.github.com/users/coveo","html_url":"https://github.com/coveo","followers_url":"https://api.github.com/users/coveo/followers","following_url":"https://api.github.com/users/coveo/following{/other_user}","gists_url":"https://api.github.com/users/coveo/gists{/gist_id}","starred_url":"https://api.github.com/users/coveo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveo/subscriptions","organizations_url":"https://api.github.com/users/coveo/orgs","repos_url":"https://api.github.com/users/coveo/repos","events_url":"https://api.github.com/users/coveo/events{/privacy}","received_events_url":"https://api.github.com/users/coveo/received_events","type":"Organization","site_admin":false},"repo":{"id":68227694,"name":"react-vapor","full_name":"coveo/react-vapor","owner":{"login":"coveo","id":8632328,"avatar_url":"https://avatars2.githubusercontent.com/u/8632328?v=4","gravatar_id":"","url":"https://api.github.com/users/coveo","html_url":"https://github.com/coveo","followers_url":"https://api.github.com/users/coveo/followers","following_url":"https://api.github.com/users/coveo/following{/other_user}","gists_url":"https://api.github.com/users/coveo/gists{/gist_id}","starred_url":"https://api.github.com/users/coveo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveo/subscriptions","organizations_url":"https://api.github.com/users/coveo/orgs","repos_url":"https://api.github.com/users/coveo/repos","events_url":"https://api.github.com/users/coveo/events{/privacy}","received_events_url":"https://api.github.com/users/coveo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coveo/react-vapor","description":"Vapor CSS components implemented with React!","fork":false,"url":"https://api.github.com/repos/coveo/react-vapor","forks_url":"https://api.github.com/repos/coveo/react-vapor/forks","keys_url":"https://api.github.com/repos/coveo/react-vapor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coveo/react-vapor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coveo/react-vapor/teams","hooks_url":"https://api.github.com/repos/coveo/react-vapor/hooks","issue_events_url":"https://api.github.com/repos/coveo/react-vapor/issues/events{/number}","events_url":"https://api.github.com/repos/coveo/react-vapor/events","assignees_url":"https://api.github.com/repos/coveo/react-vapor/assignees{/user}","branches_url":"https://api.github.com/repos/coveo/react-vapor/branches{/branch}","tags_url":"https://api.github.com/repos/coveo/react-vapor/tags","blobs_url":"https://api.github.com/repos/coveo/react-vapor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coveo/react-vapor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coveo/react-vapor/git/refs{/sha}","trees_url":"https://api.github.com/repos/coveo/react-vapor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coveo/react-vapor/statuses/{sha}","languages_url":"https://api.github.com/repos/coveo/react-vapor/languages","stargazers_url":"https://api.github.com/repos/coveo/react-vapor/stargazers","contributors_url":"https://api.github.com/repos/coveo/react-vapor/contributors","subscribers_url":"https://api.github.com/repos/coveo/react-vapor/subscribers","subscription_url":"https://api.github.com/repos/coveo/react-vapor/subscription","commits_url":"https://api.github.com/repos/coveo/react-vapor/commits{/sha}","git_commits_url":"https://api.github.com/repos/coveo/react-vapor/git/commits{/sha}","comments_url":"https://api.github.com/repos/coveo/react-vapor/comments{/number}","issue_comment_url":"https://api.github.com/repos/coveo/react-vapor/issues/comments{/number}","contents_url":"https://api.github.com/repos/coveo/react-vapor/contents/{+path}","compare_url":"https://api.github.com/repos/coveo/react-vapor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coveo/react-vapor/merges","archive_url":"https://api.github.com/repos/coveo/react-vapor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coveo/react-vapor/downloads","issues_url":"https://api.github.com/repos/coveo/react-vapor/issues{/number}","pulls_url":"https://api.github.com/repos/coveo/react-vapor/pulls{/number}","milestones_url":"https://api.github.com/repos/coveo/react-vapor/milestones{/number}","notifications_url":"https://api.github.com/repos/coveo/react-vapor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coveo/react-vapor/labels{/name}","releases_url":"https://api.github.com/repos/coveo/react-vapor/releases{/id}","deployments_url":"https://api.github.com/repos/coveo/react-vapor/deployments","created_at":"2016-09-14T17:25:21Z","updated_at":"2018-02-17T03:14:47Z","pushed_at":"2018-02-20T14:21:01Z","git_url":"git://github.com/coveo/react-vapor.git","ssh_url":"git@github.com:coveo/react-vapor.git","clone_url":"https://github.com/coveo/react-vapor.git","svn_url":"https://github.com/coveo/react-vapor","homepage":"","size":11026,"stargazers_count":6,"watchers_count":6,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":50,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":3,"open_issues":50,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coveo/react-vapor/pulls/485"},"html":{"href":"https://github.com/coveo/react-vapor/pull/485"},"issue":{"href":"https://api.github.com/repos/coveo/react-vapor/issues/485"},"comments":{"href":"https://api.github.com/repos/coveo/react-vapor/issues/485/comments"},"review_comments":{"href":"https://api.github.com/repos/coveo/react-vapor/pulls/485/comments"},"review_comment":{"href":"https://api.github.com/repos/coveo/react-vapor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coveo/react-vapor/pulls/485/commits"},"statuses":{"href":"https://api.github.com/repos/coveo/react-vapor/statuses/3989844302f44b78506bfe76ec5fcb1bb9f767bb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"MichelML"}}