{"action":"created","comment":{"url":"https://api.github.com/repos/devtools-html/gecko-dev/pulls/comments/70817162","id":70817162,"diff_hunk":"@@ -5,13 +5,37 @@\n  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n \"use strict\";\n \n-const { getLogLimit } = require(\"devtools/client/webconsole/new-console-output/selectors/prefs\");\n+const { getAllFilters, getLogLimit } = require(\"devtools/client/webconsole/new-console-output/selectors/prefs\");\n \n function getAllMessages(state) {\n   let messages = state.messages;\n-  let messageCount = messages.count();\n   let logLimit = getLogLimit(state);\n+  let filters = getAllFilters(state);\n+\n+  return prune(\n+    search(\n+      filterSeverity(messages, filters),\n+      filters.get(\"searchText\")\n+    ),\n+    logLimit\n+  );\n+}\n+\n+function filterSeverity(messages, filters) {\n+  return messages.filter((message) => filters.get(message.severity) === true);\n+}\n+\n+function search(messages, searchText = \"\") {\n+  return messages.filter(function (message) {\n+    if (!message.parameters) {\n+      return true;\n+    }\n+    return message.parameters.join(\"\").includes(searchText);","path":"devtools/client/webconsole/new-console-output/selectors/messages.js","position":31,"original_position":31,"commit_id":"ee58e64de4402643678f767bc45ded1dcef9110c","original_commit_id":"ee58e64de4402643678f767bc45ded1dcef9110c","user":{"login":"linclark","id":105464,"avatar_url":"https://avatars.githubusercontent.com/u/105464?v=3","gravatar_id":"","url":"https://api.github.com/users/linclark","html_url":"https://github.com/linclark","followers_url":"https://api.github.com/users/linclark/followers","following_url":"https://api.github.com/users/linclark/following{/other_user}","gists_url":"https://api.github.com/users/linclark/gists{/gist_id}","starred_url":"https://api.github.com/users/linclark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linclark/subscriptions","organizations_url":"https://api.github.com/users/linclark/orgs","repos_url":"https://api.github.com/users/linclark/repos","events_url":"https://api.github.com/users/linclark/events{/privacy}","received_events_url":"https://api.github.com/users/linclark/received_events","type":"User","site_admin":false},"body":"I'm getting a `message.parameters.join(\"\")` is not a function error. Parameters can be null.","created_at":"2016-07-14T14:38:34Z","updated_at":"2016-07-14T14:38:34Z","html_url":"https://github.com/devtools-html/gecko-dev/pull/123#discussion_r70817162","pull_request_url":"https://api.github.com/repos/devtools-html/gecko-dev/pulls/123","_links":{"self":{"href":"https://api.github.com/repos/devtools-html/gecko-dev/pulls/comments/70817162"},"html":{"href":"https://github.com/devtools-html/gecko-dev/pull/123#discussion_r70817162"},"pull_request":{"href":"https://api.github.com/repos/devtools-html/gecko-dev/pulls/123"}}},"pull_request":{"url":"https://api.github.com/repos/devtools-html/gecko-dev/pulls/123","id":77371275,"html_url":"https://github.com/devtools-html/gecko-dev/pull/123","diff_url":"https://github.com/devtools-html/gecko-dev/pull/123.diff","patch_url":"https://github.com/devtools-html/gecko-dev/pull/123.patch","issue_url":"https://api.github.com/repos/devtools-html/gecko-dev/issues/123","number":123,"state":"open","locked":false,"title":"[WIP] Add filtering bar","user":{"login":"nchevobbe","id":578107,"avatar_url":"https://avatars.githubusercontent.com/u/578107?v=3","gravatar_id":"","url":"https://api.github.com/users/nchevobbe","html_url":"https://github.com/nchevobbe","followers_url":"https://api.github.com/users/nchevobbe/followers","following_url":"https://api.github.com/users/nchevobbe/following{/other_user}","gists_url":"https://api.github.com/users/nchevobbe/gists{/gist_id}","starred_url":"https://api.github.com/users/nchevobbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nchevobbe/subscriptions","organizations_url":"https://api.github.com/users/nchevobbe/orgs","repos_url":"https://api.github.com/users/nchevobbe/repos","events_url":"https://api.github.com/users/nchevobbe/events{/privacy}","received_events_url":"https://api.github.com/users/nchevobbe/received_events","type":"User","site_admin":false},"body":"I think you wanted to have this done by today, so I'm posting what I have for now. \r\n\r\n**What's working :** \r\n- clear the logs\r\n- search the log (basic)\r\n- show/hide the \"configure filters\" bar\r\n- filtering message by their security level\r\n- clearing the filters\r\n\r\n\r\n**What need to be done:**\r\n- advanced search\r\n- show/hide the \"there are filtered messages..\" based on the filters\r\n- actually set the corresponding preferences when toggling the button \r\n- add Persist Log checkbox ( and setting the preference)\r\n- add CSS/Network/XHR pills when we have figure out what to do\r\n- use l10N for labels and title\r\n- add tests\r\n\r\n\r\n**What is buggy :**\r\n- the filter bar do not stick to the top. I don't really know XUL, and I'm struggling doing this. Should I render the ConsoleOutput on an ancestor node of the one we're using now (`outputNode`) ?\r\n- the \"show hide configure filter bar\" button does not have \"active\" style when the bar is shown\r\n- clicking on the search input sometimes does not add the focus on the input (it looks like it blurs as soon as it get focused)\r\n\r\n\r\n @linclark @bgrins please tell me is there things I can do better.\r\nI hope I don't slow you down, tomorrow is holiday in France and I took a PTO on Friday so I'll have some extra time to dedicate to this.","created_at":"2016-07-13T22:17:10Z","updated_at":"2016-07-14T14:38:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c85894326aad2a56b032ff0e7fdb7c2d1edf55c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/devtools-html/gecko-dev/pulls/123/commits","review_comments_url":"https://api.github.com/repos/devtools-html/gecko-dev/pulls/123/comments","review_comment_url":"https://api.github.com/repos/devtools-html/gecko-dev/pulls/comments{/number}","comments_url":"https://api.github.com/repos/devtools-html/gecko-dev/issues/123/comments","statuses_url":"https://api.github.com/repos/devtools-html/gecko-dev/statuses/ee58e64de4402643678f767bc45ded1dcef9110c","head":{"label":"nchevobbe:filterbar","ref":"filterbar","sha":"ee58e64de4402643678f767bc45ded1dcef9110c","user":{"login":"nchevobbe","id":578107,"avatar_url":"https://avatars.githubusercontent.com/u/578107?v=3","gravatar_id":"","url":"https://api.github.com/users/nchevobbe","html_url":"https://github.com/nchevobbe","followers_url":"https://api.github.com/users/nchevobbe/followers","following_url":"https://api.github.com/users/nchevobbe/following{/other_user}","gists_url":"https://api.github.com/users/nchevobbe/gists{/gist_id}","starred_url":"https://api.github.com/users/nchevobbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nchevobbe/subscriptions","organizations_url":"https://api.github.com/users/nchevobbe/orgs","repos_url":"https://api.github.com/users/nchevobbe/repos","events_url":"https://api.github.com/users/nchevobbe/events{/privacy}","received_events_url":"https://api.github.com/users/nchevobbe/received_events","type":"User","site_admin":false},"repo":{"id":56009223,"name":"gecko-dev","full_name":"nchevobbe/gecko-dev","owner":{"login":"nchevobbe","id":578107,"avatar_url":"https://avatars.githubusercontent.com/u/578107?v=3","gravatar_id":"","url":"https://api.github.com/users/nchevobbe","html_url":"https://github.com/nchevobbe","followers_url":"https://api.github.com/users/nchevobbe/followers","following_url":"https://api.github.com/users/nchevobbe/following{/other_user}","gists_url":"https://api.github.com/users/nchevobbe/gists{/gist_id}","starred_url":"https://api.github.com/users/nchevobbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nchevobbe/subscriptions","organizations_url":"https://api.github.com/users/nchevobbe/orgs","repos_url":"https://api.github.com/users/nchevobbe/repos","events_url":"https://api.github.com/users/nchevobbe/events{/privacy}","received_events_url":"https://api.github.com/users/nchevobbe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nchevobbe/gecko-dev","description":"Read-only Git mirror of the Mercurial gecko repositories at https://hg.mozilla.org. Please don't submit PRs, see: https://developer.mozilla.org/en-US/docs/Mercurial_FAQ#I%27m_all_used_to_git.2C_but_how_can_I_provide_Mercurial-ready_patches_.3F","fork":true,"url":"https://api.github.com/repos/nchevobbe/gecko-dev","forks_url":"https://api.github.com/repos/nchevobbe/gecko-dev/forks","keys_url":"https://api.github.com/repos/nchevobbe/gecko-dev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nchevobbe/gecko-dev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nchevobbe/gecko-dev/teams","hooks_url":"https://api.github.com/repos/nchevobbe/gecko-dev/hooks","issue_events_url":"https://api.github.com/repos/nchevobbe/gecko-dev/issues/events{/number}","events_url":"https://api.github.com/repos/nchevobbe/gecko-dev/events","assignees_url":"https://api.github.com/repos/nchevobbe/gecko-dev/assignees{/user}","branches_url":"https://api.github.com/repos/nchevobbe/gecko-dev/branches{/branch}","tags_url":"https://api.github.com/repos/nchevobbe/gecko-dev/tags","blobs_url":"https://api.github.com/repos/nchevobbe/gecko-dev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nchevobbe/gecko-dev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nchevobbe/gecko-dev/git/refs{/sha}","trees_url":"https://api.github.com/repos/nchevobbe/gecko-dev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nchevobbe/gecko-dev/statuses/{sha}","languages_url":"https://api.github.com/repos/nchevobbe/gecko-dev/languages","stargazers_url":"https://api.github.com/repos/nchevobbe/gecko-dev/stargazers","contributors_url":"https://api.github.com/repos/nchevobbe/gecko-dev/contributors","subscribers_url":"https://api.github.com/repos/nchevobbe/gecko-dev/subscribers","subscription_url":"https://api.github.com/repos/nchevobbe/gecko-dev/subscription","commits_url":"https://api.github.com/repos/nchevobbe/gecko-dev/commits{/sha}","git_commits_url":"https://api.github.com/repos/nchevobbe/gecko-dev/git/commits{/sha}","comments_url":"https://api.github.com/repos/nchevobbe/gecko-dev/comments{/number}","issue_comment_url":"https://api.github.com/repos/nchevobbe/gecko-dev/issues/comments{/number}","contents_url":"https://api.github.com/repos/nchevobbe/gecko-dev/contents/{+path}","compare_url":"https://api.github.com/repos/nchevobbe/gecko-dev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nchevobbe/gecko-dev/merges","archive_url":"https://api.github.com/repos/nchevobbe/gecko-dev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nchevobbe/gecko-dev/downloads","issues_url":"https://api.github.com/repos/nchevobbe/gecko-dev/issues{/number}","pulls_url":"https://api.github.com/repos/nchevobbe/gecko-dev/pulls{/number}","milestones_url":"https://api.github.com/repos/nchevobbe/gecko-dev/milestones{/number}","notifications_url":"https://api.github.com/repos/nchevobbe/gecko-dev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nchevobbe/gecko-dev/labels{/name}","releases_url":"https://api.github.com/repos/nchevobbe/gecko-dev/releases{/id}","deployments_url":"https://api.github.com/repos/nchevobbe/gecko-dev/deployments","created_at":"2016-04-11T21:32:38Z","updated_at":"2016-04-21T17:10:32Z","pushed_at":"2016-07-14T10:42:50Z","git_url":"git://github.com/nchevobbe/gecko-dev.git","ssh_url":"git@github.com:nchevobbe/gecko-dev.git","clone_url":"https://github.com/nchevobbe/gecko-dev.git","svn_url":"https://github.com/nchevobbe/gecko-dev","homepage":"https://developer.mozilla.org/docs/Introduction","size":2851635,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"devtools-html:console-frontend","ref":"console-frontend","sha":"36998a3b72fc99ecb99ebff37135296a584584a5","user":{"login":"devtools-html","id":19979421,"avatar_url":"https://avatars.githubusercontent.com/u/19979421?v=3","gravatar_id":"","url":"https://api.github.com/users/devtools-html","html_url":"https://github.com/devtools-html","followers_url":"https://api.github.com/users/devtools-html/followers","following_url":"https://api.github.com/users/devtools-html/following{/other_user}","gists_url":"https://api.github.com/users/devtools-html/gists{/gist_id}","starred_url":"https://api.github.com/users/devtools-html/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devtools-html/subscriptions","organizations_url":"https://api.github.com/users/devtools-html/orgs","repos_url":"https://api.github.com/users/devtools-html/repos","events_url":"https://api.github.com/users/devtools-html/events{/privacy}","received_events_url":"https://api.github.com/users/devtools-html/received_events","type":"Organization","site_admin":false},"repo":{"id":17458538,"name":"gecko-dev","full_name":"devtools-html/gecko-dev","owner":{"login":"devtools-html","id":19979421,"avatar_url":"https://avatars.githubusercontent.com/u/19979421?v=3","gravatar_id":"","url":"https://api.github.com/users/devtools-html","html_url":"https://github.com/devtools-html","followers_url":"https://api.github.com/users/devtools-html/followers","following_url":"https://api.github.com/users/devtools-html/following{/other_user}","gists_url":"https://api.github.com/users/devtools-html/gists{/gist_id}","starred_url":"https://api.github.com/users/devtools-html/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devtools-html/subscriptions","organizations_url":"https://api.github.com/users/devtools-html/orgs","repos_url":"https://api.github.com/users/devtools-html/repos","events_url":"https://api.github.com/users/devtools-html/events{/privacy}","received_events_url":"https://api.github.com/users/devtools-html/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/devtools-html/gecko-dev","description":"","fork":true,"url":"https://api.github.com/repos/devtools-html/gecko-dev","forks_url":"https://api.github.com/repos/devtools-html/gecko-dev/forks","keys_url":"https://api.github.com/repos/devtools-html/gecko-dev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devtools-html/gecko-dev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devtools-html/gecko-dev/teams","hooks_url":"https://api.github.com/repos/devtools-html/gecko-dev/hooks","issue_events_url":"https://api.github.com/repos/devtools-html/gecko-dev/issues/events{/number}","events_url":"https://api.github.com/repos/devtools-html/gecko-dev/events","assignees_url":"https://api.github.com/repos/devtools-html/gecko-dev/assignees{/user}","branches_url":"https://api.github.com/repos/devtools-html/gecko-dev/branches{/branch}","tags_url":"https://api.github.com/repos/devtools-html/gecko-dev/tags","blobs_url":"https://api.github.com/repos/devtools-html/gecko-dev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devtools-html/gecko-dev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devtools-html/gecko-dev/git/refs{/sha}","trees_url":"https://api.github.com/repos/devtools-html/gecko-dev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devtools-html/gecko-dev/statuses/{sha}","languages_url":"https://api.github.com/repos/devtools-html/gecko-dev/languages","stargazers_url":"https://api.github.com/repos/devtools-html/gecko-dev/stargazers","contributors_url":"https://api.github.com/repos/devtools-html/gecko-dev/contributors","subscribers_url":"https://api.github.com/repos/devtools-html/gecko-dev/subscribers","subscription_url":"https://api.github.com/repos/devtools-html/gecko-dev/subscription","commits_url":"https://api.github.com/repos/devtools-html/gecko-dev/commits{/sha}","git_commits_url":"https://api.github.com/repos/devtools-html/gecko-dev/git/commits{/sha}","comments_url":"https://api.github.com/repos/devtools-html/gecko-dev/comments{/number}","issue_comment_url":"https://api.github.com/repos/devtools-html/gecko-dev/issues/comments{/number}","contents_url":"https://api.github.com/repos/devtools-html/gecko-dev/contents/{+path}","compare_url":"https://api.github.com/repos/devtools-html/gecko-dev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devtools-html/gecko-dev/merges","archive_url":"https://api.github.com/repos/devtools-html/gecko-dev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devtools-html/gecko-dev/downloads","issues_url":"https://api.github.com/repos/devtools-html/gecko-dev/issues{/number}","pulls_url":"https://api.github.com/repos/devtools-html/gecko-dev/pulls{/number}","milestones_url":"https://api.github.com/repos/devtools-html/gecko-dev/milestones{/number}","notifications_url":"https://api.github.com/repos/devtools-html/gecko-dev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devtools-html/gecko-dev/labels{/name}","releases_url":"https://api.github.com/repos/devtools-html/gecko-dev/releases{/id}","deployments_url":"https://api.github.com/repos/devtools-html/gecko-dev/deployments","created_at":"2014-03-05T23:04:14Z","updated_at":"2016-06-16T16:43:03Z","pushed_at":"2016-07-14T10:42:52Z","git_url":"git://github.com/devtools-html/gecko-dev.git","ssh_url":"git@github.com:devtools-html/gecko-dev.git","clone_url":"https://github.com/devtools-html/gecko-dev.git","svn_url":"https://github.com/devtools-html/gecko-dev","homepage":null,"size":2731014,"stargazers_count":3,"watchers_count":3,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":26,"forks":1,"open_issues":26,"watchers":3,"default_branch":"console-frontend"}},"_links":{"self":{"href":"https://api.github.com/repos/devtools-html/gecko-dev/pulls/123"},"html":{"href":"https://github.com/devtools-html/gecko-dev/pull/123"},"issue":{"href":"https://api.github.com/repos/devtools-html/gecko-dev/issues/123"},"comments":{"href":"https://api.github.com/repos/devtools-html/gecko-dev/issues/123/comments"},"review_comments":{"href":"https://api.github.com/repos/devtools-html/gecko-dev/pulls/123/comments"},"review_comment":{"href":"https://api.github.com/repos/devtools-html/gecko-dev/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/devtools-html/gecko-dev/pulls/123/commits"},"statuses":{"href":"https://api.github.com/repos/devtools-html/gecko-dev/statuses/ee58e64de4402643678f767bc45ded1dcef9110c"}}}}
{"actor":{"display_login":"linclark"}}