{"action":"created","comment":{"url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/pulls/comments/178635633","pull_request_review_id":108724663,"id":178635633,"diff_hunk":"@@ -1,129 +1,162 @@\n-import { Component, OnInit } from '@angular/core';\n+import { Component, OnInit, OnDestroy } from '@angular/core';\n+\n+import { Subject } from 'rxjs/Subject';\n+import { Subscription } from 'rxjs/Subscription';\n+import { Observable } from 'rxjs/Observable';\n+import 'rxjs/add/operator/do';\n+import 'rxjs/add/operator/takeUntil';\n+import 'rxjs/add/operator/catch';\n+import 'rxjs/add/observable/throw';\n+\n import {\n   FabricExternalIdpSearchService,\n   FabricAuthRoleService,\n   AccessControlConfigService,\n   FabricAuthUserService,\n   FabricAuthGroupService\n } from '../../../services';\n-import {\n-  FabricPrincipal,\n-  Role,\n-  User,\n-  Group,\n-  IdPSearchRequest\n-} from '../../../models';\n+import { IFabricPrincipal, IRole, IUser, IGroup } from '../../../models';\n+import { inherits } from 'util';\n+import { Router } from '@angular/router';\n+\n+interface IRoleModel extends IRole {\n+  selected: boolean;\n+}\n+\n+interface IFabricPrincipalModel extends IFabricPrincipal {\n+  selected: boolean;\n+}\n \n @Component({\n   selector: 'app-member-add',\n   templateUrl: './member-add.component.html',\n-  styleUrls: ['./member-add.component.css']\n+  styleUrls: ['./member-add.component.scss']\n })\n-export class MemberAddComponent implements OnInit {\n-  public searchInput: string;\n-  public principals: Array<FabricPrincipal>;\n-  public selectedPrincipal: FabricPrincipal;\n-  public roles: Array<Role>;\n-  public selectedRoles: Array<Role>;\n+export class MemberAddComponent implements OnInit, OnDestroy {\n+  public principals: Array<IFabricPrincipalModel>;\n+  public roles: Array<IRoleModel>;\n+  public searching = false;\n+\n+  public searchText = new Subject<string>();\n+  private ngUnsubscribe: any = new Subject();\n+  private principalSelected = false;\n \n   constructor(\n     private idpSearchService: FabricExternalIdpSearchService,\n     private roleService: FabricAuthRoleService,\n     private userService: FabricAuthUserService,\n     private configService: AccessControlConfigService,\n-    private groupService: FabricAuthGroupService\n+    private groupService: FabricAuthGroupService,\n+    private router: Router\n   ) {\n-    this.selectedRoles = [];\n   }\n \n   ngOnInit() {\n-    this.getRoles();\n-  }\n+    // Roles\n+    this.roleService\n+      .getRolesBySecurableItemAndGrain(\n+        this.configService.grain,\n+        this.configService.securableItem\n+      )\n+      .takeUntil(this.ngUnsubscribe)\n+      .subscribe(roleResults => {\n+        this.roles = roleResults.map(role => {\n+          // TODO: find user and associated roles on server","path":"Fabric.Authorization.AccessControl/src/app/modules/access-control/member-add/member-add.component.ts","position":83,"original_position":83,"commit_id":"fa03aea8eb5d7a9d8f76a58c379e2b8a1858402a","original_commit_id":"e294ba5e2f1faa0b58539cbdc2f7b63e51a5546d","user":{"login":"kpaul","id":1791420,"avatar_url":"https://avatars3.githubusercontent.com/u/1791420?v=4","gravatar_id":"","url":"https://api.github.com/users/kpaul","html_url":"https://github.com/kpaul","followers_url":"https://api.github.com/users/kpaul/followers","following_url":"https://api.github.com/users/kpaul/following{/other_user}","gists_url":"https://api.github.com/users/kpaul/gists{/gist_id}","starred_url":"https://api.github.com/users/kpaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kpaul/subscriptions","organizations_url":"https://api.github.com/users/kpaul/orgs","repos_url":"https://api.github.com/users/kpaul/repos","events_url":"https://api.github.com/users/kpaul/events{/privacy}","received_events_url":"https://api.github.com/users/kpaul/received_events","type":"User","site_admin":false},"body":"That works for me","created_at":"2018-04-02T20:06:23Z","updated_at":"2018-04-02T20:06:23Z","html_url":"https://github.com/HealthCatalyst/Fabric.Authorization/pull/207#discussion_r178635633","pull_request_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/pulls/207","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/pulls/comments/178635633"},"html":{"href":"https://github.com/HealthCatalyst/Fabric.Authorization/pull/207#discussion_r178635633"},"pull_request":{"href":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/pulls/207"}},"in_reply_to_id":178607345},"pull_request":{"url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/pulls/207","id":178878742,"html_url":"https://github.com/HealthCatalyst/Fabric.Authorization/pull/207","diff_url":"https://github.com/HealthCatalyst/Fabric.Authorization/pull/207.diff","patch_url":"https://github.com/HealthCatalyst/Fabric.Authorization/pull/207.patch","issue_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/issues/207","number":207,"state":"open","locked":false,"title":"member add page and much more","user":{"login":"benjanderson","id":1934453,"avatar_url":"https://avatars2.githubusercontent.com/u/1934453?v=4","gravatar_id":"","url":"https://api.github.com/users/benjanderson","html_url":"https://github.com/benjanderson","followers_url":"https://api.github.com/users/benjanderson/followers","following_url":"https://api.github.com/users/benjanderson/following{/other_user}","gists_url":"https://api.github.com/users/benjanderson/gists{/gist_id}","starred_url":"https://api.github.com/users/benjanderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjanderson/subscriptions","organizations_url":"https://api.github.com/users/benjanderson/orgs","repos_url":"https://api.github.com/users/benjanderson/repos","events_url":"https://api.github.com/users/benjanderson/events{/privacy}","received_events_url":"https://api.github.com/users/benjanderson/received_events","type":"User","site_admin":false},"body":"As there are many changes, I will explain them in the diff as comments","created_at":"2018-04-02T16:54:47Z","updated_at":"2018-04-02T20:06:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cff52903b223d69baf12cda75074e3ed197a3dee","assignee":null,"assignees":[],"requested_reviewers":[{"login":"bsmithvt","id":6453904,"avatar_url":"https://avatars1.githubusercontent.com/u/6453904?v=4","gravatar_id":"","url":"https://api.github.com/users/bsmithvt","html_url":"https://github.com/bsmithvt","followers_url":"https://api.github.com/users/bsmithvt/followers","following_url":"https://api.github.com/users/bsmithvt/following{/other_user}","gists_url":"https://api.github.com/users/bsmithvt/gists{/gist_id}","starred_url":"https://api.github.com/users/bsmithvt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsmithvt/subscriptions","organizations_url":"https://api.github.com/users/bsmithvt/orgs","repos_url":"https://api.github.com/users/bsmithvt/repos","events_url":"https://api.github.com/users/bsmithvt/events{/privacy}","received_events_url":"https://api.github.com/users/bsmithvt/received_events","type":"User","site_admin":false},{"login":"michaelvidal24","id":26312461,"avatar_url":"https://avatars3.githubusercontent.com/u/26312461?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelvidal24","html_url":"https://github.com/michaelvidal24","followers_url":"https://api.github.com/users/michaelvidal24/followers","following_url":"https://api.github.com/users/michaelvidal24/following{/other_user}","gists_url":"https://api.github.com/users/michaelvidal24/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelvidal24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelvidal24/subscriptions","organizations_url":"https://api.github.com/users/michaelvidal24/orgs","repos_url":"https://api.github.com/users/michaelvidal24/repos","events_url":"https://api.github.com/users/michaelvidal24/events{/privacy}","received_events_url":"https://api.github.com/users/michaelvidal24/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/pulls/207/commits","review_comments_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/pulls/207/comments","review_comment_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/issues/207/comments","statuses_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/statuses/fa03aea8eb5d7a9d8f76a58c379e2b8a1858402a","head":{"label":"benjanderson:all-but-grid","ref":"all-but-grid","sha":"fa03aea8eb5d7a9d8f76a58c379e2b8a1858402a","user":{"login":"benjanderson","id":1934453,"avatar_url":"https://avatars2.githubusercontent.com/u/1934453?v=4","gravatar_id":"","url":"https://api.github.com/users/benjanderson","html_url":"https://github.com/benjanderson","followers_url":"https://api.github.com/users/benjanderson/followers","following_url":"https://api.github.com/users/benjanderson/following{/other_user}","gists_url":"https://api.github.com/users/benjanderson/gists{/gist_id}","starred_url":"https://api.github.com/users/benjanderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjanderson/subscriptions","organizations_url":"https://api.github.com/users/benjanderson/orgs","repos_url":"https://api.github.com/users/benjanderson/repos","events_url":"https://api.github.com/users/benjanderson/events{/privacy}","received_events_url":"https://api.github.com/users/benjanderson/received_events","type":"User","site_admin":false},"repo":{"id":126389557,"name":"Fabric.Authorization","full_name":"benjanderson/Fabric.Authorization","owner":{"login":"benjanderson","id":1934453,"avatar_url":"https://avatars2.githubusercontent.com/u/1934453?v=4","gravatar_id":"","url":"https://api.github.com/users/benjanderson","html_url":"https://github.com/benjanderson","followers_url":"https://api.github.com/users/benjanderson/followers","following_url":"https://api.github.com/users/benjanderson/following{/other_user}","gists_url":"https://api.github.com/users/benjanderson/gists{/gist_id}","starred_url":"https://api.github.com/users/benjanderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjanderson/subscriptions","organizations_url":"https://api.github.com/users/benjanderson/orgs","repos_url":"https://api.github.com/users/benjanderson/repos","events_url":"https://api.github.com/users/benjanderson/events{/privacy}","received_events_url":"https://api.github.com/users/benjanderson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/benjanderson/Fabric.Authorization","description":"Permissions service for applications","fork":true,"url":"https://api.github.com/repos/benjanderson/Fabric.Authorization","forks_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/forks","keys_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/keys{/key_id}","collaborators_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/teams","hooks_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/hooks","issue_events_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/issues/events{/number}","events_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/events","assignees_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/assignees{/user}","branches_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/branches{/branch}","tags_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/tags","blobs_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/git/refs{/sha}","trees_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/git/trees{/sha}","statuses_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/statuses/{sha}","languages_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/languages","stargazers_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/stargazers","contributors_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/contributors","subscribers_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/subscribers","subscription_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/subscription","commits_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/commits{/sha}","git_commits_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/git/commits{/sha}","comments_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/comments{/number}","issue_comment_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/issues/comments{/number}","contents_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/contents/{+path}","compare_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/compare/{base}...{head}","merges_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/merges","archive_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/downloads","issues_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/issues{/number}","pulls_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/pulls{/number}","milestones_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/milestones{/number}","notifications_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/labels{/name}","releases_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/releases{/id}","deployments_url":"https://api.github.com/repos/benjanderson/Fabric.Authorization/deployments","created_at":"2018-03-22T20:10:26Z","updated_at":"2018-03-22T20:10:29Z","pushed_at":"2018-04-02T19:56:08Z","git_url":"git://github.com/benjanderson/Fabric.Authorization.git","ssh_url":"git@github.com:benjanderson/Fabric.Authorization.git","clone_url":"https://github.com/benjanderson/Fabric.Authorization.git","svn_url":"https://github.com/benjanderson/Fabric.Authorization","homepage":"","size":3348,"stargazers_count":0,"watchers_count":0,"language":"C#","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"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"HealthCatalyst:master","ref":"master","sha":"1e14a4a6e5b42ad810c456461173e1fe6806f663","user":{"login":"HealthCatalyst","id":27259917,"avatar_url":"https://avatars3.githubusercontent.com/u/27259917?v=4","gravatar_id":"","url":"https://api.github.com/users/HealthCatalyst","html_url":"https://github.com/HealthCatalyst","followers_url":"https://api.github.com/users/HealthCatalyst/followers","following_url":"https://api.github.com/users/HealthCatalyst/following{/other_user}","gists_url":"https://api.github.com/users/HealthCatalyst/gists{/gist_id}","starred_url":"https://api.github.com/users/HealthCatalyst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HealthCatalyst/subscriptions","organizations_url":"https://api.github.com/users/HealthCatalyst/orgs","repos_url":"https://api.github.com/users/HealthCatalyst/repos","events_url":"https://api.github.com/users/HealthCatalyst/events{/privacy}","received_events_url":"https://api.github.com/users/HealthCatalyst/received_events","type":"Organization","site_admin":false},"repo":{"id":90079030,"name":"Fabric.Authorization","full_name":"HealthCatalyst/Fabric.Authorization","owner":{"login":"HealthCatalyst","id":27259917,"avatar_url":"https://avatars3.githubusercontent.com/u/27259917?v=4","gravatar_id":"","url":"https://api.github.com/users/HealthCatalyst","html_url":"https://github.com/HealthCatalyst","followers_url":"https://api.github.com/users/HealthCatalyst/followers","following_url":"https://api.github.com/users/HealthCatalyst/following{/other_user}","gists_url":"https://api.github.com/users/HealthCatalyst/gists{/gist_id}","starred_url":"https://api.github.com/users/HealthCatalyst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HealthCatalyst/subscriptions","organizations_url":"https://api.github.com/users/HealthCatalyst/orgs","repos_url":"https://api.github.com/users/HealthCatalyst/repos","events_url":"https://api.github.com/users/HealthCatalyst/events{/privacy}","received_events_url":"https://api.github.com/users/HealthCatalyst/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HealthCatalyst/Fabric.Authorization","description":"Permissions service for applications","fork":false,"url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization","forks_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/forks","keys_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/teams","hooks_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/hooks","issue_events_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/issues/events{/number}","events_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/events","assignees_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/assignees{/user}","branches_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/branches{/branch}","tags_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/tags","blobs_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/git/refs{/sha}","trees_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/statuses/{sha}","languages_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/languages","stargazers_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/stargazers","contributors_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/contributors","subscribers_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/subscribers","subscription_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/subscription","commits_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/commits{/sha}","git_commits_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/git/commits{/sha}","comments_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/comments{/number}","issue_comment_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/issues/comments{/number}","contents_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/contents/{+path}","compare_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/merges","archive_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/downloads","issues_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/issues{/number}","pulls_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/pulls{/number}","milestones_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/milestones{/number}","notifications_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/labels{/name}","releases_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/releases{/id}","deployments_url":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/deployments","created_at":"2017-05-02T21:20:07Z","updated_at":"2018-04-02T18:07:39Z","pushed_at":"2018-04-02T19:56:10Z","git_url":"git://github.com/HealthCatalyst/Fabric.Authorization.git","ssh_url":"git@github.com:HealthCatalyst/Fabric.Authorization.git","clone_url":"https://github.com/HealthCatalyst/Fabric.Authorization.git","svn_url":"https://github.com/HealthCatalyst/Fabric.Authorization","homepage":"","size":3336,"stargazers_count":5,"watchers_count":5,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":6,"open_issues":5,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/pulls/207"},"html":{"href":"https://github.com/HealthCatalyst/Fabric.Authorization/pull/207"},"issue":{"href":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/issues/207"},"comments":{"href":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/issues/207/comments"},"review_comments":{"href":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/pulls/207/comments"},"review_comment":{"href":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/pulls/207/commits"},"statuses":{"href":"https://api.github.com/repos/HealthCatalyst/Fabric.Authorization/statuses/fa03aea8eb5d7a9d8f76a58c379e2b8a1858402a"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"kpaul"}}