{"action":"created","comment":{"url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/comments/205464613","pull_request_review_id":140737512,"id":205464613,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTQ2NDYxMw==","diff_hunk":"@@ -0,0 +1,82 @@\n+import {\n+  Component,\n+  ErrorHandler,\n+  Input,\n+  OnInit\n+} from '@angular/core';\n+import { Router } from '@angular/router';\n+import { uniqWith } from 'lodash';\n+import {\n+  Observable,\n+  ReplaySubject,\n+  Subject\n+} from 'rxjs';\n+\n+import {\n+  Broadcaster,\n+  Logger\n+} from 'ngx-base';\n+import {\n+  Context,\n+  Contexts,\n+  Space,\n+  Spaces,\n+  SpaceService\n+} from 'ngx-fabric8-wit';\n+\n+@Component({\n+  selector: 'fabric8-recent-spaces-widget',\n+  templateUrl: './recent-spaces-widget.component.html'\n+})\n+export class RecentSpacesWidget implements OnInit {\n+\n+  @Input() cardSizeClass: string;\n+\n+  readonly userHasSpaces: Subject<boolean> = new ReplaySubject<boolean>(1);\n+  readonly recentSpaces: Observable<Space[]>;\n+\n+  constructor(\n+    private contexts: Contexts,\n+    private spaces: Spaces,\n+    private spaceService: SpaceService,\n+    private router: Router,\n+    private errorHandler: ErrorHandler,\n+    private broadcaster: Broadcaster,\n+    private logger: Logger\n+  ) {\n+    this.recentSpaces = this.spaces.recent\n+      .map((spaces: Space[]): Space[] => uniqWith(spaces, RecentSpacesWidget.compareSpaces));\n+  }\n+\n+  ngOnInit(): void {\n+    (this.router.url.startsWith('/_home') ? this.contexts.default : this.contexts.current)\n+      .first()\n+      .flatMap((context: Context): Observable<Context> => {\n+        if (context && context.user) {\n+          return Observable.of(context);\n+        } else {\n+          return Observable.throw('Failed to retrieve list of spaces owned by user');\n+        }\n+      })\n+      .flatMap((context: Context): Observable<boolean> => this.spaceService\n+        .getSpacesByUser(context.user.attributes.username)\n+        .map((spaces: Space[]): boolean => spaces.length > 0)","path":"src/app/home/recent-spaces-widget/recent-spaces-widget.component.ts","position":null,"original_position":63,"commit_id":"d85f39ddc234e94aab8365d5124eb166c004722c","original_commit_id":"673aa966517f66d4cee7207eca5fa310765cb9bc","user":{"login":"dlabrecq","id":17481322,"node_id":"MDQ6VXNlcjE3NDgxMzIy","avatar_url":"https://avatars2.githubusercontent.com/u/17481322?v=4","gravatar_id":"","url":"https://api.github.com/users/dlabrecq","html_url":"https://github.com/dlabrecq","followers_url":"https://api.github.com/users/dlabrecq/followers","following_url":"https://api.github.com/users/dlabrecq/following{/other_user}","gists_url":"https://api.github.com/users/dlabrecq/gists{/gist_id}","starred_url":"https://api.github.com/users/dlabrecq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlabrecq/subscriptions","organizations_url":"https://api.github.com/users/dlabrecq/orgs","repos_url":"https://api.github.com/users/dlabrecq/repos","events_url":"https://api.github.com/users/dlabrecq/events{/privacy}","received_events_url":"https://api.github.com/users/dlabrecq/received_events","type":"User","site_admin":false},"body":"Sounds good to me","created_at":"2018-07-26T13:52:07Z","updated_at":"2018-07-26T13:52:07Z","html_url":"https://github.com/fabric8-ui/fabric8-ui/pull/3166#discussion_r205464613","pull_request_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/3166","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/comments/205464613"},"html":{"href":"https://github.com/fabric8-ui/fabric8-ui/pull/3166#discussion_r205464613"},"pull_request":{"href":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/3166"}},"in_reply_to_id":203715073},"pull_request":{"url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/3166","id":202050275,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyMDUwMjc1","html_url":"https://github.com/fabric8-ui/fabric8-ui/pull/3166","diff_url":"https://github.com/fabric8-ui/fabric8-ui/pull/3166.diff","patch_url":"https://github.com/fabric8-ui/fabric8-ui/pull/3166.patch","issue_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/issues/3166","number":3166,"state":"open","locked":false,"title":"Recent spaces widget","user":{"login":"andrewazores","id":3787464,"node_id":"MDQ6VXNlcjM3ODc0NjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/3787464?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewazores","html_url":"https://github.com/andrewazores","followers_url":"https://api.github.com/users/andrewazores/followers","following_url":"https://api.github.com/users/andrewazores/following{/other_user}","gists_url":"https://api.github.com/users/andrewazores/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewazores/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewazores/subscriptions","organizations_url":"https://api.github.com/users/andrewazores/orgs","repos_url":"https://api.github.com/users/andrewazores/repos","events_url":"https://api.github.com/users/andrewazores/events{/privacy}","received_events_url":"https://api.github.com/users/andrewazores/received_events","type":"User","site_admin":false},"body":"This PR includes several refactoring commits, a test addition commit, and one commit that should address a simple recent bug report [0].\r\n\r\n[0] https://github.com/openshiftio/openshift.io/issues/4003","created_at":"2018-07-17T19:50:32Z","updated_at":"2018-07-26T13:52:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5e0eedb120830be84783495421866b2773eefd97","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/3166/commits","review_comments_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/3166/comments","review_comment_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/issues/3166/comments","statuses_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/statuses/d85f39ddc234e94aab8365d5124eb166c004722c","head":{"label":"andrewazores:recent-spaces-widget","ref":"recent-spaces-widget","sha":"d85f39ddc234e94aab8365d5124eb166c004722c","user":{"login":"andrewazores","id":3787464,"node_id":"MDQ6VXNlcjM3ODc0NjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/3787464?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewazores","html_url":"https://github.com/andrewazores","followers_url":"https://api.github.com/users/andrewazores/followers","following_url":"https://api.github.com/users/andrewazores/following{/other_user}","gists_url":"https://api.github.com/users/andrewazores/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewazores/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewazores/subscriptions","organizations_url":"https://api.github.com/users/andrewazores/orgs","repos_url":"https://api.github.com/users/andrewazores/repos","events_url":"https://api.github.com/users/andrewazores/events{/privacy}","received_events_url":"https://api.github.com/users/andrewazores/received_events","type":"User","site_admin":false},"repo":{"id":109168918,"node_id":"MDEwOlJlcG9zaXRvcnkxMDkxNjg5MTg=","name":"fabric8-ui","full_name":"andrewazores/fabric8-ui","owner":{"login":"andrewazores","id":3787464,"node_id":"MDQ6VXNlcjM3ODc0NjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/3787464?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewazores","html_url":"https://github.com/andrewazores","followers_url":"https://api.github.com/users/andrewazores/followers","following_url":"https://api.github.com/users/andrewazores/following{/other_user}","gists_url":"https://api.github.com/users/andrewazores/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewazores/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewazores/subscriptions","organizations_url":"https://api.github.com/users/andrewazores/orgs","repos_url":"https://api.github.com/users/andrewazores/repos","events_url":"https://api.github.com/users/andrewazores/events{/privacy}","received_events_url":"https://api.github.com/users/andrewazores/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andrewazores/fabric8-ui","description":"The Angular frontend for fabric8 online (OpenShift.IO)","fork":true,"url":"https://api.github.com/repos/andrewazores/fabric8-ui","forks_url":"https://api.github.com/repos/andrewazores/fabric8-ui/forks","keys_url":"https://api.github.com/repos/andrewazores/fabric8-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andrewazores/fabric8-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andrewazores/fabric8-ui/teams","hooks_url":"https://api.github.com/repos/andrewazores/fabric8-ui/hooks","issue_events_url":"https://api.github.com/repos/andrewazores/fabric8-ui/issues/events{/number}","events_url":"https://api.github.com/repos/andrewazores/fabric8-ui/events","assignees_url":"https://api.github.com/repos/andrewazores/fabric8-ui/assignees{/user}","branches_url":"https://api.github.com/repos/andrewazores/fabric8-ui/branches{/branch}","tags_url":"https://api.github.com/repos/andrewazores/fabric8-ui/tags","blobs_url":"https://api.github.com/repos/andrewazores/fabric8-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andrewazores/fabric8-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andrewazores/fabric8-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/andrewazores/fabric8-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andrewazores/fabric8-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/andrewazores/fabric8-ui/languages","stargazers_url":"https://api.github.com/repos/andrewazores/fabric8-ui/stargazers","contributors_url":"https://api.github.com/repos/andrewazores/fabric8-ui/contributors","subscribers_url":"https://api.github.com/repos/andrewazores/fabric8-ui/subscribers","subscription_url":"https://api.github.com/repos/andrewazores/fabric8-ui/subscription","commits_url":"https://api.github.com/repos/andrewazores/fabric8-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/andrewazores/fabric8-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/andrewazores/fabric8-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/andrewazores/fabric8-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/andrewazores/fabric8-ui/contents/{+path}","compare_url":"https://api.github.com/repos/andrewazores/fabric8-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andrewazores/fabric8-ui/merges","archive_url":"https://api.github.com/repos/andrewazores/fabric8-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andrewazores/fabric8-ui/downloads","issues_url":"https://api.github.com/repos/andrewazores/fabric8-ui/issues{/number}","pulls_url":"https://api.github.com/repos/andrewazores/fabric8-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/andrewazores/fabric8-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/andrewazores/fabric8-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andrewazores/fabric8-ui/labels{/name}","releases_url":"https://api.github.com/repos/andrewazores/fabric8-ui/releases{/id}","deployments_url":"https://api.github.com/repos/andrewazores/fabric8-ui/deployments","created_at":"2017-11-01T18:38:13Z","updated_at":"2018-07-25T16:11:30Z","pushed_at":"2018-07-26T13:37:38Z","git_url":"git://github.com/andrewazores/fabric8-ui.git","ssh_url":"git@github.com:andrewazores/fabric8-ui.git","clone_url":"https://github.com/andrewazores/fabric8-ui.git","svn_url":"https://github.com/andrewazores/fabric8-ui","homepage":"https://openshift.io/","size":14770,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fabric8-ui:master","ref":"master","sha":"5e2074265445165adf27759fb4d42a7296b01c50","user":{"login":"fabric8-ui","id":25244298,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MjQ0Mjk4","avatar_url":"https://avatars2.githubusercontent.com/u/25244298?v=4","gravatar_id":"","url":"https://api.github.com/users/fabric8-ui","html_url":"https://github.com/fabric8-ui","followers_url":"https://api.github.com/users/fabric8-ui/followers","following_url":"https://api.github.com/users/fabric8-ui/following{/other_user}","gists_url":"https://api.github.com/users/fabric8-ui/gists{/gist_id}","starred_url":"https://api.github.com/users/fabric8-ui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabric8-ui/subscriptions","organizations_url":"https://api.github.com/users/fabric8-ui/orgs","repos_url":"https://api.github.com/users/fabric8-ui/repos","events_url":"https://api.github.com/users/fabric8-ui/events{/privacy}","received_events_url":"https://api.github.com/users/fabric8-ui/received_events","type":"Organization","site_admin":false},"repo":{"id":73824736,"node_id":"MDEwOlJlcG9zaXRvcnk3MzgyNDczNg==","name":"fabric8-ui","full_name":"fabric8-ui/fabric8-ui","owner":{"login":"fabric8-ui","id":25244298,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MjQ0Mjk4","avatar_url":"https://avatars2.githubusercontent.com/u/25244298?v=4","gravatar_id":"","url":"https://api.github.com/users/fabric8-ui","html_url":"https://github.com/fabric8-ui","followers_url":"https://api.github.com/users/fabric8-ui/followers","following_url":"https://api.github.com/users/fabric8-ui/following{/other_user}","gists_url":"https://api.github.com/users/fabric8-ui/gists{/gist_id}","starred_url":"https://api.github.com/users/fabric8-ui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabric8-ui/subscriptions","organizations_url":"https://api.github.com/users/fabric8-ui/orgs","repos_url":"https://api.github.com/users/fabric8-ui/repos","events_url":"https://api.github.com/users/fabric8-ui/events{/privacy}","received_events_url":"https://api.github.com/users/fabric8-ui/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fabric8-ui/fabric8-ui","description":"The Angular frontend for fabric8 online (OpenShift.IO)","fork":false,"url":"https://api.github.com/repos/fabric8-ui/fabric8-ui","forks_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/forks","keys_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/teams","hooks_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/hooks","issue_events_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/issues/events{/number}","events_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/events","assignees_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/assignees{/user}","branches_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/branches{/branch}","tags_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/tags","blobs_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/languages","stargazers_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/stargazers","contributors_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/contributors","subscribers_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/subscribers","subscription_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/subscription","commits_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/contents/{+path}","compare_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/merges","archive_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/downloads","issues_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/issues{/number}","pulls_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/labels{/name}","releases_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/releases{/id}","deployments_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/deployments","created_at":"2016-11-15T15:04:11Z","updated_at":"2018-07-25T16:44:40Z","pushed_at":"2018-07-26T13:50:39Z","git_url":"git://github.com/fabric8-ui/fabric8-ui.git","ssh_url":"git@github.com:fabric8-ui/fabric8-ui.git","clone_url":"https://github.com/fabric8-ui/fabric8-ui.git","svn_url":"https://github.com/fabric8-ui/fabric8-ui","homepage":"https://openshift.io/","size":14754,"stargazers_count":22,"watchers_count":22,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":84,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":84,"open_issues":17,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/3166"},"html":{"href":"https://github.com/fabric8-ui/fabric8-ui/pull/3166"},"issue":{"href":"https://api.github.com/repos/fabric8-ui/fabric8-ui/issues/3166"},"comments":{"href":"https://api.github.com/repos/fabric8-ui/fabric8-ui/issues/3166/comments"},"review_comments":{"href":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/3166/comments"},"review_comment":{"href":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/3166/commits"},"statuses":{"href":"https://api.github.com/repos/fabric8-ui/fabric8-ui/statuses/d85f39ddc234e94aab8365d5124eb166c004722c"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"dlabrecq"}}