Skip to content

Commit

Permalink
Launch Edge new tab instead of launching project
Browse files Browse the repository at this point in the history
  • Loading branch information
priyanshu92 committed Dec 16, 2024
1 parent c9d1559 commit ac61d88
Show file tree
Hide file tree
Showing 11 changed files with 148 additions and 205 deletions.
56 changes: 29 additions & 27 deletions l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,36 +93,13 @@
"Do not translate 'PCF' as it is a product name."
]
},
"Preparing pac CLI (v{0}).../{0} represents the version number": {
"message": "Preparing pac CLI (v{0})...",
"comment": [
"{0} represents the version number"
]
},
"The pac CLI is ready for use in your VS Code terminal!": "The pac CLI is ready for use in your VS Code terminal!",
"Cannot install pac CLI: {0}/{0} represents the error message returned from the exception": {
"message": "Cannot install pac CLI: {0}",
"comment": [
"{0} represents the error message returned from the exception"
]
},
"Installing Power Pages generator(v{0}).../{0} represents the version number": {
"message": "Installing Power Pages generator(v{0})...",
"comment": [
"{0} represents the version number"
]
},
"dotnet sdk 6.0 or greater must be installed/Do not translate 'dotnet' or 'sdk'": {
"message": "dotnet sdk 6.0 or greater must be installed",
"comment": [
"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",
"Cancel": "Cancel",
"No workspace folder is open.": "No workspace folder is open.",
"Failed to update launch.json: ${0}": "Failed to update launch.json: ${0}",
"Site runtime preview feature is not enabled.": "Site runtime preview feature is not enabled.",
"No workspace folder opened. Please open a site folder to preview.": "No workspace folder opened. Please open a site folder to preview.",
"Website URL not found.": "Website URL not found.",
"Opening site preview...": "Opening site preview...",
"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": [
Expand Down Expand Up @@ -194,6 +171,12 @@
"Do not translate 'npm'"
]
},
"Installing Power Pages generator(v{0}).../{0} represents the version number": {
"message": "Installing Power Pages generator(v{0})...",
"comment": [
"{0} represents the version number"
]
},
"Cannot install Power Pages generator: {0}/{0} represents the error message returned from the exception": {
"message": "Cannot install Power Pages generator: {0}",
"comment": [
Expand Down Expand Up @@ -223,6 +206,25 @@
"The {3} represents Dataverse Environment's Organization ID (GUID)"
]
},
"Preparing pac CLI (v{0}).../{0} represents the version number": {
"message": "Preparing pac CLI (v{0})...",
"comment": [
"{0} represents the version number"
]
},
"The pac CLI is ready for use in your VS Code terminal!": "The pac CLI is ready for use in your VS Code terminal!",
"Cannot install pac CLI: {0}/{0} represents the error message returned from the exception": {
"message": "Cannot install pac CLI: {0}",
"comment": [
"{0} represents the error message returned from the exception"
]
},
"dotnet sdk 6.0 or greater must be installed/Do not translate 'dotnet' or 'sdk'": {
"message": "dotnet sdk 6.0 or greater must be installed",
"comment": [
"Do not translate 'dotnet' or 'sdk'"
]
},
"Confirm": "Confirm",
"Are you sure you want to clear all the Auth Profiles?": "Are you sure you want to clear all the Auth Profiles?",
"Are you sure you want to delete the Auth Profile {0}-{1}?/{0} is the user name, {1} is the URL of environment of the auth profile": {
Expand Down
19 changes: 14 additions & 5 deletions loc/translations-export/vscode-powerplatform.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,6 @@ The {3} represents Solution's Type (Managed or Unmanaged), but that test is loca
<trans-unit id="++CODE++862d6197d64601aa13ce30db5ec5b8f819ad00fe21e3b031a3e47fe22ef68fb3">
<source xml:lang="en">Failed to get file ready for edit: {0}</source>
</trans-unit>
<trans-unit id="++CODE++bc7c38bba120feb9d6acc70f0a26050f3ce2a70dd87afa046c3f962be7d015e3">
<source xml:lang="en">Failed to update launch.json: ${0}</source>
</trans-unit>
<trans-unit id="++CODE++a9e36b880dd45b64ae5601865540605296febf9bd855fc46d9c35c2c2ed9a7f2">
<source xml:lang="en">Feature is not enabled for this geo.</source>
</trans-unit>
Expand Down Expand Up @@ -300,8 +297,8 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
<trans-unit id="++CODE++6da29e062697a9f26659ef14ebda075afe939756af5d8e1d3451eb7d6d6e1a8a">
<source xml:lang="en">No workspace folder found</source>
</trans-unit>
<trans-unit id="++CODE++3c8a93afe6d6e99f8ad4b7fd72ffe91e62b1cbc29a8887d4922f80e92f4b78b2">
<source xml:lang="en">No workspace folder is open.</source>
<trans-unit id="++CODE++6c0242ffba2aababcb4e45831de1492e8bccae2cb0f3387dfe9c16620f6928ef">
<source xml:lang="en">No workspace folder opened. Please open a site folder to preview.</source>
</trans-unit>
<trans-unit id="++CODE++bda6bda1e902d120a7f4515ceac8546c3112e3cb9351df1d8b9713b8f86e0370">
<source xml:lang="en">One or more attribute names have been changed or removed. Contact your admin.</source>
Expand All @@ -312,6 +309,9 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
<trans-unit id="++CODE++dac0ee62a5197a3722a9e7e9e851e80504cced8a13ce8b17842d78e8313578c2">
<source xml:lang="en">Opening preview site...</source>
</trans-unit>
<trans-unit id="++CODE++e61c4ac3c692e3cfdc02717db82d18b1e9d51242710031f20af35b33d149fa7a">
<source xml:lang="en">Opening site preview...</source>
</trans-unit>
<trans-unit id="++CODE++5cac0147c19013eb88b1fc8dc0d066b48e9f5cfcdbc9737a29d544d9bd61db55">
<source xml:lang="en">Operation failed. See output panel for details.</source>
</trans-unit>
Expand Down Expand Up @@ -385,6 +385,9 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
<trans-unit id="++CODE++899fb203e6c2faac8093e21a2fa8db0d4b13d16ea5492461d8b72dbcee3ecf2a">
<source xml:lang="en">Show Output Panel</source>
</trans-unit>
<trans-unit id="++CODE++f7094162bd4c4b59aa706387714347223e1569c79c5b37eb19ac754a33a0fdd0">
<source xml:lang="en">Site runtime preview feature is not enabled.</source>
</trans-unit>
<trans-unit id="++CODE++27dd8c8e67d15783f51c6b71ed60d5350731daa85b418f1e84c2e5828ae2d54e">
<source xml:lang="en">Some references might be broken. Please check diagnostics for details.</source>
</trans-unit>
Expand Down Expand Up @@ -461,6 +464,9 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
<trans-unit id="++CODE++00dc171124ab430bbbaae51ec39dda1c5e7d045f382f56b1767d9e733292731c">
<source xml:lang="en">Webpage names should contain only letters, numbers, hyphens, or underscores.</source>
</trans-unit>
<trans-unit id="++CODE++968729c173b0e6967fc054251835e9196b1e09ad7c55ab7b0acafb3402a9d5d6">
<source xml:lang="en">Website URL not found.</source>
</trans-unit>
<trans-unit id="++CODE++4ed689987736ce09e17c67eb32f441ca7d0f7ed013a282aafd1ebcf302e6386b">
<source xml:lang="en">Website not found in the environment. Please check the credentials and root folder path.</source>
</trans-unit>
Expand Down Expand Up @@ -632,6 +638,9 @@ The second line should be '[TRANSLATION HERE](command:powerplatform-walkthrough.
<trans-unit id="microsoft-powerapps-portals.preview-show.title">
<source xml:lang="en">PowerApps Portal -&gt; Show preview</source>
</trans-unit>
<trans-unit id="powerplatform.pages.previewSite.title">
<source xml:lang="en">Preview Site</source>
</trans-unit>
<trans-unit id="pacCLI.envAndSolutionsPanel.refresh.title">
<source xml:lang="en">Refresh</source>
</trans-unit>
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,10 @@
"command": "powerPlatform.previewCurrentActiveUsers",
"title": "Current Active Users",
"icon": "$(person)"
},
{
"command": "microsoft.powerplatform.pages.preview-site",
"title": "%powerplatform.pages.previewSite.title%"
}
],
"configuration": {
Expand Down
3 changes: 2 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,6 @@
"The fifth line should be '[TRANSLATION HERE](command:powerplatform-walkthrough.saveConflict-learn-more).', keeping brackets and the text in the parentheses unmodified"
]
},
"microsoft-powerplatform-portals.navigation-loop.powerPagesFileExplorer.title": "POWER PAGES ACTIONS"
"microsoft-powerplatform-portals.navigation-loop.powerPagesFileExplorer.title": "POWER PAGES ACTIONS",
"powerplatform.pages.previewSite.title": "Preview Site"
}
46 changes: 25 additions & 21 deletions src/client/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import { PowerPagesAppName, PowerPagesClientName } from "../common/ecs-features/
import { ECSFeaturesClient } from "../common/ecs-features/ecsFeatureClient";
import { getECSOrgLocationValue } from "../common/utilities/Utils";
import { CliAcquisitionContext } from "./lib/CliAcquisitionContext";
import { PreviewSite } from "./runtime-site-preview/PreviewSite";
import { PreviewSite, SITE_PREVIEW_COMMAND_ID } from "./runtime-site-preview/PreviewSite";

