{"action":"created","comment":{"url":"https://api.github.com/repos/3scale/porta/pulls/comments/228110051","pull_request_review_id":168300906,"id":228110051,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODExMDA1MQ==","diff_hunk":"@@ -6,12 +6,13 @@\n         var allApis = #{json @services}\n \n         var displayApis = function(filteredApis) {\n-          for (api = 0; api < allApis.length; api++) {\n-            document.getElementById(\"service_\" + allApis[api].service.id).style.display = \"none\"\n-          }\n-          for (api = 0; api < filteredApis.length; api++) {\n-            document.getElementById(\"service_\" + filteredApis[api].service.id).style.display = \"inline\"\n-          }\n+          allApis.forEach(function(api) {","path":"app/views/provider/admin/dashboards/_services_filter.html.slim","position":10,"original_position":10,"commit_id":"33f89edace7d3f422d5d4129c7c148a4c85cba0d","original_commit_id":"33f89edace7d3f422d5d4129c7c148a4c85cba0d","user":{"login":"didierofrivia","id":4183971,"node_id":"MDQ6VXNlcjQxODM5NzE=","avatar_url":"https://avatars3.githubusercontent.com/u/4183971?v=4","gravatar_id":"","url":"https://api.github.com/users/didierofrivia","html_url":"https://github.com/didierofrivia","followers_url":"https://api.github.com/users/didierofrivia/followers","following_url":"https://api.github.com/users/didierofrivia/following{/other_user}","gists_url":"https://api.github.com/users/didierofrivia/gists{/gist_id}","starred_url":"https://api.github.com/users/didierofrivia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/didierofrivia/subscriptions","organizations_url":"https://api.github.com/users/didierofrivia/orgs","repos_url":"https://api.github.com/users/didierofrivia/repos","events_url":"https://api.github.com/users/didierofrivia/events{/privacy}","received_events_url":"https://api.github.com/users/didierofrivia/received_events","type":"User","site_admin":false},"body":"pretty much indeed!","created_at":"2018-10-25T09:59:38Z","updated_at":"2018-10-25T09:59:38Z","html_url":"https://github.com/3scale/porta/pull/238#discussion_r228110051","pull_request_url":"https://api.github.com/repos/3scale/porta/pulls/238","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/3scale/porta/pulls/comments/228110051"},"html":{"href":"https://github.com/3scale/porta/pull/238#discussion_r228110051"},"pull_request":{"href":"https://api.github.com/repos/3scale/porta/pulls/238"}},"in_reply_to_id":228105462},"pull_request":{"url":"https://api.github.com/repos/3scale/porta/pulls/238","id":225350745,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1MzUwNzQ1","html_url":"https://github.com/3scale/porta/pull/238","diff_url":"https://github.com/3scale/porta/pull/238.diff","patch_url":"https://github.com/3scale/porta/pull/238.patch","issue_url":"https://api.github.com/repos/3scale/porta/issues/238","number":238,"state":"open","locked":false,"title":"Reduce loops in Api Filter","user":{"login":"josemigallas","id":11672286,"node_id":"MDQ6VXNlcjExNjcyMjg2","avatar_url":"https://avatars0.githubusercontent.com/u/11672286?v=4","gravatar_id":"","url":"https://api.github.com/users/josemigallas","html_url":"https://github.com/josemigallas","followers_url":"https://api.github.com/users/josemigallas/followers","following_url":"https://api.github.com/users/josemigallas/following{/other_user}","gists_url":"https://api.github.com/users/josemigallas/gists{/gist_id}","starred_url":"https://api.github.com/users/josemigallas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josemigallas/subscriptions","organizations_url":"https://api.github.com/users/josemigallas/orgs","repos_url":"https://api.github.com/users/josemigallas/repos","events_url":"https://api.github.com/users/josemigallas/events{/privacy}","received_events_url":"https://api.github.com/users/josemigallas/received_events","type":"User","site_admin":false},"body":"**What this PR does / why we need it**:\r\n\r\nBy request of @hallelujah in [this coment](https://github.com/3scale/porta/pull/78#pullrequestreview-162126816), here it is a proposal to make api filter logic more readable (both solutions are identical logic-wise).\r\n\r\nI've tried them both with 500 services and performance-wise the _double for_ is quicker. However the times are small enough to be negligible.\r\n\r\nI personally think the _double for_ is more readable but I'd like to know your opinions.\r\n","created_at":"2018-10-24T10:37:09Z","updated_at":"2018-10-25T09:59:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8012a3b5414e6fd709d1d73dbad9729aafe6e451","assignee":{"login":"josemigallas","id":11672286,"node_id":"MDQ6VXNlcjExNjcyMjg2","avatar_url":"https://avatars0.githubusercontent.com/u/11672286?v=4","gravatar_id":"","url":"https://api.github.com/users/josemigallas","html_url":"https://github.com/josemigallas","followers_url":"https://api.github.com/users/josemigallas/followers","following_url":"https://api.github.com/users/josemigallas/following{/other_user}","gists_url":"https://api.github.com/users/josemigallas/gists{/gist_id}","starred_url":"https://api.github.com/users/josemigallas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josemigallas/subscriptions","organizations_url":"https://api.github.com/users/josemigallas/orgs","repos_url":"https://api.github.com/users/josemigallas/repos","events_url":"https://api.github.com/users/josemigallas/events{/privacy}","received_events_url":"https://api.github.com/users/josemigallas/received_events","type":"User","site_admin":false},"assignees":[{"login":"josemigallas","id":11672286,"node_id":"MDQ6VXNlcjExNjcyMjg2","avatar_url":"https://avatars0.githubusercontent.com/u/11672286?v=4","gravatar_id":"","url":"https://api.github.com/users/josemigallas","html_url":"https://github.com/josemigallas","followers_url":"https://api.github.com/users/josemigallas/followers","following_url":"https://api.github.com/users/josemigallas/following{/other_user}","gists_url":"https://api.github.com/users/josemigallas/gists{/gist_id}","starred_url":"https://api.github.com/users/josemigallas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josemigallas/subscriptions","organizations_url":"https://api.github.com/users/josemigallas/orgs","repos_url":"https://api.github.com/users/josemigallas/repos","events_url":"https://api.github.com/users/josemigallas/events{/privacy}","received_events_url":"https://api.github.com/users/josemigallas/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"thomasmaas","id":54224,"node_id":"MDQ6VXNlcjU0MjI0","avatar_url":"https://avatars1.githubusercontent.com/u/54224?v=4","gravatar_id":"","url":"https://api.github.com/users/thomasmaas","html_url":"https://github.com/thomasmaas","followers_url":"https://api.github.com/users/thomasmaas/followers","following_url":"https://api.github.com/users/thomasmaas/following{/other_user}","gists_url":"https://api.github.com/users/thomasmaas/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasmaas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasmaas/subscriptions","organizations_url":"https://api.github.com/users/thomasmaas/orgs","repos_url":"https://api.github.com/users/thomasmaas/repos","events_url":"https://api.github.com/users/thomasmaas/events{/privacy}","received_events_url":"https://api.github.com/users/thomasmaas/received_events","type":"User","site_admin":false},{"login":"hallelujah","id":64276,"node_id":"MDQ6VXNlcjY0Mjc2","avatar_url":"https://avatars3.githubusercontent.com/u/64276?v=4","gravatar_id":"","url":"https://api.github.com/users/hallelujah","html_url":"https://github.com/hallelujah","followers_url":"https://api.github.com/users/hallelujah/followers","following_url":"https://api.github.com/users/hallelujah/following{/other_user}","gists_url":"https://api.github.com/users/hallelujah/gists{/gist_id}","starred_url":"https://api.github.com/users/hallelujah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hallelujah/subscriptions","organizations_url":"https://api.github.com/users/hallelujah/orgs","repos_url":"https://api.github.com/users/hallelujah/repos","events_url":"https://api.github.com/users/hallelujah/events{/privacy}","received_events_url":"https://api.github.com/users/hallelujah/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/3scale/porta/pulls/238/commits","review_comments_url":"https://api.github.com/repos/3scale/porta/pulls/238/comments","review_comment_url":"https://api.github.com/repos/3scale/porta/pulls/comments{/number}","comments_url":"https://api.github.com/repos/3scale/porta/issues/238/comments","statuses_url":"https://api.github.com/repos/3scale/porta/statuses/33f89edace7d3f422d5d4129c7c148a4c85cba0d","head":{"label":"josemigallas:refactor_api_filter","ref":"refactor_api_filter","sha":"33f89edace7d3f422d5d4129c7c148a4c85cba0d","user":{"login":"josemigallas","id":11672286,"node_id":"MDQ6VXNlcjExNjcyMjg2","avatar_url":"https://avatars0.githubusercontent.com/u/11672286?v=4","gravatar_id":"","url":"https://api.github.com/users/josemigallas","html_url":"https://github.com/josemigallas","followers_url":"https://api.github.com/users/josemigallas/followers","following_url":"https://api.github.com/users/josemigallas/following{/other_user}","gists_url":"https://api.github.com/users/josemigallas/gists{/gist_id}","starred_url":"https://api.github.com/users/josemigallas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josemigallas/subscriptions","organizations_url":"https://api.github.com/users/josemigallas/orgs","repos_url":"https://api.github.com/users/josemigallas/repos","events_url":"https://api.github.com/users/josemigallas/events{/privacy}","received_events_url":"https://api.github.com/users/josemigallas/received_events","type":"User","site_admin":false},"repo":{"id":149587195,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk1ODcxOTU=","name":"porta","full_name":"josemigallas/porta","private":false,"owner":{"login":"josemigallas","id":11672286,"node_id":"MDQ6VXNlcjExNjcyMjg2","avatar_url":"https://avatars0.githubusercontent.com/u/11672286?v=4","gravatar_id":"","url":"https://api.github.com/users/josemigallas","html_url":"https://github.com/josemigallas","followers_url":"https://api.github.com/users/josemigallas/followers","following_url":"https://api.github.com/users/josemigallas/following{/other_user}","gists_url":"https://api.github.com/users/josemigallas/gists{/gist_id}","starred_url":"https://api.github.com/users/josemigallas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josemigallas/subscriptions","organizations_url":"https://api.github.com/users/josemigallas/orgs","repos_url":"https://api.github.com/users/josemigallas/repos","events_url":"https://api.github.com/users/josemigallas/events{/privacy}","received_events_url":"https://api.github.com/users/josemigallas/received_events","type":"User","site_admin":false},"html_url":"https://github.com/josemigallas/porta","description":null,"fork":true,"url":"https://api.github.com/repos/josemigallas/porta","forks_url":"https://api.github.com/repos/josemigallas/porta/forks","keys_url":"https://api.github.com/repos/josemigallas/porta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/josemigallas/porta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/josemigallas/porta/teams","hooks_url":"https://api.github.com/repos/josemigallas/porta/hooks","issue_events_url":"https://api.github.com/repos/josemigallas/porta/issues/events{/number}","events_url":"https://api.github.com/repos/josemigallas/porta/events","assignees_url":"https://api.github.com/repos/josemigallas/porta/assignees{/user}","branches_url":"https://api.github.com/repos/josemigallas/porta/branches{/branch}","tags_url":"https://api.github.com/repos/josemigallas/porta/tags","blobs_url":"https://api.github.com/repos/josemigallas/porta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/josemigallas/porta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/josemigallas/porta/git/refs{/sha}","trees_url":"https://api.github.com/repos/josemigallas/porta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/josemigallas/porta/statuses/{sha}","languages_url":"https://api.github.com/repos/josemigallas/porta/languages","stargazers_url":"https://api.github.com/repos/josemigallas/porta/stargazers","contributors_url":"https://api.github.com/repos/josemigallas/porta/contributors","subscribers_url":"https://api.github.com/repos/josemigallas/porta/subscribers","subscription_url":"https://api.github.com/repos/josemigallas/porta/subscription","commits_url":"https://api.github.com/repos/josemigallas/porta/commits{/sha}","git_commits_url":"https://api.github.com/repos/josemigallas/porta/git/commits{/sha}","comments_url":"https://api.github.com/repos/josemigallas/porta/comments{/number}","issue_comment_url":"https://api.github.com/repos/josemigallas/porta/issues/comments{/number}","contents_url":"https://api.github.com/repos/josemigallas/porta/contents/{+path}","compare_url":"https://api.github.com/repos/josemigallas/porta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/josemigallas/porta/merges","archive_url":"https://api.github.com/repos/josemigallas/porta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/josemigallas/porta/downloads","issues_url":"https://api.github.com/repos/josemigallas/porta/issues{/number}","pulls_url":"https://api.github.com/repos/josemigallas/porta/pulls{/number}","milestones_url":"https://api.github.com/repos/josemigallas/porta/milestones{/number}","notifications_url":"https://api.github.com/repos/josemigallas/porta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/josemigallas/porta/labels{/name}","releases_url":"https://api.github.com/repos/josemigallas/porta/releases{/id}","deployments_url":"https://api.github.com/repos/josemigallas/porta/deployments","created_at":"2018-09-20T09:45:13Z","updated_at":"2018-10-24T10:26:56Z","pushed_at":"2018-10-25T09:58:42Z","git_url":"git://github.com/josemigallas/porta.git","ssh_url":"git@github.com:josemigallas/porta.git","clone_url":"https://github.com/josemigallas/porta.git","svn_url":"https://github.com/josemigallas/porta","homepage":null,"size":25873,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"3scale:master","ref":"master","sha":"b0940c01de323748f9b98db6a066f41eb9bac086","user":{"login":"3scale","id":21415,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxNDE1","avatar_url":"https://avatars0.githubusercontent.com/u/21415?v=4","gravatar_id":"","url":"https://api.github.com/users/3scale","html_url":"https://github.com/3scale","followers_url":"https://api.github.com/users/3scale/followers","following_url":"https://api.github.com/users/3scale/following{/other_user}","gists_url":"https://api.github.com/users/3scale/gists{/gist_id}","starred_url":"https://api.github.com/users/3scale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3scale/subscriptions","organizations_url":"https://api.github.com/users/3scale/orgs","repos_url":"https://api.github.com/users/3scale/repos","events_url":"https://api.github.com/users/3scale/events{/privacy}","received_events_url":"https://api.github.com/users/3scale/received_events","type":"Organization","site_admin":false},"repo":{"id":149315920,"node_id":"MDEwOlJlcG9zaXRvcnkxNDkzMTU5MjA=","name":"porta","full_name":"3scale/porta","private":false,"owner":{"login":"3scale","id":21415,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxNDE1","avatar_url":"https://avatars0.githubusercontent.com/u/21415?v=4","gravatar_id":"","url":"https://api.github.com/users/3scale","html_url":"https://github.com/3scale","followers_url":"https://api.github.com/users/3scale/followers","following_url":"https://api.github.com/users/3scale/following{/other_user}","gists_url":"https://api.github.com/users/3scale/gists{/gist_id}","starred_url":"https://api.github.com/users/3scale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3scale/subscriptions","organizations_url":"https://api.github.com/users/3scale/orgs","repos_url":"https://api.github.com/users/3scale/repos","events_url":"https://api.github.com/users/3scale/events{/privacy}","received_events_url":"https://api.github.com/users/3scale/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/3scale/porta","description":"Red Hat 3scale API Management User Interface","fork":false,"url":"https://api.github.com/repos/3scale/porta","forks_url":"https://api.github.com/repos/3scale/porta/forks","keys_url":"https://api.github.com/repos/3scale/porta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/3scale/porta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/3scale/porta/teams","hooks_url":"https://api.github.com/repos/3scale/porta/hooks","issue_events_url":"https://api.github.com/repos/3scale/porta/issues/events{/number}","events_url":"https://api.github.com/repos/3scale/porta/events","assignees_url":"https://api.github.com/repos/3scale/porta/assignees{/user}","branches_url":"https://api.github.com/repos/3scale/porta/branches{/branch}","tags_url":"https://api.github.com/repos/3scale/porta/tags","blobs_url":"https://api.github.com/repos/3scale/porta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/3scale/porta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/3scale/porta/git/refs{/sha}","trees_url":"https://api.github.com/repos/3scale/porta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/3scale/porta/statuses/{sha}","languages_url":"https://api.github.com/repos/3scale/porta/languages","stargazers_url":"https://api.github.com/repos/3scale/porta/stargazers","contributors_url":"https://api.github.com/repos/3scale/porta/contributors","subscribers_url":"https://api.github.com/repos/3scale/porta/subscribers","subscription_url":"https://api.github.com/repos/3scale/porta/subscription","commits_url":"https://api.github.com/repos/3scale/porta/commits{/sha}","git_commits_url":"https://api.github.com/repos/3scale/porta/git/commits{/sha}","comments_url":"https://api.github.com/repos/3scale/porta/comments{/number}","issue_comment_url":"https://api.github.com/repos/3scale/porta/issues/comments{/number}","contents_url":"https://api.github.com/repos/3scale/porta/contents/{+path}","compare_url":"https://api.github.com/repos/3scale/porta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/3scale/porta/merges","archive_url":"https://api.github.com/repos/3scale/porta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/3scale/porta/downloads","issues_url":"https://api.github.com/repos/3scale/porta/issues{/number}","pulls_url":"https://api.github.com/repos/3scale/porta/pulls{/number}","milestones_url":"https://api.github.com/repos/3scale/porta/milestones{/number}","notifications_url":"https://api.github.com/repos/3scale/porta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/3scale/porta/labels{/name}","releases_url":"https://api.github.com/repos/3scale/porta/releases{/id}","deployments_url":"https://api.github.com/repos/3scale/porta/deployments","created_at":"2018-09-18T16:03:13Z","updated_at":"2018-10-24T17:02:52Z","pushed_at":"2018-10-25T09:58:44Z","git_url":"git://github.com/3scale/porta.git","ssh_url":"git@github.com:3scale/porta.git","clone_url":"https://github.com/3scale/porta.git","svn_url":"https://github.com/3scale/porta","homepage":"","size":29261,"stargazers_count":10,"watchers_count":10,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":47,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":3,"open_issues":47,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/3scale/porta/pulls/238"},"html":{"href":"https://github.com/3scale/porta/pull/238"},"issue":{"href":"https://api.github.com/repos/3scale/porta/issues/238"},"comments":{"href":"https://api.github.com/repos/3scale/porta/issues/238/comments"},"review_comments":{"href":"https://api.github.com/repos/3scale/porta/pulls/238/comments"},"review_comment":{"href":"https://api.github.com/repos/3scale/porta/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/3scale/porta/pulls/238/commits"},"statuses":{"href":"https://api.github.com/repos/3scale/porta/statuses/33f89edace7d3f422d5d4129c7c148a4c85cba0d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"didierofrivia"}}