{"action":"created","comment":{"url":"https://api.github.com/repos/dcos/dcos-ui/pulls/comments/87088869","pull_request_review_id":7715361,"id":87088869,"diff_hunk":"@@ -0,0 +1,124 @@\n+import React from 'react';\n+\n+import ConfigurationMap from '../../../../../src/js/components/ConfigurationMap';\n+import ConfigurationMapHeading from '../../../../../src/js/components/ConfigurationMapHeading';\n+import ConfigurationMapLabel from '../../../../../src/js/components/ConfigurationMapLabel';\n+import ConfigurationMapRow from '../../../../../src/js/components/ConfigurationMapRow';\n+import ConfigurationMapSection from '../../../../../src/js/components/ConfigurationMapSection';\n+import ConfigurationMapValue from '../../../../../src/js/components/ConfigurationMapValue';\n+import ServiceConfigDisplayUtil from '../utils/ServiceConfigDisplayUtil';\n+import Util from '../../../../../src/js/utils/Util';\n+\n+const shouldExcludeItem = (row, appDefinition) => {\n+  switch (row.key) {\n+    case 'gpus':\n+      return appDefinition.gpus === 0;\n+    case 'container.volumes':\n+      return appDefinition.container == null\n+        || appDefinition.container.volumes == null\n+        || appDefinition.container.volumes.length === 0;","path":"plugins/services/src/js/components/ServiceConfigDisplay.js","position":null,"original_position":19,"commit_id":"81eb8d5a7a4ec869b0eae0a1026d43bbe076e4d3","original_commit_id":"f59bfe91a33c5c6f140c4214bd64732bbe8a225d","user":{"login":"mlunoe","id":1097941,"avatar_url":"https://avatars.githubusercontent.com/u/1097941?v=3","gravatar_id":"","url":"https://api.github.com/users/mlunoe","html_url":"https://github.com/mlunoe","followers_url":"https://api.github.com/users/mlunoe/followers","following_url":"https://api.github.com/users/mlunoe/following{/other_user}","gists_url":"https://api.github.com/users/mlunoe/gists{/gist_id}","starred_url":"https://api.github.com/users/mlunoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlunoe/subscriptions","organizations_url":"https://api.github.com/users/mlunoe/orgs","repos_url":"https://api.github.com/users/mlunoe/repos","events_url":"https://api.github.com/users/mlunoe/events{/privacy}","received_events_url":"https://api.github.com/users/mlunoe/received_events","type":"User","site_admin":false},"body":"Anyways, up to you. You can keep it the way it is too :)","created_at":"2016-11-08T21:35:54Z","updated_at":"2016-11-08T21:35:54Z","html_url":"https://github.com/dcos/dcos-ui/pull/1330#discussion_r87088869","pull_request_url":"https://api.github.com/repos/dcos/dcos-ui/pulls/1330","_links":{"self":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/comments/87088869"},"html":{"href":"https://github.com/dcos/dcos-ui/pull/1330#discussion_r87088869"},"pull_request":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/1330"}}},"pull_request":{"url":"https://api.github.com/repos/dcos/dcos-ui/pulls/1330","id":92674880,"html_url":"https://github.com/dcos/dcos-ui/pull/1330","diff_url":"https://github.com/dcos/dcos-ui/pull/1330.diff","patch_url":"https://github.com/dcos/dcos-ui/pull/1330.patch","issue_url":"https://api.github.com/repos/dcos/dcos-ui/issues/1330","number":1330,"state":"open","locked":false,"title":"Introduce ServiceConfigDisplay component","user":{"login":"jfurrow","id":1134755,"avatar_url":"https://avatars.githubusercontent.com/u/1134755?v=3","gravatar_id":"","url":"https://api.github.com/users/jfurrow","html_url":"https://github.com/jfurrow","followers_url":"https://api.github.com/users/jfurrow/followers","following_url":"https://api.github.com/users/jfurrow/following{/other_user}","gists_url":"https://api.github.com/users/jfurrow/gists{/gist_id}","starred_url":"https://api.github.com/users/jfurrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfurrow/subscriptions","organizations_url":"https://api.github.com/users/jfurrow/orgs","repos_url":"https://api.github.com/users/jfurrow/repos","events_url":"https://api.github.com/users/jfurrow/events{/privacy}","received_events_url":"https://api.github.com/users/jfurrow/received_events","type":"User","site_admin":false},"body":"Sorry for the large PR! Most of it is the configuration for generating the display in `ServiceConfigDisplayUtil`. ~~(This PR will look better, visually in your browser, after these PRs merge: https://github.com/dcos/dcos-ui/pull/1328 and https://github.com/dcos/dcos-ui/pull/1329)~~ Marged <img src=\"http://icons.iconarchive.com/icons/jonathan-rey/simpsons/256/Marge-Simpson-icon.png\" width=\"16px\" />\r\n\r\n---\r\n\r\nThis PR introduces a `ServiceConfigDisplay` component and accompanying util which accepts one prop (`appDefinition`) and returns a nicely rendered view of the service's configuration.\r\n\r\nThe `ServiceConfigDisplay` component iterates over an array defined at `ServiceConfigDisplayUtil.displayValues` which describes how the configuration should be displayed. Each item in the array results in a `ConfigurationMapHeading ` or `ConfigurationMapRow`.\r\n\r\nYou'll also notice that some items in the `ServiceConfigDisplayUtil.displayValues` array contain a `transformValue` and/or `render` methods.\r\n* `transformValue` accepts the value as plucked from the `appDefinition` and returns a modified value (ex: it uses the `Units` util to render disk sizes nicely).\r\n* `render` will completely replace the default `ConfigurationMap`-related components as defined in the `ServiceConfigDisplay` component (ex: you would use this to render a `Table` component rather than the default `Label:Value` style).\r\n\r\n---\r\n### WIP Sections\r\nThe logic for `Networking`, `Container Runtime`, and potentially `Volumes` still need to be finalized by somebody else. I left `TODO` comments in these cases. I believe I know what logic needs to be implemented for `Container Runtime` and `Volumes` so let me know if you are the person that implements this and I'll provide what I know!\r\n\r\n---\r\n\r\nHere's a JSON blob you can use to generate the following screenshots: https://gist.github.com/jfurrow/c2907f56cdf25e1cd8a6f65c8fae1ac3\r\n![](https://d3vv6lp55qjaqc.cloudfront.net/items/3z0Y421Y3432162Y2z1h/Screen%20Shot%202016-11-07%20at%201.25.35%20PM.png)\r\n![](https://d3vv6lp55qjaqc.cloudfront.net/items/0j3c2W0i1i0N3m1D1w1Q/Screen%20Shot%202016-11-07%20at%201.25.44%20PM.png)\r\n![](https://d3vv6lp55qjaqc.cloudfront.net/items/0x3W0S0E3A2S1H3B1G1J/Screen%20Shot%202016-11-07%20at%201.25.54%20PM.png)","created_at":"2016-11-07T22:10:23Z","updated_at":"2016-11-08T21:35:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00c348b8d05fba8a4481c4f1d52af172a0b3e068","assignee":{"login":"mlunoe","id":1097941,"avatar_url":"https://avatars.githubusercontent.com/u/1097941?v=3","gravatar_id":"","url":"https://api.github.com/users/mlunoe","html_url":"https://github.com/mlunoe","followers_url":"https://api.github.com/users/mlunoe/followers","following_url":"https://api.github.com/users/mlunoe/following{/other_user}","gists_url":"https://api.github.com/users/mlunoe/gists{/gist_id}","starred_url":"https://api.github.com/users/mlunoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlunoe/subscriptions","organizations_url":"https://api.github.com/users/mlunoe/orgs","repos_url":"https://api.github.com/users/mlunoe/repos","events_url":"https://api.github.com/users/mlunoe/events{/privacy}","received_events_url":"https://api.github.com/users/mlunoe/received_events","type":"User","site_admin":false},"assignees":[{"login":"MatApple","id":465022,"avatar_url":"https://avatars.githubusercontent.com/u/465022?v=3","gravatar_id":"","url":"https://api.github.com/users/MatApple","html_url":"https://github.com/MatApple","followers_url":"https://api.github.com/users/MatApple/followers","following_url":"https://api.github.com/users/MatApple/following{/other_user}","gists_url":"https://api.github.com/users/MatApple/gists{/gist_id}","starred_url":"https://api.github.com/users/MatApple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatApple/subscriptions","organizations_url":"https://api.github.com/users/MatApple/orgs","repos_url":"https://api.github.com/users/MatApple/repos","events_url":"https://api.github.com/users/MatApple/events{/privacy}","received_events_url":"https://api.github.com/users/MatApple/received_events","type":"User","site_admin":false},{"login":"mlunoe","id":1097941,"avatar_url":"https://avatars.githubusercontent.com/u/1097941?v=3","gravatar_id":"","url":"https://api.github.com/users/mlunoe","html_url":"https://github.com/mlunoe","followers_url":"https://api.github.com/users/mlunoe/followers","following_url":"https://api.github.com/users/mlunoe/following{/other_user}","gists_url":"https://api.github.com/users/mlunoe/gists{/gist_id}","starred_url":"https://api.github.com/users/mlunoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlunoe/subscriptions","organizations_url":"https://api.github.com/users/mlunoe/orgs","repos_url":"https://api.github.com/users/mlunoe/repos","events_url":"https://api.github.com/users/mlunoe/events{/privacy}","received_events_url":"https://api.github.com/users/mlunoe/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dcos/dcos-ui/pulls/1330/commits","review_comments_url":"https://api.github.com/repos/dcos/dcos-ui/pulls/1330/comments","review_comment_url":"https://api.github.com/repos/dcos/dcos-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dcos/dcos-ui/issues/1330/comments","statuses_url":"https://api.github.com/repos/dcos/dcos-ui/statuses/81eb8d5a7a4ec869b0eae0a1026d43bbe076e4d3","head":{"label":"dcos:john/feature/introduce-ServiceConfigDisplay-component","ref":"john/feature/introduce-ServiceConfigDisplay-component","sha":"81eb8d5a7a4ec869b0eae0a1026d43bbe076e4d3","user":{"login":"dcos","id":17648048,"avatar_url":"https://avatars.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"repo":{"id":56547504,"name":"dcos-ui","full_name":"dcos/dcos-ui","owner":{"login":"dcos","id":17648048,"avatar_url":"https://avatars.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dcos/dcos-ui","description":"The UI for The Datacenter Operating System","fork":false,"url":"https://api.github.com/repos/dcos/dcos-ui","forks_url":"https://api.github.com/repos/dcos/dcos-ui/forks","keys_url":"https://api.github.com/repos/dcos/dcos-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcos/dcos-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcos/dcos-ui/teams","hooks_url":"https://api.github.com/repos/dcos/dcos-ui/hooks","issue_events_url":"https://api.github.com/repos/dcos/dcos-ui/issues/events{/number}","events_url":"https://api.github.com/repos/dcos/dcos-ui/events","assignees_url":"https://api.github.com/repos/dcos/dcos-ui/assignees{/user}","branches_url":"https://api.github.com/repos/dcos/dcos-ui/branches{/branch}","tags_url":"https://api.github.com/repos/dcos/dcos-ui/tags","blobs_url":"https://api.github.com/repos/dcos/dcos-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcos/dcos-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcos/dcos-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcos/dcos-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcos/dcos-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/dcos/dcos-ui/languages","stargazers_url":"https://api.github.com/repos/dcos/dcos-ui/stargazers","contributors_url":"https://api.github.com/repos/dcos/dcos-ui/contributors","subscribers_url":"https://api.github.com/repos/dcos/dcos-ui/subscribers","subscription_url":"https://api.github.com/repos/dcos/dcos-ui/subscription","commits_url":"https://api.github.com/repos/dcos/dcos-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcos/dcos-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcos/dcos-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcos/dcos-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcos/dcos-ui/contents/{+path}","compare_url":"https://api.github.com/repos/dcos/dcos-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcos/dcos-ui/merges","archive_url":"https://api.github.com/repos/dcos/dcos-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcos/dcos-ui/downloads","issues_url":"https://api.github.com/repos/dcos/dcos-ui/issues{/number}","pulls_url":"https://api.github.com/repos/dcos/dcos-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/dcos/dcos-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/dcos/dcos-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcos/dcos-ui/labels{/name}","releases_url":"https://api.github.com/repos/dcos/dcos-ui/releases{/id}","deployments_url":"https://api.github.com/repos/dcos/dcos-ui/deployments","created_at":"2016-04-18T22:48:06Z","updated_at":"2016-11-08T06:23:13Z","pushed_at":"2016-11-08T21:22:40Z","git_url":"git://github.com/dcos/dcos-ui.git","ssh_url":"git@github.com:dcos/dcos-ui.git","clone_url":"https://github.com/dcos/dcos-ui.git","svn_url":"https://github.com/dcos/dcos-ui","homepage":null,"size":27020,"stargazers_count":110,"watchers_count":110,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":30,"mirror_url":null,"open_issues_count":24,"forks":30,"open_issues":24,"watchers":110,"default_branch":"master"}},"base":{"label":"dcos:master","ref":"master","sha":"8d4f171f728dcde2cb50a9ad64809357d3bf0b83","user":{"login":"dcos","id":17648048,"avatar_url":"https://avatars.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"repo":{"id":56547504,"name":"dcos-ui","full_name":"dcos/dcos-ui","owner":{"login":"dcos","id":17648048,"avatar_url":"https://avatars.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dcos/dcos-ui","description":"The UI for The Datacenter Operating System","fork":false,"url":"https://api.github.com/repos/dcos/dcos-ui","forks_url":"https://api.github.com/repos/dcos/dcos-ui/forks","keys_url":"https://api.github.com/repos/dcos/dcos-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcos/dcos-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcos/dcos-ui/teams","hooks_url":"https://api.github.com/repos/dcos/dcos-ui/hooks","issue_events_url":"https://api.github.com/repos/dcos/dcos-ui/issues/events{/number}","events_url":"https://api.github.com/repos/dcos/dcos-ui/events","assignees_url":"https://api.github.com/repos/dcos/dcos-ui/assignees{/user}","branches_url":"https://api.github.com/repos/dcos/dcos-ui/branches{/branch}","tags_url":"https://api.github.com/repos/dcos/dcos-ui/tags","blobs_url":"https://api.github.com/repos/dcos/dcos-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcos/dcos-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcos/dcos-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcos/dcos-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcos/dcos-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/dcos/dcos-ui/languages","stargazers_url":"https://api.github.com/repos/dcos/dcos-ui/stargazers","contributors_url":"https://api.github.com/repos/dcos/dcos-ui/contributors","subscribers_url":"https://api.github.com/repos/dcos/dcos-ui/subscribers","subscription_url":"https://api.github.com/repos/dcos/dcos-ui/subscription","commits_url":"https://api.github.com/repos/dcos/dcos-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcos/dcos-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcos/dcos-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcos/dcos-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcos/dcos-ui/contents/{+path}","compare_url":"https://api.github.com/repos/dcos/dcos-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcos/dcos-ui/merges","archive_url":"https://api.github.com/repos/dcos/dcos-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcos/dcos-ui/downloads","issues_url":"https://api.github.com/repos/dcos/dcos-ui/issues{/number}","pulls_url":"https://api.github.com/repos/dcos/dcos-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/dcos/dcos-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/dcos/dcos-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcos/dcos-ui/labels{/name}","releases_url":"https://api.github.com/repos/dcos/dcos-ui/releases{/id}","deployments_url":"https://api.github.com/repos/dcos/dcos-ui/deployments","created_at":"2016-04-18T22:48:06Z","updated_at":"2016-11-08T06:23:13Z","pushed_at":"2016-11-08T21:22:40Z","git_url":"git://github.com/dcos/dcos-ui.git","ssh_url":"git@github.com:dcos/dcos-ui.git","clone_url":"https://github.com/dcos/dcos-ui.git","svn_url":"https://github.com/dcos/dcos-ui","homepage":null,"size":27020,"stargazers_count":110,"watchers_count":110,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":30,"mirror_url":null,"open_issues_count":24,"forks":30,"open_issues":24,"watchers":110,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/1330"},"html":{"href":"https://github.com/dcos/dcos-ui/pull/1330"},"issue":{"href":"https://api.github.com/repos/dcos/dcos-ui/issues/1330"},"comments":{"href":"https://api.github.com/repos/dcos/dcos-ui/issues/1330/comments"},"review_comments":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/1330/comments"},"review_comment":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/1330/commits"},"statuses":{"href":"https://api.github.com/repos/dcos/dcos-ui/statuses/81eb8d5a7a4ec869b0eae0a1026d43bbe076e4d3"}}}}
{"actor":{"display_login":"mlunoe"}}