diff --git a/l10n/bundle.l10n.json b/l10n/bundle.l10n.json index 35cb416d..ae83646d 100644 --- a/l10n/bundle.l10n.json +++ b/l10n/bundle.l10n.json @@ -114,6 +114,10 @@ "Do not translate 'dotnet' or 'sdk'" ] }, + "The extension Microsoft Edge Tools is required to run this command. Do you want to install it now?": "The extension Microsoft Edge Tools is required to run this command. Do you want to install it now?", + "Install": "Install", + "No workspace folder is open.": "No workspace folder is open.", + "Failed to update launch.json: ${0}": "Failed to update launch.json: ${0}", "File might be referenced by name {0} here./{0} represents the name of the file": { "message": "File might be referenced by name {0} here.", "comment": [ diff --git a/loc/translations-export/vscode-powerplatform.xlf b/loc/translations-export/vscode-powerplatform.xlf index e324304d..52154e12 100644 --- a/loc/translations-export/vscode-powerplatform.xlf +++ b/loc/translations-export/vscode-powerplatform.xlf @@ -159,6 +159,9 @@ The {3} represents Solution's Type (Managed or Unmanaged), but that test is loca Failed to get file ready for edit: {0} + + Failed to update launch.json: ${0} + Feature is not enabled for this geo. @@ -208,6 +211,9 @@ Return to this chat and @powerpages can help you write and edit your website cod Insert code into editor + + Install + Installing Power Pages generator(v{0})... {0} represents the version number @@ -285,6 +291,9 @@ The {3} represents Dataverse Environment's Organization ID (GUID) No workspace folder found + + No workspace folder is open. + One or more attribute names have been changed or removed. Contact your admin. @@ -382,6 +391,9 @@ The {3} represents Dataverse Environment's Organization ID (GUID) The Power Pages generator is ready for use in your VS Code extension! + + The extension Microsoft Edge Tools is required to run this command. Do you want to install it now? + The name you want to give to this authentication profile diff --git a/src/client/extension.ts b/src/client/extension.ts index f023958c..e46ddeb5 100644 --- a/src/client/extension.ts +++ b/src/client/extension.ts @@ -40,15 +40,12 @@ import { ActiveOrgOutput } from "./pac/PacTypes"; import { desktopTelemetryEventNames } from "../common/OneDSLoggerTelemetry/client/desktopExtensionTelemetryEventNames"; import { ArtemisService } from "../common/services/ArtemisService"; import { workspaceContainsPortalConfigFolder } from "../common/utilities/PathFinderUtil"; -import { getPortalsOrgURLs, getWebsiteRecordID } from "../common/utilities/WorkspaceInfoFinderUtil"; +import { getPortalsOrgURLs } from "../common/utilities/WorkspaceInfoFinderUtil"; import { EXTENSION_ID, SUCCESS } from "../common/constants"; import { AadIdKey, EnvIdKey, TenantIdKey } from "../common/OneDSLoggerTelemetry/telemetryConstants"; import { PowerPagesAppName, PowerPagesClientName } from "../common/ecs-features/constants"; import { ECSFeaturesClient } from "../common/ecs-features/ecsFeatureClient"; import { getECSOrgLocationValue } from "../common/utilities/Utils"; -import { ServiceEndpointCategory } from "../common/services/Constants"; -import { PPAPIService } from "../common/services/PPAPIService"; -import { EnableSiteRuntimePreview } from "../common/ecs-features/ecsFeatureGates"; import { PreviewSite } from "./runtimeSitePreview/PreviewSite"; let client: LanguageClient; diff --git a/src/client/runtimeSitePreview/LaunchJsonHelper.ts b/src/client/runtimeSitePreview/LaunchJsonHelper.ts index f592aef4..9fc29b20 100644 --- a/src/client/runtimeSitePreview/LaunchJsonHelper.ts +++ b/src/client/runtimeSitePreview/LaunchJsonHelper.ts @@ -84,7 +84,7 @@ export async function updateLaunchJsonConfig(url: string): Promise { } catch (e) { if(e instanceof Error) { vscode.window.showErrorMessage( - vscode.l10n.t(`Failed to update launch.json: ${e.message}`)); + vscode.l10n.t("Failed to update launch.json: ${0}", e.message)); } } } diff --git a/src/client/runtimeSitePreview/PreviewSite.ts b/src/client/runtimeSitePreview/PreviewSite.ts index a4cb1cf1..f55f08d2 100644 --- a/src/client/runtimeSitePreview/PreviewSite.ts +++ b/src/client/runtimeSitePreview/PreviewSite.ts @@ -14,6 +14,7 @@ import { WorkspaceFolder } from 'vscode-languageclient/node'; import { getWebsiteRecordID } from '../../common/utilities/WorkspaceInfoFinderUtil'; import { ServiceEndpointCategory } from '../../common/services/Constants'; import { PPAPIService } from '../../common/services/PPAPIService'; +import { VSCODE_EXTENSION_GET_WEBSITE_RECORD_ID_EMPTY } from '../../common/services/TelemetryConstants'; export class PreviewSite { @@ -30,6 +31,12 @@ export class PreviewSite { static async getWebSiteURL(workspaceFolders: WorkspaceFolder[], stamp: ServiceEndpointCategory, envId: string, telemetry: ITelemetry): Promise { const websiteRecordId = getWebsiteRecordID(workspaceFolders, telemetry); + if (!websiteRecordId) { + telemetry.sendTelemetryEvent(VSCODE_EXTENSION_GET_WEBSITE_RECORD_ID_EMPTY, { + websiteRecordId: websiteRecordId + }); + return ""; + } const websiteDetails = await PPAPIService.getWebsiteDetailsByWebsiteRecordId(stamp, envId, websiteRecordId, telemetry); return websiteDetails?.websiteUrl || ""; } @@ -84,11 +91,11 @@ export class PreviewSite { } else { const install = await vscode.window.showWarningMessage( vscode.l10n.t( - `The extension "${edgeToolsExtensionId}" is required to run this command. Do you want to install it now?`, + `The extension Microsoft Edge Tools is required to run this command. Do you want to install it now?`, 'Install', 'Cancel' )); - if (install === 'Install') { + if (install === vscode.l10n.t('Install')) { // Open the Extensions view with the specific extension vscode.commands.executeCommand('workbench.extensions.search', edgeToolsExtensionId); } diff --git a/src/common/services/TelemetryConstants.ts b/src/common/services/TelemetryConstants.ts index a9ba5570..cbeb55cb 100644 --- a/src/common/services/TelemetryConstants.ts +++ b/src/common/services/TelemetryConstants.ts @@ -27,3 +27,4 @@ export const VSCODE_EXTENSION_PPAPI_GET_WEBSITE_BY_ID_FAILED = "VSCodeExtensionP export const VSCODE_EXTENSION_SERVICE_STAMP_NOT_FOUND = "VSCodeExtensionServiceStampNotFound"; export const VSCODE_EXTENSION_PPAPI_GET_WEBSITE_DETAILS_FAILED = "VSCodeExtensionPPAPIGetWebsiteDetailsFailed"; export const VSCODE_EXTENSION_PPAPI_GET_WEBSITE_BY_RECORD_ID_COMPLETED = "VSCodeExtensionPPAPIGetWebsiteByRecordIdCompleted"; +export const VSCODE_EXTENSION_GET_WEBSITE_RECORD_ID_EMPTY = "VSCodeExtensionGetWebsiteRecordIdEmpty";