From 4ec38bc2d89db5127c97308e7dcf58b1ab2d7bd4 Mon Sep 17 00:00:00 2001 From: Ritik Ramuka <56073559+ritikramuka@users.noreply.github.com> Date: Tue, 9 Apr 2024 16:40:46 +0530 Subject: [PATCH] Refactor WebExtensionContext to use _connectionData instead of _entityId in connectedUsersMap (#895) * Refactor QuickPickProvider and WebExtensionContext to use _connectionData instead of _entityId in connectedUsersMap * Refactor WebExtensionContext to use _connectionData instead of _entityId in connectedUsersMap * Merge Conflict Resolved * Fix indentation in UserData class --- src/web/client/WebExtensionContext.ts | 2 -- src/web/client/common/worker/webworker.js | 10 ---------- src/web/client/context/userDataMap.ts | 8 -------- src/web/client/extension.ts | 1 - 4 files changed, 21 deletions(-) diff --git a/src/web/client/WebExtensionContext.ts b/src/web/client/WebExtensionContext.ts index c54d7438..20132c6e 100644 --- a/src/web/client/WebExtensionContext.ts +++ b/src/web/client/WebExtensionContext.ts @@ -776,14 +776,12 @@ class WebExtensionContext implements IWebExtensionContext { containerId: string, userName: string, userId: string, - entityId: string[], connectionData: IConnectionData[], ) { this.connectedUsers.setUserData( containerId, userName, userId, - entityId, connectionData ); } diff --git a/src/web/client/common/worker/webworker.js b/src/web/client/common/worker/webworker.js index 813af596..5deeb6da 100644 --- a/src/web/client/common/worker/webworker.js +++ b/src/web/client/common/worker/webworker.js @@ -119,7 +119,6 @@ async function loadContainer(config, swpId, entityInfo) { .getMembers() .get(user.userId).connections; - const userEntityIdArray = []; const userConnectionData = []; const connectionIdInContainer = await map @@ -127,9 +126,6 @@ async function loadContainer(config, swpId, entityInfo) { .get(); userConnections.forEach((connection) => { - userEntityIdArray.push( - connectionIdInContainer.get(connection.id) - ); userConnectionData.push({ connectionId: connection.id, entityId: connectionIdInContainer.get(connection.id) }); }); @@ -139,7 +135,6 @@ async function loadContainer(config, swpId, entityInfo) { userId: user.aadObjectId, userName: user.userName, containerId: swpId, - entityId: userEntityIdArray, connectionData: userConnectionData, }); @@ -180,7 +175,6 @@ async function loadContainer(config, swpId, entityInfo) { .getMembers() .get(user.userId).connections; - const userEntityIdArray = []; const userConnectionData = []; const connectionIdInContainer = await map @@ -188,9 +182,6 @@ async function loadContainer(config, swpId, entityInfo) { .get(); userConnections.forEach((connection) => { - userEntityIdArray.push( - connectionIdInContainer.get(connection.id) - ); userConnectionData.push({ connectionId: connection.id, entityId: connectionIdInContainer.get(connection.id) }); }); @@ -200,7 +191,6 @@ async function loadContainer(config, swpId, entityInfo) { userId: user.aadObjectId, userName: user.userName, containerId: swpId, - entityId: userEntityIdArray, connectionData: userConnectionData, }); diff --git a/src/web/client/context/userDataMap.ts b/src/web/client/context/userDataMap.ts index 41d5f22d..4ccde7ba 100644 --- a/src/web/client/context/userDataMap.ts +++ b/src/web/client/context/userDataMap.ts @@ -18,7 +18,6 @@ export class UserData implements IUserData { _containerId: string; _userName: string; _userId: string; - _entityId: string[]; _connectionData: IConnectionData[]; // Getters @@ -31,9 +30,6 @@ export class UserData implements IUserData { public get userId(): string { return this._userId; } - public get entityId(): string[] { - return this._entityId; - } public get connectionData(): IConnectionData[] { return this._connectionData; } @@ -47,13 +43,11 @@ export class UserData implements IUserData { containerId: string, userName: string, userId: string, - entityId: string[], connectionData: IConnectionData[] ) { this._containerId = containerId; this._userName = userName; this._userId = userId; - this._entityId = entityId; this._connectionData = connectionData; } } @@ -69,14 +63,12 @@ export class UserDataMap { containerId: string, userName: string, userId: string, - entityId: string[], connectionData: IConnectionData[] ) { const userData = new UserData( containerId, userName, userId, - entityId, connectionData ); diff --git a/src/web/client/extension.ts b/src/web/client/extension.ts index dd5e82c3..da49d52b 100644 --- a/src/web/client/extension.ts +++ b/src/web/client/extension.ts @@ -396,7 +396,6 @@ export function createWebWorkerInstance( data.containerId, data.userName, data.userId, - data.entityId, data.connectionData ); WebExtensionContext.userCollaborationProvider.refresh();