let client: LanguageClient;
let _context: vscode.ExtensionContext;
Expand Down Expand Up @@ -102,6 +102,22 @@ export async function activate(
);
}

// portal web view panel
_context.subscriptions.push(
vscode.commands.registerCommand(
"microsoft-powerapps-portals.preview-show",
() => {
_telemetry.sendTelemetryEvent("StartCommand", {
commandId: "microsoft-powerapps-portals.preview-show",
});
oneDSLoggerWrapper.getLogger().traceInfo("StartCommand", {
commandId: "microsoft-powerapps-portals.preview-show"
});
PortalWebView.createOrShow();
}
)
);

// registering bootstrapdiff command
_context.subscriptions.push(
vscode.commands.registerCommand('microsoft-powerapps-portals.bootstrap-diff', async () => {
Expand Down Expand Up @@ -180,7 +196,8 @@ export async function activate(
) || [];


let websiteURL = "";
let websiteURL: string | undefined = "";
const isSiteRuntimePreviewEnabled = PreviewSite.isSiteRuntimePreviewEnabled();

_context.subscriptions.push(
orgChangeEvent(async (orgDetails: ActiveOrgOutput) => {
Expand Down Expand Up @@ -236,7 +253,8 @@ export async function activate(
copilotNotificationShown = true;

}
if(artemisResponse !== null && PreviewSite.isSiteRuntimePreviewEnabled()) {

if (artemisResponse !== null && isSiteRuntimePreviewEnabled) {
websiteURL = await PreviewSite.getWebSiteURL(workspaceFolders, artemisResponse?.stamp, orgDetails.EnvironmentId, _telemetry);
}

Expand All @@ -260,33 +278,19 @@ export async function activate(
vscode.commands.executeCommand('setContext', 'powerpages.websiteYmlExists', false);
}

const isEnabled = PreviewSite.isSiteRuntimePreviewEnabled();

_telemetry.sendTelemetryEvent("EnableSiteRuntimePreview", {
isEnabled: isEnabled.toString(),
isEnabled: isSiteRuntimePreviewEnabled.toString(),
websiteURL: websiteURL
});
oneDSLoggerWrapper.getLogger().traceInfo("EnableSiteRuntimePreview", {
isEnabled: isEnabled.toString(),
isEnabled: isSiteRuntimePreviewEnabled.toString(),
websiteURL: websiteURL
});

_context.subscriptions.push(
vscode.commands.registerCommand(
"microsoft-powerapps-portals.preview-show",
() => {
if (!isEnabled) {
_telemetry.sendTelemetryEvent("StartCommand", {
commandId: "microsoft-powerapps-portals.preview-show",
});
oneDSLoggerWrapper.getLogger().traceInfo("StartCommand", {
commandId: "microsoft-powerapps-portals.preview-show"
});
PortalWebView.createOrShow();
} else {
PreviewSite.launchBrowserAndDevToolsWithinVsCode(websiteURL);
}
}
SITE_PREVIEW_COMMAND_ID,
async () => await PreviewSite.handlePreviewRequest(isSiteRuntimePreviewEnabled, websiteURL, _telemetry)
)
);

Expand Down
90 changes: 0 additions & 90 deletions src/client/runtime-site-preview/LaunchJsonHelper.ts

This file was deleted.

Loading

0 comments on commit ac61d88

Please sign in to comment.