Skip to content

Commit

Permalink
Merge branch 'main' into users/biddas/UserAgent
Browse files Browse the repository at this point in the history
  • Loading branch information
BidishaMS authored Apr 22, 2024
2 parents 3b4ab5e + af0a56c commit 8571752
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/web/client/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -684,4 +683,4 @@ function logOneDSLogger (queryParamsMap: Map<string, string>) {
telemetryData.properties.entityId = queryParamsMap.get(queryParameters.ENTITY_ID);
}
oneDSLoggerWrapper.getLogger().traceInfo(telemetryData.eventName, telemetryData.properties);
}
}
9 changes: 6 additions & 3 deletions src/web/client/utilities/fileAndEntityUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
13 changes: 11 additions & 2 deletions src/web/client/webViews/QuickPickProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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) {
Expand Down

0 comments on commit 8571752

Please sign in to comment.