{"action":"created","comment":{"url":"https://api.github.com/repos/linzjs/linz/pulls/comments/67073643","id":67073643,"diff_hunk":"@@ -0,0 +1,56 @@\n+\n+var async = require('async'),\n+    cellRenderers = require('./renderers-cell');\n+\n+\n+function getOverviewFields(schema, form, selectedFields, record, model, callback) {\n+\n+    var fieldsets = {},\n+        fields = {};\n+\n+    selectedFields.forEach( function(fieldName) {","path":"lib/formtools/overview.js","position":11,"original_position":11,"commit_id":"7db088ee9b47b3cc8e2e34d2903cb12f72ea400c","original_commit_id":"7db088ee9b47b3cc8e2e34d2903cb12f72ea400c","user":{"login":"smebberson","id":74628,"avatar_url":"https://avatars.githubusercontent.com/u/74628?v=3","gravatar_id":"","url":"https://api.github.com/users/smebberson","html_url":"https://github.com/smebberson","followers_url":"https://api.github.com/users/smebberson/followers","following_url":"https://api.github.com/users/smebberson/following{/other_user}","gists_url":"https://api.github.com/users/smebberson/gists{/gist_id}","starred_url":"https://api.github.com/users/smebberson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smebberson/subscriptions","organizations_url":"https://api.github.com/users/smebberson/orgs","repos_url":"https://api.github.com/users/smebberson/repos","events_url":"https://api.github.com/users/smebberson/events{/privacy}","received_events_url":"https://api.github.com/users/smebberson/received_events","type":"User","site_admin":false},"body":"This code would be more performant if written:\r\n\r\n```\r\nvar ref = form[fieldName];\r\n\r\nif (ref) {\r\n    fields[fieldName] = {\r\n        label: ref.label,\r\n        type: ref.type,\r\n        fieldset: ref.fieldset\r\n    }\r\n}\r\n```","created_at":"2016-06-14T23:02:01Z","updated_at":"2016-06-14T23:02:01Z","html_url":"https://github.com/linzjs/linz/pull/102#discussion_r67073643","pull_request_url":"https://api.github.com/repos/linzjs/linz/pulls/102","_links":{"self":{"href":"https://api.github.com/repos/linzjs/linz/pulls/comments/67073643"},"html":{"href":"https://github.com/linzjs/linz/pull/102#discussion_r67073643"},"pull_request":{"href":"https://api.github.com/repos/linzjs/linz/pulls/102"}}},"pull_request":{"url":"https://api.github.com/repos/linzjs/linz/pulls/102","id":71675590,"html_url":"https://github.com/linzjs/linz/pull/102","diff_url":"https://github.com/linzjs/linz/pull/102.diff","patch_url":"https://github.com/linzjs/linz/pull/102.patch","issue_url":"https://api.github.com/repos/linzjs/linz/issues/102","number":102,"state":"open","locked":false,"title":"Upgrade overview UI","user":{"login":"patelswapnil","id":12613138,"avatar_url":"https://avatars.githubusercontent.com/u/12613138?v=3","gravatar_id":"","url":"https://api.github.com/users/patelswapnil","html_url":"https://github.com/patelswapnil","followers_url":"https://api.github.com/users/patelswapnil/followers","following_url":"https://api.github.com/users/patelswapnil/following{/other_user}","gists_url":"https://api.github.com/users/patelswapnil/gists{/gist_id}","starred_url":"https://api.github.com/users/patelswapnil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patelswapnil/subscriptions","organizations_url":"https://api.github.com/users/patelswapnil/orgs","repos_url":"https://api.github.com/users/patelswapnil/repos","events_url":"https://api.github.com/users/patelswapnil/events{/privacy}","received_events_url":"https://api.github.com/users/patelswapnil/received_events","type":"User","site_admin":false},"body":"### This PR improves the overview UI and allows the user to define the Overview as follow:\r\n- Render `Date created` and `Date modified` as default Summary when details is not set in overview configuration\r\n- User can select fields to be rendered as details in Overview or can pass their own function to render the data as they wish\r\n- User can select fields to be rendered under seperate tabs\r\n- User can pass their own function to render data as they wish under each tab\r\n\r\n### Usage\r\n\r\n- You can pass array of field names to `details` property of `overview`\r\n\r\n```\r\noverview: {\r\n    details: ['fieldName1', 'fieldName2', ....]\r\n}\r\n```\r\n\r\n   Or you can pass a custom function to render the data as you require as follow:\r\n\r\n```\r\noverview: {\r\n    details: function (req, res, record, model, callback) {\r\n            .... function code to create html content here....\r\n            return callback(null, 'html content here');\r\n     }\r\n}\r\n```\r\n   Linz will provide four arguments (req, res, record and model) to custom function in overview.\r\n   Your custom function should return html content.\r\n\r\n   __Note:__ When details property is not provided in overview, Linz will render `Summary` with `Date created` and `Date modified` details in it.\r\n\r\n- Data can be rendered under tabs by setting `tabs` property in `overview`\r\n\r\n```\r\noverview: {\r\n     tabs: [\r\n              {\r\n                   label: 'Tab1',\r\n                   fields: ['fieldName1', 'fieldName2', ....]\r\n              },\r\n              {\r\n                   label: 'Tab2',\r\n                   fields: ['fieldName1', 'fieldName2', ....]\r\n              },\r\n              .... more tabs ....\r\n     ]\r\n}\r\n``` \r\n\r\n- You can also proivde custom function in tabs \r\n\r\n```\r\noverview: {\r\n        tabs: [\r\n               {\r\n                  label: 'Tab',\r\n                  body: function(req, res, record, model, callback) {\r\n                                .... function code to create html content here ....\r\n                                return callback(null, 'html content here');\r\n               },\r\n               .... more tabs ....\r\n        ]\r\n}\r\n```","created_at":"2016-05-27T08:12:07Z","updated_at":"2016-06-14T23:02:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"88eb984591dc2caa689f239b5aeec9bb6eec73a7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/linzjs/linz/pulls/102/commits","review_comments_url":"https://api.github.com/repos/linzjs/linz/pulls/102/comments","review_comment_url":"https://api.github.com/repos/linzjs/linz/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linzjs/linz/issues/102/comments","statuses_url":"https://api.github.com/repos/linzjs/linz/statuses/7db088ee9b47b3cc8e2e34d2903cb12f72ea400c","head":{"label":"linzjs:overview-ui","ref":"overview-ui","sha":"7db088ee9b47b3cc8e2e34d2903cb12f72ea400c","user":{"login":"linzjs","id":11432541,"avatar_url":"https://avatars.githubusercontent.com/u/11432541?v=3","gravatar_id":"","url":"https://api.github.com/users/linzjs","html_url":"https://github.com/linzjs","followers_url":"https://api.github.com/users/linzjs/followers","following_url":"https://api.github.com/users/linzjs/following{/other_user}","gists_url":"https://api.github.com/users/linzjs/gists{/gist_id}","starred_url":"https://api.github.com/users/linzjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linzjs/subscriptions","organizations_url":"https://api.github.com/users/linzjs/orgs","repos_url":"https://api.github.com/users/linzjs/repos","events_url":"https://api.github.com/users/linzjs/events{/privacy}","received_events_url":"https://api.github.com/users/linzjs/received_events","type":"Organization","site_admin":false},"repo":{"id":12881781,"name":"linz","full_name":"linzjs/linz","owner":{"login":"linzjs","id":11432541,"avatar_url":"https://avatars.githubusercontent.com/u/11432541?v=3","gravatar_id":"","url":"https://api.github.com/users/linzjs","html_url":"https://github.com/linzjs","followers_url":"https://api.github.com/users/linzjs/followers","following_url":"https://api.github.com/users/linzjs/following{/other_user}","gists_url":"https://api.github.com/users/linzjs/gists{/gist_id}","starred_url":"https://api.github.com/users/linzjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linzjs/subscriptions","organizations_url":"https://api.github.com/users/linzjs/orgs","repos_url":"https://api.github.com/users/linzjs/repos","events_url":"https://api.github.com/users/linzjs/events{/privacy}","received_events_url":"https://api.github.com/users/linzjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/linzjs/linz","description":"NodeJS Content Management System","fork":false,"url":"https://api.github.com/repos/linzjs/linz","forks_url":"https://api.github.com/repos/linzjs/linz/forks","keys_url":"https://api.github.com/repos/linzjs/linz/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linzjs/linz/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linzjs/linz/teams","hooks_url":"https://api.github.com/repos/linzjs/linz/hooks","issue_events_url":"https://api.github.com/repos/linzjs/linz/issues/events{/number}","events_url":"https://api.github.com/repos/linzjs/linz/events","assignees_url":"https://api.github.com/repos/linzjs/linz/assignees{/user}","branches_url":"https://api.github.com/repos/linzjs/linz/branches{/branch}","tags_url":"https://api.github.com/repos/linzjs/linz/tags","blobs_url":"https://api.github.com/repos/linzjs/linz/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linzjs/linz/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linzjs/linz/git/refs{/sha}","trees_url":"https://api.github.com/repos/linzjs/linz/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linzjs/linz/statuses/{sha}","languages_url":"https://api.github.com/repos/linzjs/linz/languages","stargazers_url":"https://api.github.com/repos/linzjs/linz/stargazers","contributors_url":"https://api.github.com/repos/linzjs/linz/contributors","subscribers_url":"https://api.github.com/repos/linzjs/linz/subscribers","subscription_url":"https://api.github.com/repos/linzjs/linz/subscription","commits_url":"https://api.github.com/repos/linzjs/linz/commits{/sha}","git_commits_url":"https://api.github.com/repos/linzjs/linz/git/commits{/sha}","comments_url":"https://api.github.com/repos/linzjs/linz/comments{/number}","issue_comment_url":"https://api.github.com/repos/linzjs/linz/issues/comments{/number}","contents_url":"https://api.github.com/repos/linzjs/linz/contents/{+path}","compare_url":"https://api.github.com/repos/linzjs/linz/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linzjs/linz/merges","archive_url":"https://api.github.com/repos/linzjs/linz/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linzjs/linz/downloads","issues_url":"https://api.github.com/repos/linzjs/linz/issues{/number}","pulls_url":"https://api.github.com/repos/linzjs/linz/pulls{/number}","milestones_url":"https://api.github.com/repos/linzjs/linz/milestones{/number}","notifications_url":"https://api.github.com/repos/linzjs/linz/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linzjs/linz/labels{/name}","releases_url":"https://api.github.com/repos/linzjs/linz/releases{/id}","deployments_url":"https://api.github.com/repos/linzjs/linz/deployments","created_at":"2013-09-16T23:56:05Z","updated_at":"2016-04-04T05:17:27Z","pushed_at":"2016-06-10T05:50:10Z","git_url":"git://github.com/linzjs/linz.git","ssh_url":"git@github.com:linzjs/linz.git","clone_url":"https://github.com/linzjs/linz.git","svn_url":"https://github.com/linzjs/linz","homepage":null,"size":2034,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":28,"forks":1,"open_issues":28,"watchers":2,"default_branch":"master"}},"base":{"label":"linzjs:master","ref":"master","sha":"42a8a3c2c4a5e852ff13d36ce202134621694e76","user":{"login":"linzjs","id":11432541,"avatar_url":"https://avatars.githubusercontent.com/u/11432541?v=3","gravatar_id":"","url":"https://api.github.com/users/linzjs","html_url":"https://github.com/linzjs","followers_url":"https://api.github.com/users/linzjs/followers","following_url":"https://api.github.com/users/linzjs/following{/other_user}","gists_url":"https://api.github.com/users/linzjs/gists{/gist_id}","starred_url":"https://api.github.com/users/linzjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linzjs/subscriptions","organizations_url":"https://api.github.com/users/linzjs/orgs","repos_url":"https://api.github.com/users/linzjs/repos","events_url":"https://api.github.com/users/linzjs/events{/privacy}","received_events_url":"https://api.github.com/users/linzjs/received_events","type":"Organization","site_admin":false},"repo":{"id":12881781,"name":"linz","full_name":"linzjs/linz","owner":{"login":"linzjs","id":11432541,"avatar_url":"https://avatars.githubusercontent.com/u/11432541?v=3","gravatar_id":"","url":"https://api.github.com/users/linzjs","html_url":"https://github.com/linzjs","followers_url":"https://api.github.com/users/linzjs/followers","following_url":"https://api.github.com/users/linzjs/following{/other_user}","gists_url":"https://api.github.com/users/linzjs/gists{/gist_id}","starred_url":"https://api.github.com/users/linzjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linzjs/subscriptions","organizations_url":"https://api.github.com/users/linzjs/orgs","repos_url":"https://api.github.com/users/linzjs/repos","events_url":"https://api.github.com/users/linzjs/events{/privacy}","received_events_url":"https://api.github.com/users/linzjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/linzjs/linz","description":"NodeJS Content Management System","fork":false,"url":"https://api.github.com/repos/linzjs/linz","forks_url":"https://api.github.com/repos/linzjs/linz/forks","keys_url":"https://api.github.com/repos/linzjs/linz/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linzjs/linz/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linzjs/linz/teams","hooks_url":"https://api.github.com/repos/linzjs/linz/hooks","issue_events_url":"https://api.github.com/repos/linzjs/linz/issues/events{/number}","events_url":"https://api.github.com/repos/linzjs/linz/events","assignees_url":"https://api.github.com/repos/linzjs/linz/assignees{/user}","branches_url":"https://api.github.com/repos/linzjs/linz/branches{/branch}","tags_url":"https://api.github.com/repos/linzjs/linz/tags","blobs_url":"https://api.github.com/repos/linzjs/linz/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linzjs/linz/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linzjs/linz/git/refs{/sha}","trees_url":"https://api.github.com/repos/linzjs/linz/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linzjs/linz/statuses/{sha}","languages_url":"https://api.github.com/repos/linzjs/linz/languages","stargazers_url":"https://api.github.com/repos/linzjs/linz/stargazers","contributors_url":"https://api.github.com/repos/linzjs/linz/contributors","subscribers_url":"https://api.github.com/repos/linzjs/linz/subscribers","subscription_url":"https://api.github.com/repos/linzjs/linz/subscription","commits_url":"https://api.github.com/repos/linzjs/linz/commits{/sha}","git_commits_url":"https://api.github.com/repos/linzjs/linz/git/commits{/sha}","comments_url":"https://api.github.com/repos/linzjs/linz/comments{/number}","issue_comment_url":"https://api.github.com/repos/linzjs/linz/issues/comments{/number}","contents_url":"https://api.github.com/repos/linzjs/linz/contents/{+path}","compare_url":"https://api.github.com/repos/linzjs/linz/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linzjs/linz/merges","archive_url":"https://api.github.com/repos/linzjs/linz/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linzjs/linz/downloads","issues_url":"https://api.github.com/repos/linzjs/linz/issues{/number}","pulls_url":"https://api.github.com/repos/linzjs/linz/pulls{/number}","milestones_url":"https://api.github.com/repos/linzjs/linz/milestones{/number}","notifications_url":"https://api.github.com/repos/linzjs/linz/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linzjs/linz/labels{/name}","releases_url":"https://api.github.com/repos/linzjs/linz/releases{/id}","deployments_url":"https://api.github.com/repos/linzjs/linz/deployments","created_at":"2013-09-16T23:56:05Z","updated_at":"2016-04-04T05:17:27Z","pushed_at":"2016-06-10T05:50:10Z","git_url":"git://github.com/linzjs/linz.git","ssh_url":"git@github.com:linzjs/linz.git","clone_url":"https://github.com/linzjs/linz.git","svn_url":"https://github.com/linzjs/linz","homepage":null,"size":2034,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":28,"forks":1,"open_issues":28,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linzjs/linz/pulls/102"},"html":{"href":"https://github.com/linzjs/linz/pull/102"},"issue":{"href":"https://api.github.com/repos/linzjs/linz/issues/102"},"comments":{"href":"https://api.github.com/repos/linzjs/linz/issues/102/comments"},"review_comments":{"href":"https://api.github.com/repos/linzjs/linz/pulls/102/comments"},"review_comment":{"href":"https://api.github.com/repos/linzjs/linz/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linzjs/linz/pulls/102/commits"},"statuses":{"href":"https://api.github.com/repos/linzjs/linz/statuses/7db088ee9b47b3cc8e2e34d2903cb12f72ea400c"}}}}
{"actor":{"display_login":"smebberson"}}