From 94d195ab570885ad7ec65abbfd7e92bdab7e2e06 Mon Sep 17 00:00:00 2001 From: Andrew Schlackman <72105194+sei-aschlackman@users.noreply.github.com> Date: Thu, 23 May 2024 09:36:34 -0400 Subject: [PATCH] update user follow to filter by team (#662) --- .../user-follow-page.component.ts | 9 ++++++--- src/app/services/signalr/signalr.service.ts | 15 ++++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/app/components/user-follow-page/user-follow-page.component.ts b/src/app/components/user-follow-page/user-follow-page.component.ts index f677e00..0ec1322 100644 --- a/src/app/components/user-follow-page/user-follow-page.component.ts +++ b/src/app/components/user-follow-page/user-follow-page.component.ts @@ -53,11 +53,14 @@ export class UserFollowPageComponent implements OnInit, OnDestroy { ngOnInit() { const userId = this.routerQuery.getParams('userId'); const viewId = this.routerQuery.getParams('viewId'); + const teamId = this.routerQuery.getQueryParams('teamId'); this.signalrRService.startConnection().then(() => { - this.signalrRService.joinUser(userId, viewId).then((vmUser: VmUser) => { - this.vmUser = vmUser; - }); + this.signalrRService + .joinUser(userId, viewId, teamId) + .then((vmUser: VmUser) => { + this.vmUser = vmUser; + }); }); this.userQuery diff --git a/src/app/services/signalr/signalr.service.ts b/src/app/services/signalr/signalr.service.ts index 2e5815b..2d36ba5 100644 --- a/src/app/services/signalr/signalr.service.ts +++ b/src/app/services/signalr/signalr.service.ts @@ -8,7 +8,6 @@ import { ComnAuthService } from '@cmusei/crucible-common'; import * as signalR from '@microsoft/signalr'; import { BehaviorSubject, Observable } from 'rxjs'; import { BASE_PATH, VmUser } from '../../generated/vm-api'; -import { UserQuery } from '../../state/user/user.query'; import { UserService } from '../../state/user/user.service'; import { VsphereService } from '../../state/vsphere/vsphere.service'; @@ -22,6 +21,7 @@ export class SignalRService { private userId: string; private viewId: string; + private teamId: string; private vmId: string; private activeVmId: string; @@ -76,8 +76,8 @@ export class SignalRService { } private joinGroups() { - if (this.userId && this.viewId) { - this.joinUser(this.userId, this.viewId); + if (this.userId && this.viewId && this.teamId) { + this.joinUser(this.userId, this.viewId, this.teamId); } if (this.activeVmId) { @@ -89,13 +89,18 @@ export class SignalRService { } } - public joinUser(userId: string, viewId: string): Promise { + public joinUser( + userId: string, + viewId: string, + teamId: string, + ): Promise { this.userId = userId; this.viewId = viewId; + this.teamId = teamId; return this.startConnection().then(() => { return this.hubConnection - .invoke('JoinUser', userId, viewId) + .invoke('JoinUser', userId, viewId, teamId) .then((vmUser: VmUser) => { const user = { id: vmUser.userId, name: vmUser.username }; this.userService.add(user);