{"action":"created","comment":{"url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/comments/45327268","id":45327268,"diff_hunk":"@@ -148,105 +148,135 @@ var AppListComponent = React.createClass({\n     });\n   },\n \n-  getGroupedNodes: function (appsSequence) {\n-    var currentGroup = this.props.currentGroup;\n-\n-    return appsSequence\n-      .filter(app => app.id.startsWith(currentGroup))\n-      .reduce((memo, app) => {\n-        let relativePath = app.id.substring(currentGroup.length);\n-        let pathParts = relativePath.split(\"/\");\n-        let isGroup = pathParts.length > 1;\n-\n-        if (!isGroup) {\n-          memo.push(app);\n-        } else {\n-          let groupId = currentGroup + pathParts[0];\n-          let group = memo.find(item => {\n-            return item.id === groupId;\n-          });\n-\n-          if (group == null) {\n-            group = initGroupNode(groupId, app);\n-            memo.push(group);\n-          } else {\n-            updateGroupNode(group, app);\n-          }\n-        }\n-        return memo;\n-      }, []);\n+  hasFilters: function () {\n+    return Object.values(this.props.filters).some((filter) => {\n+      return (Util.isArray(filter) && filter.length > 0) ||\n+        (Util.isString(filter) && filter != null && filter !== \"\");\n+    });\n   },\n \n-  getAppNodes: function () {\n-    var state = this.state;\n-    var sortKey = state.sortKey;\n+  filterNodes: function (nodesSequence) {\n     var props = this.props;\n+    var currentGroup = props.currentGroup;\n+    var filters = props.filters;\n \n-    var appsSequence = lazy(state.apps);\n+    if (currentGroup !== \"/\") {\n+      nodesSequence = nodesSequence\n+        .filter(app => app.id.startsWith(currentGroup));\n+    }\n \n-    if (props.filterText != null && props.filterText !== \"\") {\n-      appsSequence = appsSequence\n+    if (filters.filterText != null && filters.filterText !== \"\") {\n+      nodesSequence = nodesSequence\n         .filter(function (app) {\n-          return app.id.indexOf(props.filterText) !== -1;\n+          return app.id.indexOf(filters.filterText) !== -1;\n         });\n     }\n \n-    if (props.filterLabels != null && props.filterLabels.length > 0) {\n-      appsSequence = appsSequence.filter(function (app) {\n+    if (filters.filterLabels != null && filters.filterLabels.length > 0) {\n+      nodesSequence = nodesSequence.filter(function (app) {\n         let labels = app.labels;\n         if (labels == null || Object.keys(labels).length === 0) {\n           return false;\n         }\n \n-        return lazy(props.filterLabels).some(function (label) {\n+        return lazy(filters.filterLabels).some(function (label) {\n           let [key, value] = label;\n           return labels[key] === value;\n         });\n       });\n     }\n \n-    if (props.filterStatus != null && props.filterStatus.length > 0) {\n-      appsSequence = appsSequence.filter(function (app) {\n+    if (filters.filterStatus != null && filters.filterStatus.length > 0) {","path":"src/js/components/AppListComponent.jsx","position":null,"original_position":108,"commit_id":"a02c71f6a15a11a2c9901fce2be0467081470d0f","original_commit_id":"c420822bb658e2fae7016370e22cea845a3b4517","user":{"login":"pierlo-upitup","id":1078545,"avatar_url":"https://avatars.githubusercontent.com/u/1078545?v=3","gravatar_id":"","url":"https://api.github.com/users/pierlo-upitup","html_url":"https://github.com/pierlo-upitup","followers_url":"https://api.github.com/users/pierlo-upitup/followers","following_url":"https://api.github.com/users/pierlo-upitup/following{/other_user}","gists_url":"https://api.github.com/users/pierlo-upitup/gists{/gist_id}","starred_url":"https://api.github.com/users/pierlo-upitup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierlo-upitup/subscriptions","organizations_url":"https://api.github.com/users/pierlo-upitup/orgs","repos_url":"https://api.github.com/users/pierlo-upitup/repos","events_url":"https://api.github.com/users/pierlo-upitup/events{/privacy}","received_events_url":"https://api.github.com/users/pierlo-upitup/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2015-11-19T11:06:51Z","updated_at":"2015-11-19T11:06:51Z","html_url":"https://github.com/mesosphere/marathon-ui/pull/403#discussion_r45327268","pull_request_url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/403","_links":{"self":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/comments/45327268"},"html":{"href":"https://github.com/mesosphere/marathon-ui/pull/403#discussion_r45327268"},"pull_request":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/403"}}},"pull_request":{"url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/403","id":51094072,"html_url":"https://github.com/mesosphere/marathon-ui/pull/403","diff_url":"https://github.com/mesosphere/marathon-ui/pull/403.diff","patch_url":"https://github.com/mesosphere/marathon-ui/pull/403.patch","issue_url":"https://api.github.com/repos/mesosphere/marathon-ui/issues/403","number":403,"state":"open","locked":false,"title":"Feature - 2664 adapt filter to global search","user":{"login":"aldipower","id":859154,"avatar_url":"https://avatars.githubusercontent.com/u/859154?v=3","gravatar_id":"","url":"https://api.github.com/users/aldipower","html_url":"https://github.com/aldipower","followers_url":"https://api.github.com/users/aldipower/followers","following_url":"https://api.github.com/users/aldipower/following{/other_user}","gists_url":"https://api.github.com/users/aldipower/gists{/gist_id}","starred_url":"https://api.github.com/users/aldipower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldipower/subscriptions","organizations_url":"https://api.github.com/users/aldipower/orgs","repos_url":"https://api.github.com/users/aldipower/repos","events_url":"https://api.github.com/users/aldipower/events{/privacy}","received_events_url":"https://api.github.com/users/aldipower/received_events","type":"User","site_admin":false},"body":"This closes https://github.com/mesosphere/marathon/issues/2664\r\n\r\nOn the root level with sidebar filters applied:\r\n![global-root](https://cloud.githubusercontent.com/assets/859154/11244199/8fd457d6-8e0c-11e5-8aaf-218c73643e38.png)\r\n\r\nInside a group \r\n![global-group](https://cloud.githubusercontent.com/assets/859154/11244206/9643b4b8-8e0c-11e5-8622-354b60015596.png)\r\n\r\nNext issues will follow to fulfill the complete global search feature branch.\r\n","created_at":"2015-11-18T14:56:00Z","updated_at":"2015-11-19T11:06:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"36d336fadb7de97be78f2a66bfe8424f2bf9860f","assignee":{"login":"pierlo-upitup","id":1078545,"avatar_url":"https://avatars.githubusercontent.com/u/1078545?v=3","gravatar_id":"","url":"https://api.github.com/users/pierlo-upitup","html_url":"https://github.com/pierlo-upitup","followers_url":"https://api.github.com/users/pierlo-upitup/followers","following_url":"https://api.github.com/users/pierlo-upitup/following{/other_user}","gists_url":"https://api.github.com/users/pierlo-upitup/gists{/gist_id}","starred_url":"https://api.github.com/users/pierlo-upitup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierlo-upitup/subscriptions","organizations_url":"https://api.github.com/users/pierlo-upitup/orgs","repos_url":"https://api.github.com/users/pierlo-upitup/repos","events_url":"https://api.github.com/users/pierlo-upitup/events{/privacy}","received_events_url":"https://api.github.com/users/pierlo-upitup/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/403/commits","review_comments_url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/403/comments","review_comment_url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mesosphere/marathon-ui/issues/403/comments","statuses_url":"https://api.github.com/repos/mesosphere/marathon-ui/statuses/a02c71f6a15a11a2c9901fce2be0467081470d0f","head":{"label":"mesosphere:feature/2664-adapt-filter-to-global-search","ref":"feature/2664-adapt-filter-to-global-search","sha":"a02c71f6a15a11a2c9901fce2be0467081470d0f","user":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":36859608,"name":"marathon-ui","full_name":"mesosphere/marathon-ui","owner":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/marathon-ui","description":"The web-ui for Marathon (https://github.com/mesosphere/marathon)","fork":false,"url":"https://api.github.com/repos/mesosphere/marathon-ui","forks_url":"https://api.github.com/repos/mesosphere/marathon-ui/forks","keys_url":"https://api.github.com/repos/mesosphere/marathon-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/marathon-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/marathon-ui/teams","hooks_url":"https://api.github.com/repos/mesosphere/marathon-ui/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/marathon-ui/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/marathon-ui/events","assignees_url":"https://api.github.com/repos/mesosphere/marathon-ui/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/marathon-ui/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/marathon-ui/tags","blobs_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/marathon-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/marathon-ui/languages","stargazers_url":"https://api.github.com/repos/mesosphere/marathon-ui/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/marathon-ui/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/marathon-ui/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/marathon-ui/subscription","commits_url":"https://api.github.com/repos/mesosphere/marathon-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/marathon-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/marathon-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/marathon-ui/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/marathon-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/marathon-ui/merges","archive_url":"https://api.github.com/repos/mesosphere/marathon-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/marathon-ui/downloads","issues_url":"https://api.github.com/repos/mesosphere/marathon-ui/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/marathon-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/marathon-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/marathon-ui/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/marathon-ui/releases{/id}","created_at":"2015-06-04T09:00:20Z","updated_at":"2015-11-06T07:15:49Z","pushed_at":"2015-11-19T10:34:43Z","git_url":"git://github.com/mesosphere/marathon-ui.git","ssh_url":"git@github.com:mesosphere/marathon-ui.git","clone_url":"https://github.com/mesosphere/marathon-ui.git","svn_url":"https://github.com/mesosphere/marathon-ui","homepage":"","size":8237,"stargazers_count":32,"watchers_count":32,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":7,"forks":17,"open_issues":7,"watchers":32,"default_branch":"master"}},"base":{"label":"mesosphere:feature/global-search","ref":"feature/global-search","sha":"af9264ca63c99714db8a2782b135a506d3c77a25","user":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":36859608,"name":"marathon-ui","full_name":"mesosphere/marathon-ui","owner":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/marathon-ui","description":"The web-ui for Marathon (https://github.com/mesosphere/marathon)","fork":false,"url":"https://api.github.com/repos/mesosphere/marathon-ui","forks_url":"https://api.github.com/repos/mesosphere/marathon-ui/forks","keys_url":"https://api.github.com/repos/mesosphere/marathon-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/marathon-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/marathon-ui/teams","hooks_url":"https://api.github.com/repos/mesosphere/marathon-ui/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/marathon-ui/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/marathon-ui/events","assignees_url":"https://api.github.com/repos/mesosphere/marathon-ui/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/marathon-ui/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/marathon-ui/tags","blobs_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/marathon-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/marathon-ui/languages","stargazers_url":"https://api.github.com/repos/mesosphere/marathon-ui/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/marathon-ui/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/marathon-ui/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/marathon-ui/subscription","commits_url":"https://api.github.com/repos/mesosphere/marathon-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/marathon-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/marathon-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/marathon-ui/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/marathon-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/marathon-ui/merges","archive_url":"https://api.github.com/repos/mesosphere/marathon-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/marathon-ui/downloads","issues_url":"https://api.github.com/repos/mesosphere/marathon-ui/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/marathon-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/marathon-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/marathon-ui/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/marathon-ui/releases{/id}","created_at":"2015-06-04T09:00:20Z","updated_at":"2015-11-06T07:15:49Z","pushed_at":"2015-11-19T10:34:43Z","git_url":"git://github.com/mesosphere/marathon-ui.git","ssh_url":"git@github.com:mesosphere/marathon-ui.git","clone_url":"https://github.com/mesosphere/marathon-ui.git","svn_url":"https://github.com/mesosphere/marathon-ui","homepage":"","size":8237,"stargazers_count":32,"watchers_count":32,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":7,"forks":17,"open_issues":7,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/403"},"html":{"href":"https://github.com/mesosphere/marathon-ui/pull/403"},"issue":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/issues/403"},"comments":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/issues/403/comments"},"review_comments":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/403/comments"},"review_comment":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/403/commits"},"statuses":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/statuses/a02c71f6a15a11a2c9901fce2be0467081470d0f"}}}}