{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/content-data-admin/pulls/comments/231941785","pull_request_review_id":173025437,"id":231941785,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMTk0MTc4NQ==","diff_hunk":"@@ -1,31 +1,42 @@\n <%\n-    published_at ||= \"\"\n-    last_updated ||= \"\"\n-    publishing_organisation ||= \"\"\n-    document_type ||= \"\"\n-    base_path ||= \"\"\n-    status ||= \"\"\n+    published_at ||= nil\n+    last_updated ||= nil\n+    publishing_organisation ||= nil\n+    document_type ||= nil\n+    base_path ||= nil\n+    status ||= nil\n %>\n \n <div class=\"app-c-metadata govuk-body govuk-body-xs\">\n-  <% if status != \"\" %>\n+  <% if status %>\n     <dl class=\"app-c-metadata__list\">\n       <dt class=\"app-c-metadata__title\"><%= t \".labels.status\" %></dt>\n       <dd class=\"app-c-metadata__description govuk-!-font-weight-bold\"><%= status %></dd>\n     </dl>\n   <% end %>\n   <dl class=\"app-c-metadata__list\">\n-    <dt class=\"app-c-metadata__title\"><%= t \".labels.published_at\" %></dt>\n-    <dd class=\"app-c-metadata__description\"><%= published_at %></dd>\n-    <dt class=\"app-c-metadata__title\"><%= t \".labels.last_updated\" %></dt>\n-    <dd class=\"app-c-metadata__description\"><%= last_updated %></dd>\n+    <% if published_at %>\n+      <dt class=\"app-c-metadata__title\"><%= t \".labels.published_at\" %></dt>\n+      <dd class=\"app-c-metadata__description\"><%= published_at %></dd>\n+    <% end %>\n+    <% if last_updated %>\n+      <dt class=\"app-c-metadata__title\"><%= t \".labels.last_updated\" %></dt>\n+      <dd class=\"app-c-metadata__description\"><%= last_updated %></dd>\n+    <% end %>\n   </dl>\n   <dl class=\"app-c-metadata__list\">\n-    <dt class=\"app-c-metadata__title\"><%= t \".labels.publishing_organisation\" %></dt>\n-    <dd class=\"app-c-metadata__description\"><%= publishing_organisation %></dd>\n-    <dt class=\"app-c-metadata__title\"><%= t \".labels.document_type\" %></dt>\n-    <dd class=\"app-c-metadata__description\"><%= document_type %></dd>\n-    <dt class=\"app-c-metadata__title app-c-metadata__title--wrappable\"><%= t \".labels.base_path\" %></dt>\n-    <dd class=\"app-c-metadata__description\"><% if base_path != \"\" %>gov.uk<%= base_path %><% end %></dd>\n+    <% if publishing_organisation %>\n+      <dt class=\"app-c-metadata__title\"><%= t \".labels.publishing_organisation\" %></dt>\n+      <dd class=\"app-c-metadata__description\"><%= publishing_organisation %></dd>\n+    <% end %>\n+    <% if document_type %>\n+      <dt class=\"app-c-metadata__title\"><%= t \".labels.document_type\" %></dt>\n+      <dd class=\"app-c-metadata__description\"><%= document_type %></dd>\n+    <% end %>","path":"app/views/components/_metadata.html.erb","position":52,"original_position":52,"commit_id":"3620c62a16f7ba02a022ea23761d91f08aca3f8e","original_commit_id":"3620c62a16f7ba02a022ea23761d91f08aca3f8e","user":{"login":"cbaines","id":1130010,"node_id":"MDQ6VXNlcjExMzAwMTA=","avatar_url":"https://avatars1.githubusercontent.com/u/1130010?v=4","gravatar_id":"","url":"https://api.github.com/users/cbaines","html_url":"https://github.com/cbaines","followers_url":"https://api.github.com/users/cbaines/followers","following_url":"https://api.github.com/users/cbaines/following{/other_user}","gists_url":"https://api.github.com/users/cbaines/gists{/gist_id}","starred_url":"https://api.github.com/users/cbaines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbaines/subscriptions","organizations_url":"https://api.github.com/users/cbaines/orgs","repos_url":"https://api.github.com/users/cbaines/repos","events_url":"https://api.github.com/users/cbaines/events{/privacy}","received_events_url":"https://api.github.com/users/cbaines/received_events","type":"User","site_admin":false},"body":"Everything must have a document type, and I guess we display the document type for everything, so this conditional is probably unnecessary.","created_at":"2018-11-08T15:46:51Z","updated_at":"2018-11-08T15:46:51Z","html_url":"https://github.com/alphagov/content-data-admin/pull/192#discussion_r231941785","pull_request_url":"https://api.github.com/repos/alphagov/content-data-admin/pulls/192","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/alphagov/content-data-admin/pulls/comments/231941785"},"html":{"href":"https://github.com/alphagov/content-data-admin/pull/192#discussion_r231941785"},"pull_request":{"href":"https://api.github.com/repos/alphagov/content-data-admin/pulls/192"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/content-data-admin/pulls/192","id":229404788,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5NDA0Nzg4","html_url":"https://github.com/alphagov/content-data-admin/pull/192","diff_url":"https://github.com/alphagov/content-data-admin/pull/192.diff","patch_url":"https://github.com/alphagov/content-data-admin/pull/192.patch","issue_url":"https://api.github.com/repos/alphagov/content-data-admin/issues/192","number":192,"state":"open","locked":false,"title":"Guard against missing data to avoid layout breaking","user":{"login":"maxgds","id":31649453,"node_id":"MDQ6VXNlcjMxNjQ5NDUz","avatar_url":"https://avatars0.githubusercontent.com/u/31649453?v=4","gravatar_id":"","url":"https://api.github.com/users/maxgds","html_url":"https://github.com/maxgds","followers_url":"https://api.github.com/users/maxgds/followers","following_url":"https://api.github.com/users/maxgds/following{/other_user}","gists_url":"https://api.github.com/users/maxgds/gists{/gist_id}","starred_url":"https://api.github.com/users/maxgds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxgds/subscriptions","organizations_url":"https://api.github.com/users/maxgds/orgs","repos_url":"https://api.github.com/users/maxgds/repos","events_url":"https://api.github.com/users/maxgds/events{/privacy}","received_events_url":"https://api.github.com/users/maxgds/received_events","type":"User","site_admin":false},"body":"# What\r\nhttps://trello.com/c/eJtCoZ3g/826-page-data-fix-formatting-of-metadata-when-we-have-no-value-for-primary-publishing-organisation\r\nGuards against empty metadata items and renders nothing for blank fields\r\n\r\n# Why\r\nLayout currently breaks when the value is empty\r\n\r\n# Screenshots\r\n\r\n## Before\r\n![screen shot 2018-11-08 at 15 25 02](https://user-images.githubusercontent.com/31649453/48208455-bb1bcd00-e36a-11e8-88c9-990b1eb5356b.png)\r\n\r\n## After\r\n\r\n![screen shot 2018-11-08 at 15 25 18](https://user-images.githubusercontent.com/31649453/48208484-d2f35100-e36a-11e8-8da4-51fefe28e5ec.png)\r\n","created_at":"2018-11-08T15:28:40Z","updated_at":"2018-11-08T15:46:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"80cce1b5d0da9b7a8b5e02b1c6a07190a8794f6c","assignee":null,"assignees":[],"requested_reviewers":[{"login":"pmanrubia","id":227328,"node_id":"MDQ6VXNlcjIyNzMyOA==","avatar_url":"https://avatars2.githubusercontent.com/u/227328?v=4","gravatar_id":"","url":"https://api.github.com/users/pmanrubia","html_url":"https://github.com/pmanrubia","followers_url":"https://api.github.com/users/pmanrubia/followers","following_url":"https://api.github.com/users/pmanrubia/following{/other_user}","gists_url":"https://api.github.com/users/pmanrubia/gists{/gist_id}","starred_url":"https://api.github.com/users/pmanrubia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmanrubia/subscriptions","organizations_url":"https://api.github.com/users/pmanrubia/orgs","repos_url":"https://api.github.com/users/pmanrubia/repos","events_url":"https://api.github.com/users/pmanrubia/events{/privacy}","received_events_url":"https://api.github.com/users/pmanrubia/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/content-data-admin/pulls/192/commits","review_comments_url":"https://api.github.com/repos/alphagov/content-data-admin/pulls/192/comments","review_comment_url":"https://api.github.com/repos/alphagov/content-data-admin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/content-data-admin/issues/192/comments","statuses_url":"https://api.github.com/repos/alphagov/content-data-admin/statuses/3620c62a16f7ba02a022ea23761d91f08aca3f8e","head":{"label":"alphagov:fix-metadata","ref":"fix-metadata","sha":"3620c62a16f7ba02a022ea23761d91f08aca3f8e","user":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":142429907,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI0Mjk5MDc=","name":"content-data-admin","full_name":"alphagov/content-data-admin","private":false,"owner":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/alphagov/content-data-admin","description":"A front end for the data warehouse","fork":false,"url":"https://api.github.com/repos/alphagov/content-data-admin","forks_url":"https://api.github.com/repos/alphagov/content-data-admin/forks","keys_url":"https://api.github.com/repos/alphagov/content-data-admin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/content-data-admin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/content-data-admin/teams","hooks_url":"https://api.github.com/repos/alphagov/content-data-admin/hooks","issue_events_url":"https://api.github.com/repos/alphagov/content-data-admin/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/content-data-admin/events","assignees_url":"https://api.github.com/repos/alphagov/content-data-admin/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/content-data-admin/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/content-data-admin/tags","blobs_url":"https://api.github.com/repos/alphagov/content-data-admin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/content-data-admin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/content-data-admin/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/content-data-admin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/content-data-admin/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/content-data-admin/languages","stargazers_url":"https://api.github.com/repos/alphagov/content-data-admin/stargazers","contributors_url":"https://api.github.com/repos/alphagov/content-data-admin/contributors","subscribers_url":"https://api.github.com/repos/alphagov/content-data-admin/subscribers","subscription_url":"https://api.github.com/repos/alphagov/content-data-admin/subscription","commits_url":"https://api.github.com/repos/alphagov/content-data-admin/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/content-data-admin/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/content-data-admin/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/content-data-admin/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/content-data-admin/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/content-data-admin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/content-data-admin/merges","archive_url":"https://api.github.com/repos/alphagov/content-data-admin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/content-data-admin/downloads","issues_url":"https://api.github.com/repos/alphagov/content-data-admin/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/content-data-admin/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/content-data-admin/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/content-data-admin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/content-data-admin/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/content-data-admin/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/content-data-admin/deployments","created_at":"2018-07-26T11:09:09Z","updated_at":"2018-11-08T14:07:07Z","pushed_at":"2018-11-08T15:28:41Z","git_url":"git://github.com/alphagov/content-data-admin.git","ssh_url":"git@github.com:alphagov/content-data-admin.git","clone_url":"https://github.com/alphagov/content-data-admin.git","svn_url":"https://github.com/alphagov/content-data-admin","homepage":"https://docs.publishing.service.gov.uk/apps/content-data-admin.html","size":670,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"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","node_id":"MDc6TGljZW5zZTEz"},"forks":2,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"de09a8ea647ed8e61ea3c2bf88c699370b61ce48","user":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":142429907,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI0Mjk5MDc=","name":"content-data-admin","full_name":"alphagov/content-data-admin","private":false,"owner":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/alphagov/content-data-admin","description":"A front end for the data warehouse","fork":false,"url":"https://api.github.com/repos/alphagov/content-data-admin","forks_url":"https://api.github.com/repos/alphagov/content-data-admin/forks","keys_url":"https://api.github.com/repos/alphagov/content-data-admin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/content-data-admin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/content-data-admin/teams","hooks_url":"https://api.github.com/repos/alphagov/content-data-admin/hooks","issue_events_url":"https://api.github.com/repos/alphagov/content-data-admin/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/content-data-admin/events","assignees_url":"https://api.github.com/repos/alphagov/content-data-admin/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/content-data-admin/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/content-data-admin/tags","blobs_url":"https://api.github.com/repos/alphagov/content-data-admin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/content-data-admin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/content-data-admin/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/content-data-admin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/content-data-admin/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/content-data-admin/languages","stargazers_url":"https://api.github.com/repos/alphagov/content-data-admin/stargazers","contributors_url":"https://api.github.com/repos/alphagov/content-data-admin/contributors","subscribers_url":"https://api.github.com/repos/alphagov/content-data-admin/subscribers","subscription_url":"https://api.github.com/repos/alphagov/content-data-admin/subscription","commits_url":"https://api.github.com/repos/alphagov/content-data-admin/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/content-data-admin/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/content-data-admin/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/content-data-admin/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/content-data-admin/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/content-data-admin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/content-data-admin/merges","archive_url":"https://api.github.com/repos/alphagov/content-data-admin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/content-data-admin/downloads","issues_url":"https://api.github.com/repos/alphagov/content-data-admin/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/content-data-admin/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/content-data-admin/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/content-data-admin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/content-data-admin/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/content-data-admin/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/content-data-admin/deployments","created_at":"2018-07-26T11:09:09Z","updated_at":"2018-11-08T14:07:07Z","pushed_at":"2018-11-08T15:28:41Z","git_url":"git://github.com/alphagov/content-data-admin.git","ssh_url":"git@github.com:alphagov/content-data-admin.git","clone_url":"https://github.com/alphagov/content-data-admin.git","svn_url":"https://github.com/alphagov/content-data-admin","homepage":"https://docs.publishing.service.gov.uk/apps/content-data-admin.html","size":670,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"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","node_id":"MDc6TGljZW5zZTEz"},"forks":2,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/content-data-admin/pulls/192"},"html":{"href":"https://github.com/alphagov/content-data-admin/pull/192"},"issue":{"href":"https://api.github.com/repos/alphagov/content-data-admin/issues/192"},"comments":{"href":"https://api.github.com/repos/alphagov/content-data-admin/issues/192/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/content-data-admin/pulls/192/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/content-data-admin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/content-data-admin/pulls/192/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/content-data-admin/statuses/3620c62a16f7ba02a022ea23761d91f08aca3f8e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"cbaines"}}