diff --git a/src/web/client/extension.ts b/src/web/client/extension.ts index 8619b626..dba6862d 100644 --- a/src/web/client/extension.ts +++ b/src/web/client/extension.ts @@ -347,7 +347,6 @@ export function processWillSaveDocument(context: vscode.ExtensionContext) { } export function processWillStartCollaboration(context: vscode.ExtensionContext) { - // feature in progress, hence disabling it if (isCoPresenceEnabled()) { registerCollaborationView(); vscode.commands.registerCommand('powerPlatform.previewCurrentActiveUsers', () => WebExtensionContext.quickPickProvider.showQuickPick()); @@ -684,4 +683,4 @@ function logOneDSLogger (queryParamsMap: Map) { telemetryData.properties.entityId = queryParamsMap.get(queryParameters.ENTITY_ID); } oneDSLoggerWrapper.getLogger().traceInfo(telemetryData.eventName, telemetryData.properties); -} \ No newline at end of file +} diff --git a/src/web/client/utilities/fileAndEntityUtil.ts b/src/web/client/utilities/fileAndEntityUtil.ts index 303d96ff..b18ec77a 100644 --- a/src/web/client/utilities/fileAndEntityUtil.ts +++ b/src/web/client/utilities/fileAndEntityUtil.ts @@ -31,13 +31,16 @@ export function getFileEntityName(fileFsPath: string) { export function getFileRootWebPageId(fileFsPath: string) { const entityId = getFileEntityId(fileFsPath); - return ( + + const rootWebPageId = (WebExtensionContext.entityDataMap.getEntityMap.get(entityId) ?.rootWebPageId as string) ?? (WebExtensionContext.getVscodeWorkspaceState(fileFsPath) ?.rootWebPageId as string) ?? - "" - ); + ""; + + // If rootWebPageId is not present, return entityId as content is not localized + return rootWebPageId !== "" ? rootWebPageId : entityId; } export function getFileAttributePath(fileFsPath: string) { diff --git a/src/web/client/webViews/QuickPickProvider.ts b/src/web/client/webViews/QuickPickProvider.ts index 0f33fa53..cf2e6507 100644 --- a/src/web/client/webViews/QuickPickProvider.ts +++ b/src/web/client/webViews/QuickPickProvider.ts @@ -44,7 +44,8 @@ export class QuickPickProvider { if (connection.connectionId !== WebExtensionContext.currentConnectionId) { const contentPageId = WebExtensionContext.entityForeignKeyDataMap.getEntityForeignKeyMap.get(`${connection.entityId[0]}`); - if (contentPageId && contentPageId.has(`${entityInfo.entityId}`)) { + // if content is localized, then check for the content page id + if ((connection.entityId[0] === entityInfo.entityId) || (contentPageId && contentPageId.has(`${entityInfo.entityId}`))) { userMap.set(value._userId, { label: value._userName, id: value._userId, @@ -62,9 +63,17 @@ export class QuickPickProvider { }]; } + private getLength(): number { + if (this.items.length === 1 && this.items[0].label === Constants.WEB_EXTENSION_QUICK_PICK_DEFAULT_STRING) { + return 0; + } + + return this.items.length; + } + public async showQuickPick() { const selectedUser = await vscode.window.showQuickPick(this.items, { - title: vscode.l10n.t(Constants.WEB_EXTENSION_QUICK_PICK_TITLE.toUpperCase() + ` (${this.items.length})`), + title: vscode.l10n.t(Constants.WEB_EXTENSION_QUICK_PICK_TITLE.toUpperCase() + ` (${this.getLength()})`), placeHolder: vscode.l10n.t(Constants.WEB_EXTENSION_QUICK_PICK_PLACEHOLDER), }); if (selectedUser) {