{"action":"created","comment":{"url":"https://api.github.com/repos/poldracklab/crn_app/pulls/comments/88087430","pull_request_review_id":8671618,"id":88087430,"diff_hunk":"@@ -90,6 +92,90 @@ let UserStore = Reflux.createStore({\n     },\n \n     /**\n+     * Search username and email","path":"src/scripts/admin/admin.store.js","position":13,"original_position":13,"commit_id":"f7ef010e8bb3444ffab9e8e3382ea1eb526d751b","original_commit_id":"f7ef010e8bb3444ffab9e8e3382ea1eb526d751b","user":{"login":"constellates","id":4325905,"avatar_url":"https://avatars.githubusercontent.com/u/4325905?v=3","gravatar_id":"","url":"https://api.github.com/users/constellates","html_url":"https://github.com/constellates","followers_url":"https://api.github.com/users/constellates/followers","following_url":"https://api.github.com/users/constellates/following{/other_user}","gists_url":"https://api.github.com/users/constellates/gists{/gist_id}","starred_url":"https://api.github.com/users/constellates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/constellates/subscriptions","organizations_url":"https://api.github.com/users/constellates/orgs","repos_url":"https://api.github.com/users/constellates/repos","events_url":"https://api.github.com/users/constellates/events{/privacy}","received_events_url":"https://api.github.com/users/constellates/received_events","type":"User","site_admin":false},"body":"I would breaker these two filtering functions into three functions. One for handling the search input, one for handling the admin button filter click and a shared filtering function.\r\n\r\n\tsearchUser (input) {\r\n\t\tthis.filter(input, this.data.adminFilter);\r\n\t},\r\n\r\n\tfilterAdmin () {\r\n\t\tthis.filter(this.data.searchInput, !this.data.adminFilter);\r\n\t},\r\n\r\n\tfilter (searchInput, adminFilter) {\r\n\t\tfor (let user of users) {\r\n\t\t\tuser.visible = true;\r\n\r\n\t\t\t// search filtering\r\n\t\t\tif (/* search string does not match user and search string not empty */) {\r\n\t\t\t\tuser.visible = false;\r\n\t\t\t}\r\n\r\n\t\t\t// button filtering\r\n\t\t\tif (/* admin filter on and user not admin */) {\r\n\t\t\t\tuser.visible = false;\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\t\tthis.update({users, searchInput, adminFilter});\r\n\t}","created_at":"2016-11-15T18:58:08Z","updated_at":"2016-11-15T18:58:08Z","html_url":"https://github.com/poldracklab/crn_app/pull/165#discussion_r88087430","pull_request_url":"https://api.github.com/repos/poldracklab/crn_app/pulls/165","_links":{"self":{"href":"https://api.github.com/repos/poldracklab/crn_app/pulls/comments/88087430"},"html":{"href":"https://github.com/poldracklab/crn_app/pull/165#discussion_r88087430"},"pull_request":{"href":"https://api.github.com/repos/poldracklab/crn_app/pulls/165"}}},"pull_request":{"url":"https://api.github.com/repos/poldracklab/crn_app/pulls/165","id":92847135,"html_url":"https://github.com/poldracklab/crn_app/pull/165","diff_url":"https://github.com/poldracklab/crn_app/pull/165.diff","patch_url":"https://github.com/poldracklab/crn_app/pull/165.patch","issue_url":"https://api.github.com/repos/poldracklab/crn_app/issues/165","number":165,"state":"open","locked":false,"title":"Admin search","user":{"login":"thinknoack","id":3342083,"avatar_url":"https://avatars.githubusercontent.com/u/3342083?v=3","gravatar_id":"","url":"https://api.github.com/users/thinknoack","html_url":"https://github.com/thinknoack","followers_url":"https://api.github.com/users/thinknoack/followers","following_url":"https://api.github.com/users/thinknoack/following{/other_user}","gists_url":"https://api.github.com/users/thinknoack/gists{/gist_id}","starred_url":"https://api.github.com/users/thinknoack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thinknoack/subscriptions","organizations_url":"https://api.github.com/users/thinknoack/orgs","repos_url":"https://api.github.com/users/thinknoack/repos","events_url":"https://api.github.com/users/thinknoack/events{/privacy}","received_events_url":"https://api.github.com/users/thinknoack/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-08T19:53:38Z","updated_at":"2016-11-15T18:58:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e247c1fbdad3b58b9a82b098d9ecf341f2698853","assignee":{"login":"constellates","id":4325905,"avatar_url":"https://avatars.githubusercontent.com/u/4325905?v=3","gravatar_id":"","url":"https://api.github.com/users/constellates","html_url":"https://github.com/constellates","followers_url":"https://api.github.com/users/constellates/followers","following_url":"https://api.github.com/users/constellates/following{/other_user}","gists_url":"https://api.github.com/users/constellates/gists{/gist_id}","starred_url":"https://api.github.com/users/constellates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/constellates/subscriptions","organizations_url":"https://api.github.com/users/constellates/orgs","repos_url":"https://api.github.com/users/constellates/repos","events_url":"https://api.github.com/users/constellates/events{/privacy}","received_events_url":"https://api.github.com/users/constellates/received_events","type":"User","site_admin":false},"assignees":[{"login":"constellates","id":4325905,"avatar_url":"https://avatars.githubusercontent.com/u/4325905?v=3","gravatar_id":"","url":"https://api.github.com/users/constellates","html_url":"https://github.com/constellates","followers_url":"https://api.github.com/users/constellates/followers","following_url":"https://api.github.com/users/constellates/following{/other_user}","gists_url":"https://api.github.com/users/constellates/gists{/gist_id}","starred_url":"https://api.github.com/users/constellates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/constellates/subscriptions","organizations_url":"https://api.github.com/users/constellates/orgs","repos_url":"https://api.github.com/users/constellates/repos","events_url":"https://api.github.com/users/constellates/events{/privacy}","received_events_url":"https://api.github.com/users/constellates/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/poldracklab/crn_app/pulls/165/commits","review_comments_url":"https://api.github.com/repos/poldracklab/crn_app/pulls/165/comments","review_comment_url":"https://api.github.com/repos/poldracklab/crn_app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/poldracklab/crn_app/issues/165/comments","statuses_url":"https://api.github.com/repos/poldracklab/crn_app/statuses/f7ef010e8bb3444ffab9e8e3382ea1eb526d751b","head":{"label":"poldracklab:admin-search","ref":"admin-search","sha":"f7ef010e8bb3444ffab9e8e3382ea1eb526d751b","user":{"login":"poldracklab","id":9287954,"avatar_url":"https://avatars.githubusercontent.com/u/9287954?v=3","gravatar_id":"","url":"https://api.github.com/users/poldracklab","html_url":"https://github.com/poldracklab","followers_url":"https://api.github.com/users/poldracklab/followers","following_url":"https://api.github.com/users/poldracklab/following{/other_user}","gists_url":"https://api.github.com/users/poldracklab/gists{/gist_id}","starred_url":"https://api.github.com/users/poldracklab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poldracklab/subscriptions","organizations_url":"https://api.github.com/users/poldracklab/orgs","repos_url":"https://api.github.com/users/poldracklab/repos","events_url":"https://api.github.com/users/poldracklab/events{/privacy}","received_events_url":"https://api.github.com/users/poldracklab/received_events","type":"Organization","site_admin":false},"repo":{"id":54907613,"name":"crn_app","full_name":"poldracklab/crn_app","owner":{"login":"poldracklab","id":9287954,"avatar_url":"https://avatars.githubusercontent.com/u/9287954?v=3","gravatar_id":"","url":"https://api.github.com/users/poldracklab","html_url":"https://github.com/poldracklab","followers_url":"https://api.github.com/users/poldracklab/followers","following_url":"https://api.github.com/users/poldracklab/following{/other_user}","gists_url":"https://api.github.com/users/poldracklab/gists{/gist_id}","starred_url":"https://api.github.com/users/poldracklab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poldracklab/subscriptions","organizations_url":"https://api.github.com/users/poldracklab/orgs","repos_url":"https://api.github.com/users/poldracklab/repos","events_url":"https://api.github.com/users/poldracklab/events{/privacy}","received_events_url":"https://api.github.com/users/poldracklab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/poldracklab/crn_app","description":null,"fork":false,"url":"https://api.github.com/repos/poldracklab/crn_app","forks_url":"https://api.github.com/repos/poldracklab/crn_app/forks","keys_url":"https://api.github.com/repos/poldracklab/crn_app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/poldracklab/crn_app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/poldracklab/crn_app/teams","hooks_url":"https://api.github.com/repos/poldracklab/crn_app/hooks","issue_events_url":"https://api.github.com/repos/poldracklab/crn_app/issues/events{/number}","events_url":"https://api.github.com/repos/poldracklab/crn_app/events","assignees_url":"https://api.github.com/repos/poldracklab/crn_app/assignees{/user}","branches_url":"https://api.github.com/repos/poldracklab/crn_app/branches{/branch}","tags_url":"https://api.github.com/repos/poldracklab/crn_app/tags","blobs_url":"https://api.github.com/repos/poldracklab/crn_app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/poldracklab/crn_app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/poldracklab/crn_app/git/refs{/sha}","trees_url":"https://api.github.com/repos/poldracklab/crn_app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/poldracklab/crn_app/statuses/{sha}","languages_url":"https://api.github.com/repos/poldracklab/crn_app/languages","stargazers_url":"https://api.github.com/repos/poldracklab/crn_app/stargazers","contributors_url":"https://api.github.com/repos/poldracklab/crn_app/contributors","subscribers_url":"https://api.github.com/repos/poldracklab/crn_app/subscribers","subscription_url":"https://api.github.com/repos/poldracklab/crn_app/subscription","commits_url":"https://api.github.com/repos/poldracklab/crn_app/commits{/sha}","git_commits_url":"https://api.github.com/repos/poldracklab/crn_app/git/commits{/sha}","comments_url":"https://api.github.com/repos/poldracklab/crn_app/comments{/number}","issue_comment_url":"https://api.github.com/repos/poldracklab/crn_app/issues/comments{/number}","contents_url":"https://api.github.com/repos/poldracklab/crn_app/contents/{+path}","compare_url":"https://api.github.com/repos/poldracklab/crn_app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/poldracklab/crn_app/merges","archive_url":"https://api.github.com/repos/poldracklab/crn_app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/poldracklab/crn_app/downloads","issues_url":"https://api.github.com/repos/poldracklab/crn_app/issues{/number}","pulls_url":"https://api.github.com/repos/poldracklab/crn_app/pulls{/number}","milestones_url":"https://api.github.com/repos/poldracklab/crn_app/milestones{/number}","notifications_url":"https://api.github.com/repos/poldracklab/crn_app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/poldracklab/crn_app/labels{/name}","releases_url":"https://api.github.com/repos/poldracklab/crn_app/releases{/id}","deployments_url":"https://api.github.com/repos/poldracklab/crn_app/deployments","created_at":"2016-03-28T16:51:54Z","updated_at":"2016-10-26T23:10:47Z","pushed_at":"2016-11-11T00:49:39Z","git_url":"git://github.com/poldracklab/crn_app.git","ssh_url":"git@github.com:poldracklab/crn_app.git","clone_url":"https://github.com/poldracklab/crn_app.git","svn_url":"https://github.com/poldracklab/crn_app","homepage":null,"size":6559,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"poldracklab:dev","ref":"dev","sha":"c31eb8f9630c173d63507ea70b8a353e9c0d2c60","user":{"login":"poldracklab","id":9287954,"avatar_url":"https://avatars.githubusercontent.com/u/9287954?v=3","gravatar_id":"","url":"https://api.github.com/users/poldracklab","html_url":"https://github.com/poldracklab","followers_url":"https://api.github.com/users/poldracklab/followers","following_url":"https://api.github.com/users/poldracklab/following{/other_user}","gists_url":"https://api.github.com/users/poldracklab/gists{/gist_id}","starred_url":"https://api.github.com/users/poldracklab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poldracklab/subscriptions","organizations_url":"https://api.github.com/users/poldracklab/orgs","repos_url":"https://api.github.com/users/poldracklab/repos","events_url":"https://api.github.com/users/poldracklab/events{/privacy}","received_events_url":"https://api.github.com/users/poldracklab/received_events","type":"Organization","site_admin":false},"repo":{"id":54907613,"name":"crn_app","full_name":"poldracklab/crn_app","owner":{"login":"poldracklab","id":9287954,"avatar_url":"https://avatars.githubusercontent.com/u/9287954?v=3","gravatar_id":"","url":"https://api.github.com/users/poldracklab","html_url":"https://github.com/poldracklab","followers_url":"https://api.github.com/users/poldracklab/followers","following_url":"https://api.github.com/users/poldracklab/following{/other_user}","gists_url":"https://api.github.com/users/poldracklab/gists{/gist_id}","starred_url":"https://api.github.com/users/poldracklab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poldracklab/subscriptions","organizations_url":"https://api.github.com/users/poldracklab/orgs","repos_url":"https://api.github.com/users/poldracklab/repos","events_url":"https://api.github.com/users/poldracklab/events{/privacy}","received_events_url":"https://api.github.com/users/poldracklab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/poldracklab/crn_app","description":null,"fork":false,"url":"https://api.github.com/repos/poldracklab/crn_app","forks_url":"https://api.github.com/repos/poldracklab/crn_app/forks","keys_url":"https://api.github.com/repos/poldracklab/crn_app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/poldracklab/crn_app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/poldracklab/crn_app/teams","hooks_url":"https://api.github.com/repos/poldracklab/crn_app/hooks","issue_events_url":"https://api.github.com/repos/poldracklab/crn_app/issues/events{/number}","events_url":"https://api.github.com/repos/poldracklab/crn_app/events","assignees_url":"https://api.github.com/repos/poldracklab/crn_app/assignees{/user}","branches_url":"https://api.github.com/repos/poldracklab/crn_app/branches{/branch}","tags_url":"https://api.github.com/repos/poldracklab/crn_app/tags","blobs_url":"https://api.github.com/repos/poldracklab/crn_app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/poldracklab/crn_app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/poldracklab/crn_app/git/refs{/sha}","trees_url":"https://api.github.com/repos/poldracklab/crn_app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/poldracklab/crn_app/statuses/{sha}","languages_url":"https://api.github.com/repos/poldracklab/crn_app/languages","stargazers_url":"https://api.github.com/repos/poldracklab/crn_app/stargazers","contributors_url":"https://api.github.com/repos/poldracklab/crn_app/contributors","subscribers_url":"https://api.github.com/repos/poldracklab/crn_app/subscribers","subscription_url":"https://api.github.com/repos/poldracklab/crn_app/subscription","commits_url":"https://api.github.com/repos/poldracklab/crn_app/commits{/sha}","git_commits_url":"https://api.github.com/repos/poldracklab/crn_app/git/commits{/sha}","comments_url":"https://api.github.com/repos/poldracklab/crn_app/comments{/number}","issue_comment_url":"https://api.github.com/repos/poldracklab/crn_app/issues/comments{/number}","contents_url":"https://api.github.com/repos/poldracklab/crn_app/contents/{+path}","compare_url":"https://api.github.com/repos/poldracklab/crn_app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/poldracklab/crn_app/merges","archive_url":"https://api.github.com/repos/poldracklab/crn_app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/poldracklab/crn_app/downloads","issues_url":"https://api.github.com/repos/poldracklab/crn_app/issues{/number}","pulls_url":"https://api.github.com/repos/poldracklab/crn_app/pulls{/number}","milestones_url":"https://api.github.com/repos/poldracklab/crn_app/milestones{/number}","notifications_url":"https://api.github.com/repos/poldracklab/crn_app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/poldracklab/crn_app/labels{/name}","releases_url":"https://api.github.com/repos/poldracklab/crn_app/releases{/id}","deployments_url":"https://api.github.com/repos/poldracklab/crn_app/deployments","created_at":"2016-03-28T16:51:54Z","updated_at":"2016-10-26T23:10:47Z","pushed_at":"2016-11-11T00:49:39Z","git_url":"git://github.com/poldracklab/crn_app.git","ssh_url":"git@github.com:poldracklab/crn_app.git","clone_url":"https://github.com/poldracklab/crn_app.git","svn_url":"https://github.com/poldracklab/crn_app","homepage":null,"size":6559,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/poldracklab/crn_app/pulls/165"},"html":{"href":"https://github.com/poldracklab/crn_app/pull/165"},"issue":{"href":"https://api.github.com/repos/poldracklab/crn_app/issues/165"},"comments":{"href":"https://api.github.com/repos/poldracklab/crn_app/issues/165/comments"},"review_comments":{"href":"https://api.github.com/repos/poldracklab/crn_app/pulls/165/comments"},"review_comment":{"href":"https://api.github.com/repos/poldracklab/crn_app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/poldracklab/crn_app/pulls/165/commits"},"statuses":{"href":"https://api.github.com/repos/poldracklab/crn_app/statuses/f7ef010e8bb3444ffab9e8e3382ea1eb526d751b"}}}}
{"actor":{"display_login":"constellates"}}