{"action":"created","comment":{"url":"https://api.github.com/repos/superdesk/superdesk/pulls/comments/30697590","id":30697590,"diff_hunk":"@@ -1020,6 +1026,62 @@\n                             }, 0, false);\n                         });\n                     });\n+\n+                    metadata.fetchSubjectcodes().then(function () {\n+                        scope.subjectcodes = metadata.values.subjectcodes;\n+                        tags.initSelectedFacets().then(function (currentTags) {\n+                            scope.subjectitems = {\n+                                subject: getSubjectCodes(currentTags)\n+                            };\n+                        });\n+                    });\n+\n+                    function getSubjectCodes(currentTags) {\n+                        var queryArray = currentTags.selectedParameters, filteredArray = [];\n+                        if (!$location.search().q) {\n+                            return filteredArray;\n+                        }\n+                        for (var i = 0, queryArrayLength = queryArray.length; i < queryArrayLength; i++) {\n+                            var queryArrayElement = queryArray[i];\n+                            if (queryArrayElement.indexOf('subject.name') !== -1) {\n+                                var elementName = queryArrayElement.substring(\n+                                        queryArrayElement.lastIndexOf('(') + 1,\n+                                        queryArrayElement.lastIndexOf(')')\n+                                        );\n+                                for (var j = 0, subjectCodesLenght = scope.subjectcodes.length; j < subjectCodesLenght; j++) {","path":"client/app/scripts/superdesk-search/search.js","position":78,"original_position":78,"commit_id":"5252a7bcbdba0bb735bebe04196eda11a6015494","original_commit_id":"5252a7bcbdba0bb735bebe04196eda11a6015494","user":{"login":"plamut","id":1235663,"avatar_url":"https://avatars.githubusercontent.com/u/1235663?v=3","gravatar_id":"","url":"https://api.github.com/users/plamut","html_url":"https://github.com/plamut","followers_url":"https://api.github.com/users/plamut/followers","following_url":"https://api.github.com/users/plamut/following{/other_user}","gists_url":"https://api.github.com/users/plamut/gists{/gist_id}","starred_url":"https://api.github.com/users/plamut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plamut/subscriptions","organizations_url":"https://api.github.com/users/plamut/orgs","repos_url":"https://api.github.com/users/plamut/repos","events_url":"https://api.github.com/users/plamut/events{/privacy}","received_events_url":"https://api.github.com/users/plamut/received_events","type":"User","site_admin":false},"body":"\"lenght\" is spelled \"l-e-n-g-t-h\" :wink: (seen it at a couple of places).\r\n\r\n(don't need to change the PR just because of this, though, only consider changing it, if you need to apply some other changes as well)","created_at":"2015-05-20T12:54:40Z","updated_at":"2015-05-20T12:54:40Z","html_url":"https://github.com/superdesk/superdesk/pull/616#discussion_r30697590","pull_request_url":"https://api.github.com/repos/superdesk/superdesk/pulls/616","_links":{"self":{"href":"https://api.github.com/repos/superdesk/superdesk/pulls/comments/30697590"},"html":{"href":"https://github.com/superdesk/superdesk/pull/616#discussion_r30697590"},"pull_request":{"href":"https://api.github.com/repos/superdesk/superdesk/pulls/616"}}},"pull_request":{"url":"https://api.github.com/repos/superdesk/superdesk/pulls/616","id":35827059,"html_url":"https://github.com/superdesk/superdesk/pull/616","diff_url":"https://github.com/superdesk/superdesk/pull/616.diff","patch_url":"https://github.com/superdesk/superdesk/pull/616.patch","issue_url":"https://api.github.com/repos/superdesk/superdesk/issues/616","number":616,"state":"open","locked":false,"title":"feat(iptc search): Integrate structure on search panel","user":{"login":"pavlovicnemanja92","id":6507688,"avatar_url":"https://avatars.githubusercontent.com/u/6507688?v=3","gravatar_id":"","url":"https://api.github.com/users/pavlovicnemanja92","html_url":"https://github.com/pavlovicnemanja92","followers_url":"https://api.github.com/users/pavlovicnemanja92/followers","following_url":"https://api.github.com/users/pavlovicnemanja92/following{/other_user}","gists_url":"https://api.github.com/users/pavlovicnemanja92/gists{/gist_id}","starred_url":"https://api.github.com/users/pavlovicnemanja92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavlovicnemanja92/subscriptions","organizations_url":"https://api.github.com/users/pavlovicnemanja92/orgs","repos_url":"https://api.github.com/users/pavlovicnemanja92/repos","events_url":"https://api.github.com/users/pavlovicnemanja92/events{/privacy}","received_events_url":"https://api.github.com/users/pavlovicnemanja92/received_events","type":"User","site_admin":false},"body":"SD-2254","created_at":"2015-05-20T12:39:25Z","updated_at":"2015-05-20T12:54:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2850e4d0a0563a53e435334cb0df3143322fb4fc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/superdesk/superdesk/pulls/616/commits","review_comments_url":"https://api.github.com/repos/superdesk/superdesk/pulls/616/comments","review_comment_url":"https://api.github.com/repos/superdesk/superdesk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/superdesk/superdesk/issues/616/comments","statuses_url":"https://api.github.com/repos/superdesk/superdesk/statuses/5252a7bcbdba0bb735bebe04196eda11a6015494","head":{"label":"pavlovicnemanja92:iptcSearch","ref":"iptcSearch","sha":"5252a7bcbdba0bb735bebe04196eda11a6015494","user":{"login":"pavlovicnemanja92","id":6507688,"avatar_url":"https://avatars.githubusercontent.com/u/6507688?v=3","gravatar_id":"","url":"https://api.github.com/users/pavlovicnemanja92","html_url":"https://github.com/pavlovicnemanja92","followers_url":"https://api.github.com/users/pavlovicnemanja92/followers","following_url":"https://api.github.com/users/pavlovicnemanja92/following{/other_user}","gists_url":"https://api.github.com/users/pavlovicnemanja92/gists{/gist_id}","starred_url":"https://api.github.com/users/pavlovicnemanja92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavlovicnemanja92/subscriptions","organizations_url":"https://api.github.com/users/pavlovicnemanja92/orgs","repos_url":"https://api.github.com/users/pavlovicnemanja92/repos","events_url":"https://api.github.com/users/pavlovicnemanja92/events{/privacy}","received_events_url":"https://api.github.com/users/pavlovicnemanja92/received_events","type":"User","site_admin":false},"repo":{"id":33980379,"name":"superdesk","full_name":"pavlovicnemanja92/superdesk","owner":{"login":"pavlovicnemanja92","id":6507688,"avatar_url":"https://avatars.githubusercontent.com/u/6507688?v=3","gravatar_id":"","url":"https://api.github.com/users/pavlovicnemanja92","html_url":"https://github.com/pavlovicnemanja92","followers_url":"https://api.github.com/users/pavlovicnemanja92/followers","following_url":"https://api.github.com/users/pavlovicnemanja92/following{/other_user}","gists_url":"https://api.github.com/users/pavlovicnemanja92/gists{/gist_id}","starred_url":"https://api.github.com/users/pavlovicnemanja92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavlovicnemanja92/subscriptions","organizations_url":"https://api.github.com/users/pavlovicnemanja92/orgs","repos_url":"https://api.github.com/users/pavlovicnemanja92/repos","events_url":"https://api.github.com/users/pavlovicnemanja92/events{/privacy}","received_events_url":"https://api.github.com/users/pavlovicnemanja92/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pavlovicnemanja92/superdesk","description":"The open source end-to-end news platform.","fork":true,"url":"https://api.github.com/repos/pavlovicnemanja92/superdesk","forks_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/forks","keys_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/teams","hooks_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/hooks","issue_events_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/issues/events{/number}","events_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/events","assignees_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/assignees{/user}","branches_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/branches{/branch}","tags_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/tags","blobs_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/git/refs{/sha}","trees_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/statuses/{sha}","languages_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/languages","stargazers_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/stargazers","contributors_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/contributors","subscribers_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/subscribers","subscription_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/subscription","commits_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/commits{/sha}","git_commits_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/git/commits{/sha}","comments_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/comments{/number}","issue_comment_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/issues/comments{/number}","contents_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/contents/{+path}","compare_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/merges","archive_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/downloads","issues_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/issues{/number}","pulls_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/pulls{/number}","milestones_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/milestones{/number}","notifications_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/labels{/name}","releases_url":"https://api.github.com/repos/pavlovicnemanja92/superdesk/releases{/id}","created_at":"2015-04-15T07:47:43Z","updated_at":"2015-05-06T08:14:50Z","pushed_at":"2015-05-20T12:41:34Z","git_url":"git://github.com/pavlovicnemanja92/superdesk.git","ssh_url":"git@github.com:pavlovicnemanja92/superdesk.git","clone_url":"https://github.com/pavlovicnemanja92/superdesk.git","svn_url":"https://github.com/pavlovicnemanja92/superdesk","homepage":"","size":51364,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"superdesk:master","ref":"master","sha":"279e1dc7932cba516126eea5a2a553bdb951f148","user":{"login":"superdesk","id":5527298,"avatar_url":"https://avatars.githubusercontent.com/u/5527298?v=3","gravatar_id":"","url":"https://api.github.com/users/superdesk","html_url":"https://github.com/superdesk","followers_url":"https://api.github.com/users/superdesk/followers","following_url":"https://api.github.com/users/superdesk/following{/other_user}","gists_url":"https://api.github.com/users/superdesk/gists{/gist_id}","starred_url":"https://api.github.com/users/superdesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superdesk/subscriptions","organizations_url":"https://api.github.com/users/superdesk/orgs","repos_url":"https://api.github.com/users/superdesk/repos","events_url":"https://api.github.com/users/superdesk/events{/privacy}","received_events_url":"https://api.github.com/users/superdesk/received_events","type":"Organization","site_admin":false},"repo":{"id":23570030,"name":"superdesk","full_name":"superdesk/superdesk","owner":{"login":"superdesk","id":5527298,"avatar_url":"https://avatars.githubusercontent.com/u/5527298?v=3","gravatar_id":"","url":"https://api.github.com/users/superdesk","html_url":"https://github.com/superdesk","followers_url":"https://api.github.com/users/superdesk/followers","following_url":"https://api.github.com/users/superdesk/following{/other_user}","gists_url":"https://api.github.com/users/superdesk/gists{/gist_id}","starred_url":"https://api.github.com/users/superdesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superdesk/subscriptions","organizations_url":"https://api.github.com/users/superdesk/orgs","repos_url":"https://api.github.com/users/superdesk/repos","events_url":"https://api.github.com/users/superdesk/events{/privacy}","received_events_url":"https://api.github.com/users/superdesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/superdesk/superdesk","description":"The open source end-to-end news platform.","fork":false,"url":"https://api.github.com/repos/superdesk/superdesk","forks_url":"https://api.github.com/repos/superdesk/superdesk/forks","keys_url":"https://api.github.com/repos/superdesk/superdesk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/superdesk/superdesk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/superdesk/superdesk/teams","hooks_url":"https://api.github.com/repos/superdesk/superdesk/hooks","issue_events_url":"https://api.github.com/repos/superdesk/superdesk/issues/events{/number}","events_url":"https://api.github.com/repos/superdesk/superdesk/events","assignees_url":"https://api.github.com/repos/superdesk/superdesk/assignees{/user}","branches_url":"https://api.github.com/repos/superdesk/superdesk/branches{/branch}","tags_url":"https://api.github.com/repos/superdesk/superdesk/tags","blobs_url":"https://api.github.com/repos/superdesk/superdesk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/superdesk/superdesk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/superdesk/superdesk/git/refs{/sha}","trees_url":"https://api.github.com/repos/superdesk/superdesk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/superdesk/superdesk/statuses/{sha}","languages_url":"https://api.github.com/repos/superdesk/superdesk/languages","stargazers_url":"https://api.github.com/repos/superdesk/superdesk/stargazers","contributors_url":"https://api.github.com/repos/superdesk/superdesk/contributors","subscribers_url":"https://api.github.com/repos/superdesk/superdesk/subscribers","subscription_url":"https://api.github.com/repos/superdesk/superdesk/subscription","commits_url":"https://api.github.com/repos/superdesk/superdesk/commits{/sha}","git_commits_url":"https://api.github.com/repos/superdesk/superdesk/git/commits{/sha}","comments_url":"https://api.github.com/repos/superdesk/superdesk/comments{/number}","issue_comment_url":"https://api.github.com/repos/superdesk/superdesk/issues/comments{/number}","contents_url":"https://api.github.com/repos/superdesk/superdesk/contents/{+path}","compare_url":"https://api.github.com/repos/superdesk/superdesk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/superdesk/superdesk/merges","archive_url":"https://api.github.com/repos/superdesk/superdesk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/superdesk/superdesk/downloads","issues_url":"https://api.github.com/repos/superdesk/superdesk/issues{/number}","pulls_url":"https://api.github.com/repos/superdesk/superdesk/pulls{/number}","milestones_url":"https://api.github.com/repos/superdesk/superdesk/milestones{/number}","notifications_url":"https://api.github.com/repos/superdesk/superdesk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/superdesk/superdesk/labels{/name}","releases_url":"https://api.github.com/repos/superdesk/superdesk/releases{/id}","created_at":"2014-09-02T07:56:17Z","updated_at":"2015-05-19T12:15:40Z","pushed_at":"2015-05-20T12:39:25Z","git_url":"git://github.com/superdesk/superdesk.git","ssh_url":"git@github.com:superdesk/superdesk.git","clone_url":"https://github.com/superdesk/superdesk.git","svn_url":"https://github.com/superdesk/superdesk","homepage":"","size":62586,"stargazers_count":12,"watchers_count":12,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":8,"forks":28,"open_issues":8,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/superdesk/superdesk/pulls/616"},"html":{"href":"https://github.com/superdesk/superdesk/pull/616"},"issue":{"href":"https://api.github.com/repos/superdesk/superdesk/issues/616"},"comments":{"href":"https://api.github.com/repos/superdesk/superdesk/issues/616/comments"},"review_comments":{"href":"https://api.github.com/repos/superdesk/superdesk/pulls/616/comments"},"review_comment":{"href":"https://api.github.com/repos/superdesk/superdesk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/superdesk/superdesk/pulls/616/commits"},"statuses":{"href":"https://api.github.com/repos/superdesk/superdesk/statuses/5252a7bcbdba0bb735bebe04196eda11a6015494"}}}}