{"action":"opened","number":974,"pull_request":{"url":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/974","id":153693164,"html_url":"https://github.com/uktrade/data-hub-frontend/pull/974","diff_url":"https://github.com/uktrade/data-hub-frontend/pull/974.diff","patch_url":"https://github.com/uktrade/data-hub-frontend/pull/974.patch","issue_url":"https://api.github.com/repos/uktrade/data-hub-frontend/issues/974","number":974,"state":"open","locked":false,"title":"Handle *_id fields when converting field names to labels in audit log","user":{"login":"richtier","id":5485798,"avatar_url":"https://avatars0.githubusercontent.com/u/5485798?v=4","gravatar_id":"","url":"https://api.github.com/users/richtier","html_url":"https://github.com/richtier","followers_url":"https://api.github.com/users/richtier/followers","following_url":"https://api.github.com/users/richtier/following{/other_user}","gists_url":"https://api.github.com/users/richtier/gists{/gist_id}","starred_url":"https://api.github.com/users/richtier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richtier/subscriptions","organizations_url":"https://api.github.com/users/richtier/orgs","repos_url":"https://api.github.com/users/richtier/repos","events_url":"https://api.github.com/users/richtier/events{/privacy}","received_events_url":"https://api.github.com/users/richtier/received_events","type":"User","site_admin":false},"body":"The `labels.js` files are not expecting a few fields that end with `_id`, meaning users are shown the field name instead of the label in audfit pages. Note `labels.js` expects `\"account_manager\"` but not `\"account_manager_id\"`\r\n\r\nThis change handles that by removing `_id` from the field name during the label lookup, but it might be better to update `labels.js` so `account_manager` becomes `account_manager_id` - but I'm not sure because:\r\n - there may be backwards compatibility issues as field names changed over time\r\n - I don't know enough about the backend to know which fields should end in an `_id`.\r\n\r\nthoughts @ztolley @teneightfive @feedmypixel ?\r\n\r\n## after the change\r\n![image](https://user-images.githubusercontent.com/5485798/33032875-7543f30e-ce1a-11e7-9b2f-3b58fc9c2f00.png)\r\n\r\n## before the chage\r\n![image](https://user-images.githubusercontent.com/5485798/33032431-21f43b4c-ce19-11e7-8ad6-2574e4c79512.png)\r\n","created_at":"2017-11-20T17:44:35Z","updated_at":"2017-11-20T17:44:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/974/commits","review_comments_url":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/974/comments","review_comment_url":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uktrade/data-hub-frontend/issues/974/comments","statuses_url":"https://api.github.com/repos/uktrade/data-hub-frontend/statuses/d1cd557e648dc8fe415ee07880a1168993813c96","head":{"label":"uktrade:DH-1192-audit-history-field-names","ref":"DH-1192-audit-history-field-names","sha":"d1cd557e648dc8fe415ee07880a1168993813c96","user":{"login":"uktrade","id":15107524,"avatar_url":"https://avatars2.githubusercontent.com/u/15107524?v=4","gravatar_id":"","url":"https://api.github.com/users/uktrade","html_url":"https://github.com/uktrade","followers_url":"https://api.github.com/users/uktrade/followers","following_url":"https://api.github.com/users/uktrade/following{/other_user}","gists_url":"https://api.github.com/users/uktrade/gists{/gist_id}","starred_url":"https://api.github.com/users/uktrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uktrade/subscriptions","organizations_url":"https://api.github.com/users/uktrade/orgs","repos_url":"https://api.github.com/users/uktrade/repos","events_url":"https://api.github.com/users/uktrade/events{/privacy}","received_events_url":"https://api.github.com/users/uktrade/received_events","type":"Organization","site_admin":false},"repo":{"id":83823675,"name":"data-hub-frontend","full_name":"uktrade/data-hub-frontend","owner":{"login":"uktrade","id":15107524,"avatar_url":"https://avatars2.githubusercontent.com/u/15107524?v=4","gravatar_id":"","url":"https://api.github.com/users/uktrade","html_url":"https://github.com/uktrade","followers_url":"https://api.github.com/users/uktrade/followers","following_url":"https://api.github.com/users/uktrade/following{/other_user}","gists_url":"https://api.github.com/users/uktrade/gists{/gist_id}","starred_url":"https://api.github.com/users/uktrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uktrade/subscriptions","organizations_url":"https://api.github.com/users/uktrade/orgs","repos_url":"https://api.github.com/users/uktrade/repos","events_url":"https://api.github.com/users/uktrade/events{/privacy}","received_events_url":"https://api.github.com/users/uktrade/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uktrade/data-hub-frontend","description":"The frontend rendering application for Data Hub","fork":false,"url":"https://api.github.com/repos/uktrade/data-hub-frontend","forks_url":"https://api.github.com/repos/uktrade/data-hub-frontend/forks","keys_url":"https://api.github.com/repos/uktrade/data-hub-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uktrade/data-hub-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uktrade/data-hub-frontend/teams","hooks_url":"https://api.github.com/repos/uktrade/data-hub-frontend/hooks","issue_events_url":"https://api.github.com/repos/uktrade/data-hub-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/uktrade/data-hub-frontend/events","assignees_url":"https://api.github.com/repos/uktrade/data-hub-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/uktrade/data-hub-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/uktrade/data-hub-frontend/tags","blobs_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uktrade/data-hub-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/uktrade/data-hub-frontend/languages","stargazers_url":"https://api.github.com/repos/uktrade/data-hub-frontend/stargazers","contributors_url":"https://api.github.com/repos/uktrade/data-hub-frontend/contributors","subscribers_url":"https://api.github.com/repos/uktrade/data-hub-frontend/subscribers","subscription_url":"https://api.github.com/repos/uktrade/data-hub-frontend/subscription","commits_url":"https://api.github.com/repos/uktrade/data-hub-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/uktrade/data-hub-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/uktrade/data-hub-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/uktrade/data-hub-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/uktrade/data-hub-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uktrade/data-hub-frontend/merges","archive_url":"https://api.github.com/repos/uktrade/data-hub-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uktrade/data-hub-frontend/downloads","issues_url":"https://api.github.com/repos/uktrade/data-hub-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/uktrade/data-hub-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/uktrade/data-hub-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uktrade/data-hub-frontend/labels{/name}","releases_url":"https://api.github.com/repos/uktrade/data-hub-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/uktrade/data-hub-frontend/deployments","created_at":"2017-03-03T17:26:35Z","updated_at":"2017-08-16T08:31:47Z","pushed_at":"2017-11-20T17:33:59Z","git_url":"git://github.com/uktrade/data-hub-frontend.git","ssh_url":"git@github.com:uktrade/data-hub-frontend.git","clone_url":"https://github.com/uktrade/data-hub-frontend.git","svn_url":"https://github.com/uktrade/data-hub-frontend","homepage":"","size":3789,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":27,"forks":1,"open_issues":27,"watchers":0,"default_branch":"develop"}},"base":{"label":"uktrade:develop","ref":"develop","sha":"1b7ed2ce2b11cfa13bdeb60b92d29f69d67843a9","user":{"login":"uktrade","id":15107524,"avatar_url":"https://avatars2.githubusercontent.com/u/15107524?v=4","gravatar_id":"","url":"https://api.github.com/users/uktrade","html_url":"https://github.com/uktrade","followers_url":"https://api.github.com/users/uktrade/followers","following_url":"https://api.github.com/users/uktrade/following{/other_user}","gists_url":"https://api.github.com/users/uktrade/gists{/gist_id}","starred_url":"https://api.github.com/users/uktrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uktrade/subscriptions","organizations_url":"https://api.github.com/users/uktrade/orgs","repos_url":"https://api.github.com/users/uktrade/repos","events_url":"https://api.github.com/users/uktrade/events{/privacy}","received_events_url":"https://api.github.com/users/uktrade/received_events","type":"Organization","site_admin":false},"repo":{"id":83823675,"name":"data-hub-frontend","full_name":"uktrade/data-hub-frontend","owner":{"login":"uktrade","id":15107524,"avatar_url":"https://avatars2.githubusercontent.com/u/15107524?v=4","gravatar_id":"","url":"https://api.github.com/users/uktrade","html_url":"https://github.com/uktrade","followers_url":"https://api.github.com/users/uktrade/followers","following_url":"https://api.github.com/users/uktrade/following{/other_user}","gists_url":"https://api.github.com/users/uktrade/gists{/gist_id}","starred_url":"https://api.github.com/users/uktrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uktrade/subscriptions","organizations_url":"https://api.github.com/users/uktrade/orgs","repos_url":"https://api.github.com/users/uktrade/repos","events_url":"https://api.github.com/users/uktrade/events{/privacy}","received_events_url":"https://api.github.com/users/uktrade/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uktrade/data-hub-frontend","description":"The frontend rendering application for Data Hub","fork":false,"url":"https://api.github.com/repos/uktrade/data-hub-frontend","forks_url":"https://api.github.com/repos/uktrade/data-hub-frontend/forks","keys_url":"https://api.github.com/repos/uktrade/data-hub-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uktrade/data-hub-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uktrade/data-hub-frontend/teams","hooks_url":"https://api.github.com/repos/uktrade/data-hub-frontend/hooks","issue_events_url":"https://api.github.com/repos/uktrade/data-hub-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/uktrade/data-hub-frontend/events","assignees_url":"https://api.github.com/repos/uktrade/data-hub-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/uktrade/data-hub-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/uktrade/data-hub-frontend/tags","blobs_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uktrade/data-hub-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/uktrade/data-hub-frontend/languages","stargazers_url":"https://api.github.com/repos/uktrade/data-hub-frontend/stargazers","contributors_url":"https://api.github.com/repos/uktrade/data-hub-frontend/contributors","subscribers_url":"https://api.github.com/repos/uktrade/data-hub-frontend/subscribers","subscription_url":"https://api.github.com/repos/uktrade/data-hub-frontend/subscription","commits_url":"https://api.github.com/repos/uktrade/data-hub-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/uktrade/data-hub-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/uktrade/data-hub-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/uktrade/data-hub-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/uktrade/data-hub-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/uktrade/data-hub-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uktrade/data-hub-frontend/merges","archive_url":"https://api.github.com/repos/uktrade/data-hub-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uktrade/data-hub-frontend/downloads","issues_url":"https://api.github.com/repos/uktrade/data-hub-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/uktrade/data-hub-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/uktrade/data-hub-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uktrade/data-hub-frontend/labels{/name}","releases_url":"https://api.github.com/repos/uktrade/data-hub-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/uktrade/data-hub-frontend/deployments","created_at":"2017-03-03T17:26:35Z","updated_at":"2017-08-16T08:31:47Z","pushed_at":"2017-11-20T17:33:59Z","git_url":"git://github.com/uktrade/data-hub-frontend.git","ssh_url":"git@github.com:uktrade/data-hub-frontend.git","clone_url":"https://github.com/uktrade/data-hub-frontend.git","svn_url":"https://github.com/uktrade/data-hub-frontend","homepage":"","size":3789,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":27,"forks":1,"open_issues":27,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/974"},"html":{"href":"https://github.com/uktrade/data-hub-frontend/pull/974"},"issue":{"href":"https://api.github.com/repos/uktrade/data-hub-frontend/issues/974"},"comments":{"href":"https://api.github.com/repos/uktrade/data-hub-frontend/issues/974/comments"},"review_comments":{"href":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/974/comments"},"review_comment":{"href":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uktrade/data-hub-frontend/pulls/974/commits"},"statuses":{"href":"https://api.github.com/repos/uktrade/data-hub-frontend/statuses/d1cd557e648dc8fe415ee07880a1168993813c96"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":36,"deletions":1,"changed_files":2}}
{"actor":{"display_login":"richtier"}}