{"action":"created","comment":{"url":"https://api.github.com/repos/NHS-digital-website/hippo/pulls/comments/165590702","pull_request_review_id":93555952,"id":165590702,"diff_hunk":"@@ -3,20 +3,45 @@\n import org.hippoecm.hst.core.component.HstRequest;\n import org.hippoecm.hst.core.component.HstResponse;\n import org.hippoecm.hst.site.HstServices;\n+import org.onehippo.taxonomy.api.Category;\n import org.onehippo.taxonomy.api.Taxonomy;\n import org.onehippo.taxonomy.api.TaxonomyManager;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n import uk.nhs.digital.ps.beans.HippoBeanHelper;\n \n+import java.util.Locale;\n+\n public class FacetComponent extends SearchComponent {\n+    private static Logger log = LoggerFactory.getLogger(FacetComponent.class);\n \n     @Override\n     public void doBeforeRender(HstRequest request, HstResponse response) {\n         TaxonomyManager taxonomyManager = HstServices.getComponentManager().getComponent(TaxonomyManager.class.getName());\n         Taxonomy taxonomy = taxonomyManager.getTaxonomies().getTaxonomy(HippoBeanHelper.getTaxonomyName());\n+        TaxonomyWrapper taxonomyWrapper = new TaxonomyWrapper(taxonomy);\n \n-        request.setAttribute(\"taxonomy\", taxonomy);\n+        request.setAttribute(\"taxonomy\", taxonomyWrapper);\n         request.setAttribute(\"query\", getQueryParameter(request));\n         request.setAttribute(\"facets\", getFacetNavigationBean(request));\n         request.setAttribute(\"cparam\", getComponentInfo(request)) ;\n     }\n+\n+    public class TaxonomyWrapper {\n+        private final Taxonomy taxonomy;\n+\n+        private TaxonomyWrapper(Taxonomy taxonomy) {\n+            this.taxonomy = taxonomy;\n+        }\n+\n+        public String getValueName(String key) {\n+            Category taxonomyCategory = taxonomy.getCategoryByKey(key);\n+            if (taxonomyCategory == null) {\n+                log.error(\"No taxonomy for key: \" + key);\n+                return \"Unknown Option: \" + key;","path":"site/src/main/java/uk/nhs/digital/common/components/FacetComponent.java","position":null,"original_position":40,"commit_id":"3899959509ab4151c11a45dae2dbf44d55f7a29d","original_commit_id":"ae72ce2b2dff2d66a55fb3db17008c66cd00bfd7","user":{"login":"jacsamell","id":33119300,"avatar_url":"https://avatars2.githubusercontent.com/u/33119300?v=4","gravatar_id":"","url":"https://api.github.com/users/jacsamell","html_url":"https://github.com/jacsamell","followers_url":"https://api.github.com/users/jacsamell/followers","following_url":"https://api.github.com/users/jacsamell/following{/other_user}","gists_url":"https://api.github.com/users/jacsamell/gists{/gist_id}","starred_url":"https://api.github.com/users/jacsamell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacsamell/subscriptions","organizations_url":"https://api.github.com/users/jacsamell/orgs","repos_url":"https://api.github.com/users/jacsamell/repos","events_url":"https://api.github.com/users/jacsamell/events{/privacy}","received_events_url":"https://api.github.com/users/jacsamell/received_events","type":"User","site_admin":false},"body":"Have updated after input from Karen, happy for it not be be pretty as it should only happen with bad data on test/uat and shouldn't ever happen on prod.","created_at":"2018-02-02T09:06:10Z","updated_at":"2018-02-02T09:06:10Z","html_url":"https://github.com/NHS-digital-website/hippo/pull/173#discussion_r165590702","pull_request_url":"https://api.github.com/repos/NHS-digital-website/hippo/pulls/173","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/NHS-digital-website/hippo/pulls/comments/165590702"},"html":{"href":"https://github.com/NHS-digital-website/hippo/pull/173#discussion_r165590702"},"pull_request":{"href":"https://api.github.com/repos/NHS-digital-website/hippo/pulls/173"}},"in_reply_to_id":165476917},"pull_request":{"url":"https://api.github.com/repos/NHS-digital-website/hippo/pulls/173","id":166606039,"html_url":"https://github.com/NHS-digital-website/hippo/pull/173","diff_url":"https://github.com/NHS-digital-website/hippo/pull/173.diff","patch_url":"https://github.com/NHS-digital-website/hippo/pull/173.patch","issue_url":"https://api.github.com/repos/NHS-digital-website/hippo/issues/173","number":173,"state":"open","locked":false,"title":"[RPS-350] Made Doc type facets consistent","user":{"login":"jacsamell","id":33119300,"avatar_url":"https://avatars2.githubusercontent.com/u/33119300?v=4","gravatar_id":"","url":"https://api.github.com/users/jacsamell","html_url":"https://github.com/jacsamell","followers_url":"https://api.github.com/users/jacsamell/followers","following_url":"https://api.github.com/users/jacsamell/following{/other_user}","gists_url":"https://api.github.com/users/jacsamell/gists{/gist_id}","starred_url":"https://api.github.com/users/jacsamell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacsamell/subscriptions","organizations_url":"https://api.github.com/users/jacsamell/orgs","repos_url":"https://api.github.com/users/jacsamell/repos","events_url":"https://api.github.com/users/jacsamell/events{/privacy}","received_events_url":"https://api.github.com/users/jacsamell/received_events","type":"User","site_admin":false},"body":"Made them use the configurable doc type labels.\r\nAlso fixed a bug where taxonomy terms would repeat if the\r\ntaxonomy key was invalid.","created_at":"2018-02-01T17:43:25Z","updated_at":"2018-02-02T09:06:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"08e6e3ce77f2b6c360304ff27b97124879aded1d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/NHS-digital-website/hippo/pulls/173/commits","review_comments_url":"https://api.github.com/repos/NHS-digital-website/hippo/pulls/173/comments","review_comment_url":"https://api.github.com/repos/NHS-digital-website/hippo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NHS-digital-website/hippo/issues/173/comments","statuses_url":"https://api.github.com/repos/NHS-digital-website/hippo/statuses/3899959509ab4151c11a45dae2dbf44d55f7a29d","head":{"label":"NHS-digital-website:RPS-350-doc-labels","ref":"RPS-350-doc-labels","sha":"3899959509ab4151c11a45dae2dbf44d55f7a29d","user":{"login":"NHS-digital-website","id":31284465,"avatar_url":"https://avatars1.githubusercontent.com/u/31284465?v=4","gravatar_id":"","url":"https://api.github.com/users/NHS-digital-website","html_url":"https://github.com/NHS-digital-website","followers_url":"https://api.github.com/users/NHS-digital-website/followers","following_url":"https://api.github.com/users/NHS-digital-website/following{/other_user}","gists_url":"https://api.github.com/users/NHS-digital-website/gists{/gist_id}","starred_url":"https://api.github.com/users/NHS-digital-website/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NHS-digital-website/subscriptions","organizations_url":"https://api.github.com/users/NHS-digital-website/orgs","repos_url":"https://api.github.com/users/NHS-digital-website/repos","events_url":"https://api.github.com/users/NHS-digital-website/events{/privacy}","received_events_url":"https://api.github.com/users/NHS-digital-website/received_events","type":"Organization","site_admin":false},"repo":{"id":104457155,"name":"hippo","full_name":"NHS-digital-website/hippo","owner":{"login":"NHS-digital-website","id":31284465,"avatar_url":"https://avatars1.githubusercontent.com/u/31284465?v=4","gravatar_id":"","url":"https://api.github.com/users/NHS-digital-website","html_url":"https://github.com/NHS-digital-website","followers_url":"https://api.github.com/users/NHS-digital-website/followers","following_url":"https://api.github.com/users/NHS-digital-website/following{/other_user}","gists_url":"https://api.github.com/users/NHS-digital-website/gists{/gist_id}","starred_url":"https://api.github.com/users/NHS-digital-website/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NHS-digital-website/subscriptions","organizations_url":"https://api.github.com/users/NHS-digital-website/orgs","repos_url":"https://api.github.com/users/NHS-digital-website/repos","events_url":"https://api.github.com/users/NHS-digital-website/events{/privacy}","received_events_url":"https://api.github.com/users/NHS-digital-website/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NHS-digital-website/hippo","description":"Hippo CMS","fork":false,"url":"https://api.github.com/repos/NHS-digital-website/hippo","forks_url":"https://api.github.com/repos/NHS-digital-website/hippo/forks","keys_url":"https://api.github.com/repos/NHS-digital-website/hippo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NHS-digital-website/hippo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NHS-digital-website/hippo/teams","hooks_url":"https://api.github.com/repos/NHS-digital-website/hippo/hooks","issue_events_url":"https://api.github.com/repos/NHS-digital-website/hippo/issues/events{/number}","events_url":"https://api.github.com/repos/NHS-digital-website/hippo/events","assignees_url":"https://api.github.com/repos/NHS-digital-website/hippo/assignees{/user}","branches_url":"https://api.github.com/repos/NHS-digital-website/hippo/branches{/branch}","tags_url":"https://api.github.com/repos/NHS-digital-website/hippo/tags","blobs_url":"https://api.github.com/repos/NHS-digital-website/hippo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NHS-digital-website/hippo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NHS-digital-website/hippo/git/refs{/sha}","trees_url":"https://api.github.com/repos/NHS-digital-website/hippo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NHS-digital-website/hippo/statuses/{sha}","languages_url":"https://api.github.com/repos/NHS-digital-website/hippo/languages","stargazers_url":"https://api.github.com/repos/NHS-digital-website/hippo/stargazers","contributors_url":"https://api.github.com/repos/NHS-digital-website/hippo/contributors","subscribers_url":"https://api.github.com/repos/NHS-digital-website/hippo/subscribers","subscription_url":"https://api.github.com/repos/NHS-digital-website/hippo/subscription","commits_url":"https://api.github.com/repos/NHS-digital-website/hippo/commits{/sha}","git_commits_url":"https://api.github.com/repos/NHS-digital-website/hippo/git/commits{/sha}","comments_url":"https://api.github.com/repos/NHS-digital-website/hippo/comments{/number}","issue_comment_url":"https://api.github.com/repos/NHS-digital-website/hippo/issues/comments{/number}","contents_url":"https://api.github.com/repos/NHS-digital-website/hippo/contents/{+path}","compare_url":"https://api.github.com/repos/NHS-digital-website/hippo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NHS-digital-website/hippo/merges","archive_url":"https://api.github.com/repos/NHS-digital-website/hippo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NHS-digital-website/hippo/downloads","issues_url":"https://api.github.com/repos/NHS-digital-website/hippo/issues{/number}","pulls_url":"https://api.github.com/repos/NHS-digital-website/hippo/pulls{/number}","milestones_url":"https://api.github.com/repos/NHS-digital-website/hippo/milestones{/number}","notifications_url":"https://api.github.com/repos/NHS-digital-website/hippo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NHS-digital-website/hippo/labels{/name}","releases_url":"https://api.github.com/repos/NHS-digital-website/hippo/releases{/id}","deployments_url":"https://api.github.com/repos/NHS-digital-website/hippo/deployments","created_at":"2017-09-22T09:29:54Z","updated_at":"2018-01-09T16:11:12Z","pushed_at":"2018-02-02T09:05:09Z","git_url":"git://github.com/NHS-digital-website/hippo.git","ssh_url":"git@github.com:NHS-digital-website/hippo.git","clone_url":"https://github.com/NHS-digital-website/hippo.git","svn_url":"https://github.com/NHS-digital-website/hippo","homepage":null,"size":4361,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"NHS-digital-website:master","ref":"master","sha":"98552b6dc65c9814631a50b2a4d2038a046c54b8","user":{"login":"NHS-digital-website","id":31284465,"avatar_url":"https://avatars1.githubusercontent.com/u/31284465?v=4","gravatar_id":"","url":"https://api.github.com/users/NHS-digital-website","html_url":"https://github.com/NHS-digital-website","followers_url":"https://api.github.com/users/NHS-digital-website/followers","following_url":"https://api.github.com/users/NHS-digital-website/following{/other_user}","gists_url":"https://api.github.com/users/NHS-digital-website/gists{/gist_id}","starred_url":"https://api.github.com/users/NHS-digital-website/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NHS-digital-website/subscriptions","organizations_url":"https://api.github.com/users/NHS-digital-website/orgs","repos_url":"https://api.github.com/users/NHS-digital-website/repos","events_url":"https://api.github.com/users/NHS-digital-website/events{/privacy}","received_events_url":"https://api.github.com/users/NHS-digital-website/received_events","type":"Organization","site_admin":false},"repo":{"id":104457155,"name":"hippo","full_name":"NHS-digital-website/hippo","owner":{"login":"NHS-digital-website","id":31284465,"avatar_url":"https://avatars1.githubusercontent.com/u/31284465?v=4","gravatar_id":"","url":"https://api.github.com/users/NHS-digital-website","html_url":"https://github.com/NHS-digital-website","followers_url":"https://api.github.com/users/NHS-digital-website/followers","following_url":"https://api.github.com/users/NHS-digital-website/following{/other_user}","gists_url":"https://api.github.com/users/NHS-digital-website/gists{/gist_id}","starred_url":"https://api.github.com/users/NHS-digital-website/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NHS-digital-website/subscriptions","organizations_url":"https://api.github.com/users/NHS-digital-website/orgs","repos_url":"https://api.github.com/users/NHS-digital-website/repos","events_url":"https://api.github.com/users/NHS-digital-website/events{/privacy}","received_events_url":"https://api.github.com/users/NHS-digital-website/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NHS-digital-website/hippo","description":"Hippo CMS","fork":false,"url":"https://api.github.com/repos/NHS-digital-website/hippo","forks_url":"https://api.github.com/repos/NHS-digital-website/hippo/forks","keys_url":"https://api.github.com/repos/NHS-digital-website/hippo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NHS-digital-website/hippo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NHS-digital-website/hippo/teams","hooks_url":"https://api.github.com/repos/NHS-digital-website/hippo/hooks","issue_events_url":"https://api.github.com/repos/NHS-digital-website/hippo/issues/events{/number}","events_url":"https://api.github.com/repos/NHS-digital-website/hippo/events","assignees_url":"https://api.github.com/repos/NHS-digital-website/hippo/assignees{/user}","branches_url":"https://api.github.com/repos/NHS-digital-website/hippo/branches{/branch}","tags_url":"https://api.github.com/repos/NHS-digital-website/hippo/tags","blobs_url":"https://api.github.com/repos/NHS-digital-website/hippo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NHS-digital-website/hippo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NHS-digital-website/hippo/git/refs{/sha}","trees_url":"https://api.github.com/repos/NHS-digital-website/hippo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NHS-digital-website/hippo/statuses/{sha}","languages_url":"https://api.github.com/repos/NHS-digital-website/hippo/languages","stargazers_url":"https://api.github.com/repos/NHS-digital-website/hippo/stargazers","contributors_url":"https://api.github.com/repos/NHS-digital-website/hippo/contributors","subscribers_url":"https://api.github.com/repos/NHS-digital-website/hippo/subscribers","subscription_url":"https://api.github.com/repos/NHS-digital-website/hippo/subscription","commits_url":"https://api.github.com/repos/NHS-digital-website/hippo/commits{/sha}","git_commits_url":"https://api.github.com/repos/NHS-digital-website/hippo/git/commits{/sha}","comments_url":"https://api.github.com/repos/NHS-digital-website/hippo/comments{/number}","issue_comment_url":"https://api.github.com/repos/NHS-digital-website/hippo/issues/comments{/number}","contents_url":"https://api.github.com/repos/NHS-digital-website/hippo/contents/{+path}","compare_url":"https://api.github.com/repos/NHS-digital-website/hippo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NHS-digital-website/hippo/merges","archive_url":"https://api.github.com/repos/NHS-digital-website/hippo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NHS-digital-website/hippo/downloads","issues_url":"https://api.github.com/repos/NHS-digital-website/hippo/issues{/number}","pulls_url":"https://api.github.com/repos/NHS-digital-website/hippo/pulls{/number}","milestones_url":"https://api.github.com/repos/NHS-digital-website/hippo/milestones{/number}","notifications_url":"https://api.github.com/repos/NHS-digital-website/hippo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NHS-digital-website/hippo/labels{/name}","releases_url":"https://api.github.com/repos/NHS-digital-website/hippo/releases{/id}","deployments_url":"https://api.github.com/repos/NHS-digital-website/hippo/deployments","created_at":"2017-09-22T09:29:54Z","updated_at":"2018-01-09T16:11:12Z","pushed_at":"2018-02-02T09:05:09Z","git_url":"git://github.com/NHS-digital-website/hippo.git","ssh_url":"git@github.com:NHS-digital-website/hippo.git","clone_url":"https://github.com/NHS-digital-website/hippo.git","svn_url":"https://github.com/NHS-digital-website/hippo","homepage":null,"size":4361,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NHS-digital-website/hippo/pulls/173"},"html":{"href":"https://github.com/NHS-digital-website/hippo/pull/173"},"issue":{"href":"https://api.github.com/repos/NHS-digital-website/hippo/issues/173"},"comments":{"href":"https://api.github.com/repos/NHS-digital-website/hippo/issues/173/comments"},"review_comments":{"href":"https://api.github.com/repos/NHS-digital-website/hippo/pulls/173/comments"},"review_comment":{"href":"https://api.github.com/repos/NHS-digital-website/hippo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NHS-digital-website/hippo/pulls/173/commits"},"statuses":{"href":"https://api.github.com/repos/NHS-digital-website/hippo/statuses/3899959509ab4151c11a45dae2dbf44d55f7a29d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jacsamell"}}