{"action":"created","comment":{"url":"https://api.github.com/repos/dcos/dcos-ui/pulls/comments/61904461","id":61904461,"diff_hunk":"@@ -0,0 +1,113 @@\n+import React from 'react';\n+import {Link} from 'react-router';\n+\n+import ServicesPathUtil from '../utils/ServicesPathUtil';\n+\n+const breadcrumbIcon = (\n+  <i className=\"icon icon-sprite icon-sprite-small icon-back forward\" />\n+);\n+\n+var ServicesBreadcrumb = React.createClass({\n+  displayName: 'ServicesBreadcrumb',\n+\n+  propTypes: {\n+    appId: React.PropTypes.string,\n+    groupId: React.PropTypes.string,\n+    taskId: React.PropTypes.string,\n+    volumeId: React.PropTypes.string\n+  },\n+\n+  getRootLink: function () {\n+    const {groupId, appId} = this.props;\n+\n+    if (groupId == null ||\n+      (groupId === '/' && appId == null)) {\n+      return (\n+        <span className=\"crumb\">Services</span>\n+      );\n+    }\n+\n+    return (\n+      <span className=\"crumb\">\n+        <Link to=\"services\">Services</Link>\n+      </span>\n+    );\n+  },\n+\n+  getGroupLinks: function () {\n+    var {appId, groupId} = this.props;\n+\n+    if (groupId == null) {\n+      return null;\n+    }\n+\n+    const pathParts = groupId.split('/').slice(0, -1);\n+\n+    return pathParts.map((name, i) => {\n+      var id = pathParts.slice(0, i + 1).join('/');\n+\n+      let group = (\n+          <Link\n+            to=\"services-detail\"\n+            params={{id: encodeURIComponent(id)}}\n+            title={name}>\n+            {name}\n+          </Link>\n+      );\n+\n+      if (i === pathParts.length - 1 && appId == null) {\n+        group = (<span>{name}</span>);\n+      }\n+\n+      return (\n+        <span className=\"crumb\" key={id}>\n+          {breadcrumbIcon}\n+          {group}\n+        </span>\n+      );\n+    }).slice(1);","path":"src/js/components/ServicesBreadcrumb.js","position":68,"original_position":68,"commit_id":"e2672a8f3d0fc2551023b39b7c9b3ea79434e9d1","original_commit_id":"e2672a8f3d0fc2551023b39b7c9b3ea79434e9d1","user":{"login":"rcorral","id":843202,"avatar_url":"https://avatars.githubusercontent.com/u/843202?v=3","gravatar_id":"","url":"https://api.github.com/users/rcorral","html_url":"https://github.com/rcorral","followers_url":"https://api.github.com/users/rcorral/followers","following_url":"https://api.github.com/users/rcorral/following{/other_user}","gists_url":"https://api.github.com/users/rcorral/gists{/gist_id}","starred_url":"https://api.github.com/users/rcorral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcorral/subscriptions","organizations_url":"https://api.github.com/users/rcorral/orgs","repos_url":"https://api.github.com/users/rcorral/repos","events_url":"https://api.github.com/users/rcorral/events{/privacy}","received_events_url":"https://api.github.com/users/rcorral/received_events","type":"User","site_admin":false},"body":"It would be nice to either see this `slice` in a new line like this:\r\n```\r\n})\r\n.slice(1);\r\n```\r\nor assign the result to `map` to a variable and then do the slice in a separate line `return myVar.slice(1);`\r\nOtherwise I find it so easy to have that slice be overlooked.","created_at":"2016-05-03T15:44:32Z","updated_at":"2016-05-03T15:44:32Z","html_url":"https://github.com/dcos/dcos-ui/pull/94#discussion_r61904461","pull_request_url":"https://api.github.com/repos/dcos/dcos-ui/pulls/94","_links":{"self":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/comments/61904461"},"html":{"href":"https://github.com/dcos/dcos-ui/pull/94#discussion_r61904461"},"pull_request":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/94"}}},"pull_request":{"url":"https://api.github.com/repos/dcos/dcos-ui/pulls/94","id":68653255,"html_url":"https://github.com/dcos/dcos-ui/pull/94","diff_url":"https://github.com/dcos/dcos-ui/pull/94.diff","patch_url":"https://github.com/dcos/dcos-ui/pull/94.patch","issue_url":"https://api.github.com/repos/dcos/dcos-ui/issues/94","number":94,"state":"open","locked":false,"title":"Introduce Services Breadcrumb component","user":{"login":"pierlo-upitup","id":1078545,"avatar_url":"https://avatars.githubusercontent.com/u/1078545?v=3","gravatar_id":"","url":"https://api.github.com/users/pierlo-upitup","html_url":"https://github.com/pierlo-upitup","followers_url":"https://api.github.com/users/pierlo-upitup/followers","following_url":"https://api.github.com/users/pierlo-upitup/following{/other_user}","gists_url":"https://api.github.com/users/pierlo-upitup/gists{/gist_id}","starred_url":"https://api.github.com/users/pierlo-upitup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierlo-upitup/subscriptions","organizations_url":"https://api.github.com/users/pierlo-upitup/orgs","repos_url":"https://api.github.com/users/pierlo-upitup/repos","events_url":"https://api.github.com/users/pierlo-upitup/events{/privacy}","received_events_url":"https://api.github.com/users/pierlo-upitup/received_events","type":"User","site_admin":false},"body":"This PR introduces the `ServicesBreadcrumb` component for both the Services list and the Services details page.\r\n\r\nIt's a minimalistic port of the Marathon UI `BreadcrumbComponent`, in that it leaves out the `Volume` and `Task` partials out (both routes are not yet present in DC/OS UI) as well as discarding the collapsible approach completely for the moment. \r\n\r\nAdditionally, instead of introducing new CSS styles, it adopts the already present `.breadcrumbs` behaviour as seen in the Task details sidebar (See `TaskDirectoryView.js`). This means that the result does not match 1:1 the design mockups, which need to be revised anyway (cc @leemunroe).\r\n\r\n![breads](https://cloud.githubusercontent.com/assets/1078545/14973919/4ef733f4-10a3-11e6-9b64-bbc3cc334696.gif)\r\n\r\n\r\n","created_at":"2016-05-03T03:22:17Z","updated_at":"2016-05-03T15:44:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ba7585df45b59ed99e8965782532ece6ef80be27","assignee":{"login":"orlandohohmeier","id":647035,"avatar_url":"https://avatars.githubusercontent.com/u/647035?v=3","gravatar_id":"","url":"https://api.github.com/users/orlandohohmeier","html_url":"https://github.com/orlandohohmeier","followers_url":"https://api.github.com/users/orlandohohmeier/followers","following_url":"https://api.github.com/users/orlandohohmeier/following{/other_user}","gists_url":"https://api.github.com/users/orlandohohmeier/gists{/gist_id}","starred_url":"https://api.github.com/users/orlandohohmeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orlandohohmeier/subscriptions","organizations_url":"https://api.github.com/users/orlandohohmeier/orgs","repos_url":"https://api.github.com/users/orlandohohmeier/repos","events_url":"https://api.github.com/users/orlandohohmeier/events{/privacy}","received_events_url":"https://api.github.com/users/orlandohohmeier/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/dcos/dcos-ui/pulls/94/commits","review_comments_url":"https://api.github.com/repos/dcos/dcos-ui/pulls/94/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/94/comments","statuses_url":"https://api.github.com/repos/dcos/dcos-ui/statuses/e2672a8f3d0fc2551023b39b7c9b3ea79434e9d1","head":{"label":"dcos:feature/services-breadcrumb","ref":"feature/services-breadcrumb","sha":"e2672a8f3d0fc2551023b39b7c9b3ea79434e9d1","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-05-02T15:30:08Z","pushed_at":"2016-05-03T15:21:07Z","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":12135,"stargazers_count":63,"watchers_count":63,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":15,"forks":7,"open_issues":15,"watchers":63,"default_branch":"master"}},"base":{"label":"dcos:feature/unified-ui","ref":"feature/unified-ui","sha":"6f4feda770cb27727af037acd2ac17a25e8b6098","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-05-02T15:30:08Z","pushed_at":"2016-05-03T15:21:07Z","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":12135,"stargazers_count":63,"watchers_count":63,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":15,"forks":7,"open_issues":15,"watchers":63,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/94"},"html":{"href":"https://github.com/dcos/dcos-ui/pull/94"},"issue":{"href":"https://api.github.com/repos/dcos/dcos-ui/issues/94"},"comments":{"href":"https://api.github.com/repos/dcos/dcos-ui/issues/94/comments"},"review_comments":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/94/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/94/commits"},"statuses":{"href":"https://api.github.com/repos/dcos/dcos-ui/statuses/e2672a8f3d0fc2551023b39b7c9b3ea79434e9d1"}}}}