{"action":"created","comment":{"url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/pulls/comments/59892963","id":59892963,"diff_hunk":"@@ -23,6 +23,41 @@ function getErrorLength() {\n   }\n }\n \n+/*\n+ * Utility function which returns the\n+ * name of the step a field is present on\n+ */\n+function getStepFromFieldName(fieldName, steps) {\n+  return _.findKey(steps, function findKey(step) {\n+    if (!step.fields) {\n+      return false;\n+    }\n+    return step.fields.indexOf(fieldName) > -1;\n+  });\n+}\n+\n+/*\n+ * Utility function to create an array\n+ * of field objects made up of field name,\n+ * value and step\n+ */\n+function getFieldObjectsFromNames(fields, values, modifiers, steps) {\n+  return fields.filter(function filter(item) {\n+    return (values[item] !== undefined && values[item] !== '') || modifiers[item] !== undefined;\n+  }).map(function map(item) {\n+    var value = values[item];\n+    var step = getStepFromFieldName(item, steps);\n+    if (modifiers && modifiers[item]) {","path":"lib/base-controller.js","position":28,"original_position":28,"commit_id":"43e15341694f4108eefd164275a5e3e6a2ab23c3","original_commit_id":"43e15341694f4108eefd164275a5e3e6a2ab23c3","user":{"login":"joefitter","id":3604142,"avatar_url":"https://avatars.githubusercontent.com/u/3604142?v=3","gravatar_id":"","url":"https://api.github.com/users/joefitter","html_url":"https://github.com/joefitter","followers_url":"https://api.github.com/users/joefitter/followers","following_url":"https://api.github.com/users/joefitter/following{/other_user}","gists_url":"https://api.github.com/users/joefitter/gists{/gist_id}","starred_url":"https://api.github.com/users/joefitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joefitter/subscriptions","organizations_url":"https://api.github.com/users/joefitter/orgs","repos_url":"https://api.github.com/users/joefitter/repos","events_url":"https://api.github.com/users/joefitter/events{/privacy}","received_events_url":"https://api.github.com/users/joefitter/received_events","type":"User","site_admin":false},"body":"if `(values[item] !== undefined && values[item] !== '') === true` the `||` case is ignored. There is a test which fails if this is the case","created_at":"2016-04-15T15:31:41Z","updated_at":"2016-04-15T15:31:41Z","html_url":"https://github.com/UKHomeOffice/hof-controllers/pull/22#discussion_r59892963","pull_request_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/UKHomeOffice/hof-controllers/pulls/comments/59892963"},"html":{"href":"https://github.com/UKHomeOffice/hof-controllers/pull/22#discussion_r59892963"},"pull_request":{"href":"https://api.github.com/repos/UKHomeOffice/hof-controllers/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/pulls/22","id":66651028,"html_url":"https://github.com/UKHomeOffice/hof-controllers/pull/22","diff_url":"https://github.com/UKHomeOffice/hof-controllers/pull/22.diff","patch_url":"https://github.com/UKHomeOffice/hof-controllers/pull/22.patch","issue_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/issues/22","number":22,"state":"open","locked":false,"title":"expose data for creation of config page programatically","user":{"login":"joefitter","id":3604142,"avatar_url":"https://avatars.githubusercontent.com/u/3604142?v=3","gravatar_id":"","url":"https://api.github.com/users/joefitter","html_url":"https://github.com/joefitter","followers_url":"https://api.github.com/users/joefitter/followers","following_url":"https://api.github.com/users/joefitter/following{/other_user}","gists_url":"https://api.github.com/users/joefitter/gists{/gist_id}","starred_url":"https://api.github.com/users/joefitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joefitter/subscriptions","organizations_url":"https://api.github.com/users/joefitter/orgs","repos_url":"https://api.github.com/users/joefitter/repos","events_url":"https://api.github.com/users/joefitter/events{/privacy}","received_events_url":"https://api.github.com/users/joefitter/received_events","type":"User","site_admin":false},"body":"* extend BaseController.prototype.locals return object with modelData from current step config\r\n* if modelData.tableSections is present, each section is processed and a fields array of objects is created exposing value, name and step\r\n* Custom value displaying is achieved by including a modifiers hash in the modelData object\r\n\r\ncloses #21","created_at":"2016-04-15T14:26:17Z","updated_at":"2016-04-15T15:31:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c2b43f9c62df200a341b56175c884e1e213c85b0","assignee":{"login":"JoeChapman","id":1274835,"avatar_url":"https://avatars.githubusercontent.com/u/1274835?v=3","gravatar_id":"","url":"https://api.github.com/users/JoeChapman","html_url":"https://github.com/JoeChapman","followers_url":"https://api.github.com/users/JoeChapman/followers","following_url":"https://api.github.com/users/JoeChapman/following{/other_user}","gists_url":"https://api.github.com/users/JoeChapman/gists{/gist_id}","starred_url":"https://api.github.com/users/JoeChapman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoeChapman/subscriptions","organizations_url":"https://api.github.com/users/JoeChapman/orgs","repos_url":"https://api.github.com/users/JoeChapman/repos","events_url":"https://api.github.com/users/JoeChapman/events{/privacy}","received_events_url":"https://api.github.com/users/JoeChapman/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/pulls/22/commits","review_comments_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/pulls/22/comments","review_comment_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/issues/22/comments","statuses_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/statuses/43e15341694f4108eefd164275a5e3e6a2ab23c3","head":{"label":"UKHomeOffice:devtask/#21-provide-field-data-to-confirm-template","ref":"devtask/#21-provide-field-data-to-confirm-template","sha":"43e15341694f4108eefd164275a5e3e6a2ab23c3","user":{"login":"UKHomeOffice","id":3778081,"avatar_url":"https://avatars.githubusercontent.com/u/3778081?v=3","gravatar_id":"","url":"https://api.github.com/users/UKHomeOffice","html_url":"https://github.com/UKHomeOffice","followers_url":"https://api.github.com/users/UKHomeOffice/followers","following_url":"https://api.github.com/users/UKHomeOffice/following{/other_user}","gists_url":"https://api.github.com/users/UKHomeOffice/gists{/gist_id}","starred_url":"https://api.github.com/users/UKHomeOffice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UKHomeOffice/subscriptions","organizations_url":"https://api.github.com/users/UKHomeOffice/orgs","repos_url":"https://api.github.com/users/UKHomeOffice/repos","events_url":"https://api.github.com/users/UKHomeOffice/events{/privacy}","received_events_url":"https://api.github.com/users/UKHomeOffice/received_events","type":"Organization","site_admin":false},"repo":{"id":45553140,"name":"hof-controllers","full_name":"UKHomeOffice/hof-controllers","owner":{"login":"UKHomeOffice","id":3778081,"avatar_url":"https://avatars.githubusercontent.com/u/3778081?v=3","gravatar_id":"","url":"https://api.github.com/users/UKHomeOffice","html_url":"https://github.com/UKHomeOffice","followers_url":"https://api.github.com/users/UKHomeOffice/followers","following_url":"https://api.github.com/users/UKHomeOffice/following{/other_user}","gists_url":"https://api.github.com/users/UKHomeOffice/gists{/gist_id}","starred_url":"https://api.github.com/users/UKHomeOffice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UKHomeOffice/subscriptions","organizations_url":"https://api.github.com/users/UKHomeOffice/orgs","repos_url":"https://api.github.com/users/UKHomeOffice/repos","events_url":"https://api.github.com/users/UKHomeOffice/events{/privacy}","received_events_url":"https://api.github.com/users/UKHomeOffice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UKHomeOffice/hof-controllers","description":"A collection of controllers commonly used in HOF","fork":false,"url":"https://api.github.com/repos/UKHomeOffice/hof-controllers","forks_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/forks","keys_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/teams","hooks_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/hooks","issue_events_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/issues/events{/number}","events_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/events","assignees_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/assignees{/user}","branches_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/branches{/branch}","tags_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/tags","blobs_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/git/refs{/sha}","trees_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/statuses/{sha}","languages_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/languages","stargazers_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/stargazers","contributors_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/contributors","subscribers_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/subscribers","subscription_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/subscription","commits_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/commits{/sha}","git_commits_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/git/commits{/sha}","comments_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/comments{/number}","issue_comment_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/issues/comments{/number}","contents_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/contents/{+path}","compare_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/merges","archive_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/downloads","issues_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/issues{/number}","pulls_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/pulls{/number}","milestones_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/milestones{/number}","notifications_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/labels{/name}","releases_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/releases{/id}","deployments_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/deployments","created_at":"2015-11-04T16:48:58Z","updated_at":"2016-03-07T18:00:35Z","pushed_at":"2016-04-15T14:26:18Z","git_url":"git://github.com/UKHomeOffice/hof-controllers.git","ssh_url":"git@github.com:UKHomeOffice/hof-controllers.git","clone_url":"https://github.com/UKHomeOffice/hof-controllers.git","svn_url":"https://github.com/UKHomeOffice/hof-controllers","homepage":null,"size":68,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"UKHomeOffice:master","ref":"master","sha":"e5c700a497aeaf98e07c2e577a7c0f93ac64a104","user":{"login":"UKHomeOffice","id":3778081,"avatar_url":"https://avatars.githubusercontent.com/u/3778081?v=3","gravatar_id":"","url":"https://api.github.com/users/UKHomeOffice","html_url":"https://github.com/UKHomeOffice","followers_url":"https://api.github.com/users/UKHomeOffice/followers","following_url":"https://api.github.com/users/UKHomeOffice/following{/other_user}","gists_url":"https://api.github.com/users/UKHomeOffice/gists{/gist_id}","starred_url":"https://api.github.com/users/UKHomeOffice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UKHomeOffice/subscriptions","organizations_url":"https://api.github.com/users/UKHomeOffice/orgs","repos_url":"https://api.github.com/users/UKHomeOffice/repos","events_url":"https://api.github.com/users/UKHomeOffice/events{/privacy}","received_events_url":"https://api.github.com/users/UKHomeOffice/received_events","type":"Organization","site_admin":false},"repo":{"id":45553140,"name":"hof-controllers","full_name":"UKHomeOffice/hof-controllers","owner":{"login":"UKHomeOffice","id":3778081,"avatar_url":"https://avatars.githubusercontent.com/u/3778081?v=3","gravatar_id":"","url":"https://api.github.com/users/UKHomeOffice","html_url":"https://github.com/UKHomeOffice","followers_url":"https://api.github.com/users/UKHomeOffice/followers","following_url":"https://api.github.com/users/UKHomeOffice/following{/other_user}","gists_url":"https://api.github.com/users/UKHomeOffice/gists{/gist_id}","starred_url":"https://api.github.com/users/UKHomeOffice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UKHomeOffice/subscriptions","organizations_url":"https://api.github.com/users/UKHomeOffice/orgs","repos_url":"https://api.github.com/users/UKHomeOffice/repos","events_url":"https://api.github.com/users/UKHomeOffice/events{/privacy}","received_events_url":"https://api.github.com/users/UKHomeOffice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UKHomeOffice/hof-controllers","description":"A collection of controllers commonly used in HOF","fork":false,"url":"https://api.github.com/repos/UKHomeOffice/hof-controllers","forks_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/forks","keys_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/teams","hooks_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/hooks","issue_events_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/issues/events{/number}","events_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/events","assignees_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/assignees{/user}","branches_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/branches{/branch}","tags_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/tags","blobs_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/git/refs{/sha}","trees_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/statuses/{sha}","languages_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/languages","stargazers_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/stargazers","contributors_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/contributors","subscribers_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/subscribers","subscription_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/subscription","commits_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/commits{/sha}","git_commits_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/git/commits{/sha}","comments_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/comments{/number}","issue_comment_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/issues/comments{/number}","contents_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/contents/{+path}","compare_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/merges","archive_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/downloads","issues_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/issues{/number}","pulls_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/pulls{/number}","milestones_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/milestones{/number}","notifications_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/labels{/name}","releases_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/releases{/id}","deployments_url":"https://api.github.com/repos/UKHomeOffice/hof-controllers/deployments","created_at":"2015-11-04T16:48:58Z","updated_at":"2016-03-07T18:00:35Z","pushed_at":"2016-04-15T14:26:18Z","git_url":"git://github.com/UKHomeOffice/hof-controllers.git","ssh_url":"git@github.com:UKHomeOffice/hof-controllers.git","clone_url":"https://github.com/UKHomeOffice/hof-controllers.git","svn_url":"https://github.com/UKHomeOffice/hof-controllers","homepage":null,"size":68,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UKHomeOffice/hof-controllers/pulls/22"},"html":{"href":"https://github.com/UKHomeOffice/hof-controllers/pull/22"},"issue":{"href":"https://api.github.com/repos/UKHomeOffice/hof-controllers/issues/22"},"comments":{"href":"https://api.github.com/repos/UKHomeOffice/hof-controllers/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/UKHomeOffice/hof-controllers/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/UKHomeOffice/hof-controllers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UKHomeOffice/hof-controllers/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/UKHomeOffice/hof-controllers/statuses/43e15341694f4108eefd164275a5e3e6a2ab23c3"}}}}