Skip to content

Commit a82f277

Browse files
authored
Add sovereign cloud endpoints for PPAPI service (#1081)
1 parent 8c7d844 commit a82f277

File tree

12 files changed

+313
-165
lines changed

12 files changed

+313
-165
lines changed

l10n/bundle.l10n.json

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
},
3434
"Enter the environment URL": "Enter the environment URL",
3535
"Active auth profile is not found or has expired. To create a new auth profile, enter the environment URL.": "Active auth profile is not found or has expired. To create a new auth profile, enter the environment URL.",
36-
"Website not found in the environment. Please check the credentials and root folder path.": "Website not found in the environment. Please check the credentials and root folder path.",
3736
"Selection is empty.": "Selection is empty.",
3837
"PREVIEW": "PREVIEW",
3938
"Explain the following code snippet:": "Explain the following code snippet:",
@@ -93,13 +92,25 @@
9392
"Do not translate 'PCF' as it is a product name."
9493
]
9594
},
96-
"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?",
97-
"Install": "Install",
9895
"Cancel": "Cancel",
96+
"Install": "Install",
97+
"The extension 'Microsoft Edge Tools' is required to run this command. Do you want to install it now?/Do not translate 'Microsoft Edge Tools' ": {
98+
"message": "The extension 'Microsoft Edge Tools' is required to run this command. Do you want to install it now?",
99+
"comment": [
100+
"Do not translate 'Microsoft Edge Tools' "
101+
]
102+
},
103+
"Opening site preview...": "Opening site preview...",
104+
"The preview shown is for published changes.": "The preview shown is for published changes.",
99105
"Site runtime preview feature is not enabled.": "Site runtime preview feature is not enabled.",
100106
"No workspace folder opened. Please open a site folder to preview.": "No workspace folder opened. Please open a site folder to preview.",
101-
"Website URL not found.": "Website URL not found.",
102-
"Opening site preview...": "Opening site preview...",
107+
"Initializing site preview. Please try again after few seconds.": "Initializing site preview. Please try again after few seconds.",
108+
"Website not found in the environment. Please check the credentials and login with correct account.": "Website not found in the environment. Please check the credentials and login with correct account.",
109+
"Initializing site preview": "Initializing site preview",
110+
"Getting organization details...": "Getting organization details...",
111+
"Getting region information...": "Getting region information...",
112+
"Failed to get website endpoint. Please try again later": "Failed to get website endpoint. Please try again later",
113+
"Getting website endpoint...": "Getting website endpoint...",
103114
"File might be referenced by name {0} here./{0} represents the name of the file": {
104115
"message": "File might be referenced by name {0} here.",
105116
"comment": [

loc/translations-export/vscode-powerplatform.xlf

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ The {3} represents Solution's Type (Managed or Unmanaged), but that test is loca
162162
<trans-unit id="++CODE++862d6197d64601aa13ce30db5ec5b8f819ad00fe21e3b031a3e47fe22ef68fb3">
163163
<source xml:lang="en">Failed to get file ready for edit: {0}</source>
164164
</trans-unit>
165+
<trans-unit id="++CODE++51e1f5c5757cfd25a390293a7d8e9eb583943b66211fae1cbe25d07bfcb767f1">
166+
<source xml:lang="en">Failed to get website endpoint. Please try again later</source>
167+
</trans-unit>
165168
<trans-unit id="++CODE++a9e36b880dd45b64ae5601865540605296febf9bd855fc46d9c35c2c2ed9a7f2">
166169
<source xml:lang="en">Feature is not enabled for this geo.</source>
167170
</trans-unit>
@@ -190,6 +193,15 @@ The {3} represents Solution's Type (Managed or Unmanaged), but that test is loca
190193
<trans-unit id="++CODE++ee1d3100df4b00eabd74481b92106e42cce956213372a914082f82702f56470d">
191194
<source xml:lang="en">Get GitHub Copilot to try @powerpages</source>
192195
</trans-unit>
196+
<trans-unit id="++CODE++1a1075387e5e1674a11f58f6aadd4e0abc63e1e3d201ae980b12a37e6d5a584b">
197+
<source xml:lang="en">Getting organization details...</source>
198+
</trans-unit>
199+
<trans-unit id="++CODE++6f1bba10af9069a03da80d629b97c40fc4bedaf90a23496a2bdef0c512a92959">
200+
<source xml:lang="en">Getting region information...</source>
201+
</trans-unit>
202+
<trans-unit id="++CODE++0087988cdb71080f2525354e125366c6db7d85a36f199e2f80d14a44b3fd0340">
203+
<source xml:lang="en">Getting website endpoint...</source>
204+
</trans-unit>
193205
<trans-unit id="++CODE++b9f4adbdfa2deef1eaa415a914f63329ee06c604b5a1bf34645175b9e28a9712">
194206
<source xml:lang="en">Here are a few suggestions to get you started</source>
195207
</trans-unit>
@@ -214,6 +226,12 @@ Return to this chat and @powerpages can help you write and edit your website cod
214226
<trans-unit id="++CODE++08295f3385931e35c850b945e2ae04882452c4bf0dd575f70e95aaa6ed00daa9">
215227
<source xml:lang="en">In your own words, describe what you need. You can get help with writing code for Power Pages sites in HTML, CSS, and JS languages.</source>
216228
</trans-unit>
229+
<trans-unit id="++CODE++a22418694e3938cc42976630bcd24822ed4f671b168708e0641171440ca8f6dd">
230+
<source xml:lang="en">Initializing site preview</source>
231+
</trans-unit>
232+
<trans-unit id="++CODE++15b09c32b0337229ff64c72f2ea9a3f8422fa20975ae494da863fd738554b1de">
233+
<source xml:lang="en">Initializing site preview. Please try again after few seconds.</source>
234+
</trans-unit>
217235
<trans-unit id="++CODE++e992151b1efc99f93484c7d7f3076b66ab072a8af2383e96104cc597c971339c">
218236
<source xml:lang="en">Insert code into editor</source>
219237
</trans-unit>
@@ -403,15 +421,19 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
403421
<trans-unit id="++CODE++618f7afd7be2f12bf2ebbaba5bc7e951d2ebfb11d4480647f991fbb664caa26e">
404422
<source xml:lang="en">The Power Pages generator is ready for use in your VS Code extension!</source>
405423
</trans-unit>
406-
<trans-unit id="++CODE++538ecf1398703f8a2048b99a2b2a533012b06ee88d67a0fd6fbbcd716cfbd663">
407-
<source xml:lang="en">The extension Microsoft Edge Tools is required to run this command. Do you want to install it now?</source>
424+
<trans-unit id="++CODE++0bc2e4918b64f82220bde3dae30dc007a45fb59c3677833fb5a0e275a3b6b54b">
425+
<source xml:lang="en">The extension 'Microsoft Edge Tools' is required to run this command. Do you want to install it now?</source>
426+
<note>Do not translate 'Microsoft Edge Tools' </note>
408427
</trans-unit>
409428
<trans-unit id="++CODE++e4a2396fd7a366292a40abc87b18a2329458c258f4d0e0e593e6189dff19a117">
410429
<source xml:lang="en">The name you want to give to this authentication profile</source>
411430
</trans-unit>
412431
<trans-unit id="++CODE++5eccedc8c04d2137a9eb74edf18ea469b4b63e7315de4b8fe49c48bb8d0780e9">
413432
<source xml:lang="en">The pac CLI is ready for use in your VS Code terminal!</source>
414433
</trans-unit>
434+
<trans-unit id="++CODE++db00163e0e6fed2e319e28785c537befb88ded272d245e503d9580322ab2fec8">
435+
<source xml:lang="en">The preview shown is for published changes.</source>
436+
</trans-unit>
415437
<trans-unit id="++CODE++18f3be2933741b96e56b1e1f70818fcba46ec9c5b3dcd0e28d801eab15791d84">
416438
<source xml:lang="en">There was a permissions problem with the server</source>
417439
</trans-unit>
@@ -464,11 +486,8 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
464486
<trans-unit id="++CODE++00dc171124ab430bbbaae51ec39dda1c5e7d045f382f56b1767d9e733292731c">
465487
<source xml:lang="en">Webpage names should contain only letters, numbers, hyphens, or underscores.</source>
466488
</trans-unit>
467-
<trans-unit id="++CODE++968729c173b0e6967fc054251835e9196b1e09ad7c55ab7b0acafb3402a9d5d6">
468-
<source xml:lang="en">Website URL not found.</source>
469-
</trans-unit>
470-
<trans-unit id="++CODE++4ed689987736ce09e17c67eb32f441ca7d0f7ed013a282aafd1ebcf302e6386b">
471-
<source xml:lang="en">Website not found in the environment. Please check the credentials and root folder path.</source>
489+
<trans-unit id="++CODE++aa64cfbb63d3382bc0530c6e599467b1cc5c1ef8ff3b573d37ad628f9058b2aa">
490+
<source xml:lang="en">Website not found in the environment. Please check the credentials and login with correct account.</source>
472491
</trans-unit>
473492
<trans-unit id="++CODE++e4bb03b399c07eeda658d87305435a58818cb5e0c3b76ae054d99564cf14ef6b">
474493
<source xml:lang="en">What do you need help with?</source>

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@
373373
},
374374
{
375375
"command": "microsoft.powerplatform.pages.preview-site",
376+
"category": "Powerpages",
376377
"title": "%powerplatform.pages.previewSite.title%"
377378
}
378379
],
@@ -817,7 +818,7 @@
817818
},
818819
{
819820
"command": "microsoft.powerplatform.pages.preview-site",
820-
"when": "microsoft.powerplatform.pages.siteRuntimePreviewEnabled"
821+
"when": "microsoft.powerplatform.pages.siteRuntimePreviewEnabled && workspaceFolderCount == 1 && !isWeb"
821822
},
822823
{
823824
"command": "powerPlatform.previewCurrentActiveUsers",

src/client/extension.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ import { EXTENSION_ID, SUCCESS } from "../common/constants";
4444
import { AadIdKey, EnvIdKey, TenantIdKey } from "../common/OneDSLoggerTelemetry/telemetryConstants";
4545
import { PowerPagesAppName, PowerPagesClientName } from "../common/ecs-features/constants";
4646
import { ECSFeaturesClient } from "../common/ecs-features/ecsFeatureClient";
47-
import { getECSOrgLocationValue } from "../common/utilities/Utils";
47+
import { getECSOrgLocationValue, getWorkspaceFolders } from "../common/utilities/Utils";
4848
import { CliAcquisitionContext } from "./lib/CliAcquisitionContext";
49-
import { PreviewSite, SITE_PREVIEW_COMMAND_ID } from "./runtime-site-preview/PreviewSite";
49+
import { PreviewSite, SITE_PREVIEW_COMMAND_ID } from "./preview-site/PreviewSite";
5050

5151
let client: LanguageClient;
5252
let _context: vscode.ExtensionContext;
@@ -190,13 +190,8 @@ export async function activate(
190190

191191
let copilotNotificationShown = false;
192192

193-
const workspaceFolders =
194-
vscode.workspace.workspaceFolders?.map(
195-
(fl) => ({ ...fl, uri: fl.uri.fsPath } as WorkspaceFolder)
196-
) || [];
197-
193+
const workspaceFolders = getWorkspaceFolders();
198194

199-
let websiteURL: string | undefined = "";
200195
const isSiteRuntimePreviewEnabled = PreviewSite.isSiteRuntimePreviewEnabled();
201196

202197
vscode.commands.executeCommand("setContext", "microsoft.powerplatform.pages.siteRuntimePreviewEnabled", isSiteRuntimePreviewEnabled);
@@ -257,7 +252,7 @@ export async function activate(
257252
}
258253

259254
if (artemisResponse !== null && isSiteRuntimePreviewEnabled) {
260-
websiteURL = await PreviewSite.getWebSiteURL(workspaceFolders, artemisResponse?.stamp, orgDetails.EnvironmentId, _telemetry);
255+
await PreviewSite.loadSiteUrl(workspaceFolders, artemisResponse?.stamp, orgDetails.EnvironmentId, _telemetry);
261256
}
262257

263258
})
@@ -282,17 +277,17 @@ export async function activate(
282277

283278
_telemetry.sendTelemetryEvent("EnableSiteRuntimePreview", {
284279
isEnabled: isSiteRuntimePreviewEnabled.toString(),
285-
websiteURL: websiteURL
280+
websiteURL: PreviewSite.getSiteUrl() || "undefined"
286281
});
287282
oneDSLoggerWrapper.getLogger().traceInfo("EnableSiteRuntimePreview", {
288283
isEnabled: isSiteRuntimePreviewEnabled.toString(),
289-
websiteURL: websiteURL
284+
websiteURL: PreviewSite.getSiteUrl() || "undefined"
290285
});
291286

292287
_context.subscriptions.push(
293288
vscode.commands.registerCommand(
294289
SITE_PREVIEW_COMMAND_ID,
295-
async () => await PreviewSite.handlePreviewRequest(isSiteRuntimePreviewEnabled, websiteURL, _telemetry)
290+
async () => await PreviewSite.handlePreviewRequest(isSiteRuntimePreviewEnabled, _telemetry, pacTerminal)
296291
)
297292
);
298293

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*/
5+
6+
import * as vscode from 'vscode';
7+
8+
export const Messages = {
9+
LOGIN: vscode.l10n.t("Login"),
10+
CANCEL: vscode.l10n.t("Cancel"),
11+
INSTALL: vscode.l10n.t("Install"),
12+
EDGE_DEV_TOOLS_NOT_INSTALLED_MESSAGE: vscode.l10n.t({ message: "The extension 'Microsoft Edge Tools' is required to run this command. Do you want to install it now?", comment:["Do not translate 'Microsoft Edge Tools' "] }),
13+
OPENING_SITE_PREVIEW: vscode.l10n.t("Opening site preview..."),
14+
PREVIEW_SHOWN_FOR_PUBLISHED_CHANGES: vscode.l10n.t("The preview shown is for published changes."),
15+
SITE_PREVIEW_FEATURE_NOT_ENABLED: vscode.l10n.t("Site runtime preview feature is not enabled."),
16+
NO_FOLDER_OPENED: vscode.l10n.t("No workspace folder opened. Please open a site folder to preview."),
17+
INITIALIZING_PREVIEW_TRY_AGAIN: vscode.l10n.t("Initializing site preview. Please try again after few seconds."),
18+
WEBSITE_NOT_FOUND_IN_ENVIRONMENT: vscode.l10n.t("Website not found in the environment. Please check the credentials and login with correct account."),
19+
INITIALIZING_PREVIEW: vscode.l10n.t("Initializing site preview"),
20+
GETTING_ORG_DETAILS: vscode.l10n.t("Getting organization details..."),
21+
GETTING_REGION_INFORMATION: vscode.l10n.t("Getting region information..."),
22+
FAILED_TO_GET_ENDPOINT: vscode.l10n.t("Failed to get website endpoint. Please try again later"),
23+
GETTING_WEBSITE_ENDPOINT: vscode.l10n.t("Getting website endpoint...")
24+
};

0 commit comments

Comments
 (0)