Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,12 @@
"Replace": "Replace",
"Comparison has been refreshed with the latest data from the environment.": "Comparison has been refreshed with the latest data from the environment.",
"Cannot refresh an imported comparison. Import a new file or run a new comparison.": "Cannot refresh an imported comparison. Import a new file or run a new comparison.",
"Enter a name for the cloned site": "Enter a name for the cloned site",
"Site name cannot be empty.": "Site name cannot be empty.",
"Failed to download the site for cloning. Please try again.": "Failed to download the site for cloning. Please try again.",
"Failed to clone the site. Please try again.": "Failed to clone the site. Please try again.",
"Failed to upload the cloned site. Please try again.": "Failed to upload the cloned site. Please try again.",
"Site cloned and uploaded successfully.": "Site cloned and uploaded successfully.",
"Fetching websites from '{0}'.../Message shown while fetching websites from an environment. {0} is the environment name.": {
"message": "Fetching websites from '{0}'...",
"comment": [
Expand Down Expand Up @@ -594,6 +600,24 @@
"This is a markdown formatting which must persist across translations."
]
},
"Cloning {0} ([details](command:microsoft.powerplatform.pages.actionsHub.showOutputChannel \"Show output\")).../This is a markdown formatting which must persist across translations.": {
"message": "Cloning {0} ([details](command:microsoft.powerplatform.pages.actionsHub.showOutputChannel \"Show output\"))...",
"comment": [
"This is a markdown formatting which must persist across translations."
]
},
"Downloading {0} for cloning ([details](command:microsoft.powerplatform.pages.actionsHub.showOutputChannel \"Show output\")).../This is a markdown formatting which must persist across translations.": {
"message": "Downloading {0} for cloning ([details](command:microsoft.powerplatform.pages.actionsHub.showOutputChannel \"Show output\"))...",
"comment": [
"This is a markdown formatting which must persist across translations."
]
},
"Uploading cloned site {0} ([details](command:microsoft.powerplatform.pages.actionsHub.showOutputChannel \"Show output\")).../This is a markdown formatting which must persist across translations.": {
"message": "Uploading cloned site {0} ([details](command:microsoft.powerplatform.pages.actionsHub.showOutputChannel \"Show output\"))...",
"comment": [
"This is a markdown formatting which must persist across translations."
]
},
"Friendly name: {0}/{0} is the website name": {
"message": "Friendly name: {0}",
"comment": [
Expand Down
33 changes: 33 additions & 0 deletions loc/translations-export/vscode-powerplatform.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ The second line should be '[TRANSLATION HERE](https://aka.ms/pages-clear-cache).
<trans-unit id="++CODE++ee9d4bb8e9f94832366fe390fde5efc4b555d1464ef6023d3c0b25de58223bcc">
<source xml:lang="en">Click to compare your local site with an environment</source>
</trans-unit>
<trans-unit id="++CODE++f4dc565bb17826694eb9fcd99f8648b28f0846a0c284cd4e58b9edf54e10c0b8">
<source xml:lang="en">Cloning {0} ([details](command:microsoft.powerplatform.pages.actionsHub.showOutputChannel &quot;Show output&quot;))...</source>
<note>This is a markdown formatting which must persist across translations.</note>
</trans-unit>
<trans-unit id="++CODE++7d9eb7acb13e24625c404401d8e88b2350e32162455885f18276cf802f7701ed">
<source xml:lang="en">Close</source>
</trans-unit>
Expand Down Expand Up @@ -442,6 +446,10 @@ The {3} represents Solution's Type (Managed or Unmanaged), but that test is loca
<trans-unit id="++CODE++f945885439672eb379c73eb7c9124496311c6ef5b3b04cd23ea0a1c146225b84">
<source xml:lang="en">Download is complete. You can now view the report.</source>
</trans-unit>
<trans-unit id="++CODE++fffbb03cf1a55ff063135b76fbde5be6bda25b0dde1bbfb1e88e2c90e7a49db5">
<source xml:lang="en">Downloading {0} for cloning ([details](command:microsoft.powerplatform.pages.actionsHub.showOutputChannel &quot;Show output&quot;))...</source>
<note>This is a markdown formatting which must persist across translations.</note>
</trans-unit>
<trans-unit id="++CODE++a5a4f0d8975940cbed234f9a5ee740f24e2b82f03a5b13e43f316b8395336e50">
<source xml:lang="en">Downloading {0} site metadata ([details](command:microsoft.powerplatform.pages.actionsHub.showOutputChannel &quot;Show download output&quot;))...</source>
<note>This is a markdown formatting which must persist across translations.</note>
Expand All @@ -455,6 +463,9 @@ The {3} represents Solution's Type (Managed or Unmanaged), but that test is loca
<trans-unit id="++CODE++0feefedc5916a0c9a464f4ef9f28fab835a23e1d035878f397e38053381aa3fa">
<source xml:lang="en">Enter Organization ID</source>
</trans-unit>
<trans-unit id="++CODE++d836838411c4fbaf037387dcc5cd69d7561889fa19ff57ab5beed63fd3b4dd95">
<source xml:lang="en">Enter a name for the cloned site</source>
</trans-unit>
<trans-unit id="++CODE++80ccd89cd4c287f3ca9f3693982e8034544fefeba563c974f93482158e8f0737">
<source xml:lang="en">Enter name</source>
</trans-unit>
Expand Down Expand Up @@ -531,6 +542,9 @@ The {3} represents Solution's Type (Managed or Unmanaged), but that test is loca
<trans-unit id="++CODE++173848927e1a6ed7f8c52d958d530c9ce90053649c734a3bc20bfb2053d8ef88">
<source xml:lang="en">Extension installed but API not available yet. Opening as text file...</source>
</trans-unit>
<trans-unit id="++CODE++dd232d4c74c0af69397e14b1ec1ca9b8991ea5fddf84628b30fb3d14903ca0af">
<source xml:lang="en">Failed to clone the site. Please try again.</source>
</trans-unit>
<trans-unit id="++CODE++b985f1515c42b4b5b0c11a3d7b3286fc9d66997d476668ab1f93a4a11499fef5">
<source xml:lang="en">Failed to create a new Power Pages site. Please try again.</source>
</trans-unit>
Expand All @@ -545,6 +559,9 @@ The {3} represents Solution's Type (Managed or Unmanaged), but that test is loca
<source xml:lang="en">Failed to discard local changes: {0}</source>
<note>Error message when discarding local changes fails.</note>
</trans-unit>
<trans-unit id="++CODE++fa196d33b3dc02fd079f73a579a26ddd67d29fe175695b13b8a76a599319a96f">
<source xml:lang="en">Failed to download the site for cloning. Please try again.</source>
</trans-unit>
<trans-unit id="++CODE++95da24b6bc127a935e2e4323fe85d8f46be20c5e8ca5e10c6a134e5a0c6443a2">
<source xml:lang="en">Failed to enable PAC telemetry.</source>
</trans-unit>
Expand Down Expand Up @@ -593,6 +610,9 @@ The {3} represents Solution's Type (Managed or Unmanaged), but that test is loca
<trans-unit id="++CODE++ab47a93b0690e3553f60a7e1bd45df0a5e0ebf49f7f3c150d38f347699892163">
<source xml:lang="en">Failed to switch to the required environment. Please sign in with an account that has access to the target environment using 'pac auth create' command.</source>
</trans-unit>
<trans-unit id="++CODE++75528796fc394144a63eaa990d8dbf68c8ddbfd71ba7ddbe9b8f73852ad83165">
<source xml:lang="en">Failed to upload the cloned site. Please try again.</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 @@ -1161,6 +1181,9 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
<trans-unit id="++CODE++4b7de12dbef5cc145cf5b8b08743a60d279d6ee27b8b13470e5f06bc21153867">
<source xml:lang="en">Site Visibility:</source>
</trans-unit>
<trans-unit id="++CODE++71e1fa4c68253a5585e75524dada5f31033093e4951035be5c7c7a400bd03246">
<source xml:lang="en">Site cloned and uploaded successfully.</source>
</trans-unit>
<trans-unit id="++CODE++4fa72d80ab1b04e31f450bacc89bff526a5e52e3d104d153b3b493b108330b3c">
<source xml:lang="en">Site download cancelled. Authentication is required to proceed.</source>
</trans-unit>
Expand All @@ -1176,6 +1199,9 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
<trans-unit id="++CODE++a72357d268bce5e1643bfd74563495784179f75ace0d652db8f808f293586b63">
<source xml:lang="en">Site management URL not found for the selected site. Please try again after refreshing the environment.</source>
</trans-unit>
<trans-unit id="++CODE++656563f7404a65eba76106cce83519f640802c30345ee7650ea517993f833904">
<source xml:lang="en">Site name cannot be empty.</source>
</trans-unit>
<trans-unit id="++CODE++f7094162bd4c4b59aa706387714347223e1569c79c5b37eb19ac754a33a0fdd0">
<source xml:lang="en">Site runtime preview feature is not enabled.</source>
</trans-unit>
Expand Down Expand Up @@ -1355,6 +1381,10 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
<trans-unit id="++CODE++8a91e7caf57148c6be78b3986477464b36f0282a9e9a09b635b0db4fe6246132">
<source xml:lang="en">Upload failed. Please try again later.</source>
</trans-unit>
<trans-unit id="++CODE++3e92a050764a35e5cd81e04d745b698f7a42759d6729256791f7740fee62f6a9">
<source xml:lang="en">Uploading cloned site {0} ([details](command:microsoft.powerplatform.pages.actionsHub.showOutputChannel &quot;Show output&quot;))...</source>
<note>This is a markdown formatting which must persist across translations.</note>
</trans-unit>
<trans-unit id="++CODE++037bfba715811960dfb62b81a99d5002835f73a9c44bdd6661ebc222d8538e2b">
<source xml:lang="en">Use File → Open Folder to select a folder with a Power Pages site</source>
</trans-unit>
Expand Down Expand Up @@ -1538,6 +1568,9 @@ The fifth line should be '[TRANSLATION HERE](command:powerplatform-walkthrough.s
<trans-unit id="powerpages.copilotPanel.clearConversation.title">
<source xml:lang="en">Clear Conversation</source>
</trans-unit>
<trans-unit id="microsoft.powerplatform.pages.actionsHub.site.cloneSite.title">
<source xml:lang="en">Clone Site</source>
</trans-unit>
<trans-unit id="microsoft-powerapps-portals.compareWithEnvironment.title">
<source xml:lang="en">Compare with Environment</source>
</trans-unit>
Expand Down
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,10 @@
"command": "microsoft.powerplatform.pages.actionsHub.inactiveSite.reactivateSite",
"title": "%microsoft.powerplatform.pages.actionsHub.inactiveSite.reactivateSite.title%"
},
{
"command": "microsoft.powerplatform.pages.actionsHub.site.cloneSite",
"title": "%microsoft.powerplatform.pages.actionsHub.site.cloneSite.title%"
},
{
"command": "microsoft.powerplatform.pages.actionsHub.currentActiveSite.runCodeQLScreening",
"category": "Power Pages",
Expand Down Expand Up @@ -1191,6 +1195,10 @@
"command": "microsoft.powerplatform.pages.actionsHub.inactiveSite.reactivateSite",
"when": "never"
},
{
"command": "microsoft.powerplatform.pages.actionsHub.site.cloneSite",
"when": "never"
},
{
"command": "microsoft.powerplatform.pages.actionsHub.activeSite.compareWithLocal",
"when": "never"
Expand Down Expand Up @@ -1441,6 +1449,11 @@
"when": "view == microsoft.powerplatform.pages.actionsHub && (viewItem == currentActiveSite || viewItem == nonCurrentActiveSite || viewItem == inactiveSite) &&microsoft.powerplatform.pages.metadataDiffEnabled",
"group": "siteAction@8"
},
{
"command": "microsoft.powerplatform.pages.actionsHub.site.cloneSite",
"when": "view == microsoft.powerplatform.pages.actionsHub && (viewItem == currentActiveSite || viewItem == nonCurrentActiveSite || viewItem == inactiveSite)",
"group": "siteAction@9"
},
{
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.resync",
"when": "view == microsoft.powerplatform.pages.actionsHub && viewItem == metadataDiffSite && microsoft.powerplatform.pages.metadataDiffEnabled",
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"microsoft.powerplatform.pages.actionsHub.activeSite.downloadSite.title": "Download Site",
"microsoft.powerplatform.pages.actionsHub.activeSite.openInStudio.title": "Open in Power Pages Studio",
"microsoft.powerplatform.pages.actionsHub.inactiveSite.reactivateSite.title": "Reactivate Site",
"microsoft.powerplatform.pages.actionsHub.site.cloneSite.title": "Clone Site",
"microsoft.powerplatform.pages.actionsHub.currentActiveSite.runCodeQLScreening.title": "Run CodeQL Screening",
"microsoft.powerplatform.pages.actionsHub.configuration.downloadSite.description": "The folder where site will be downloaded when using Power Pages Actions. Leave this empty to ask for a folder every time you download a site.",
"microsoft.powerplatform.pages.actionsHub.configuration.confirmDifferentWebsiteComparison.description": "Show a confirmation dialog when comparing with a different website than the local site. Set to false to suppress this confirmation.",
Expand Down
53 changes: 53 additions & 0 deletions src/client/pac/PacWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,59 @@ export class PacWrapper {
);
}

/**
* Clones a site with output streamed to a VS Code Output Channel.
* @param sourcePath Path of the website content to clone
* @param outputDirectory Path where the cloned content will be saved
* @param name Name for the cloned site
* @returns Promise that resolves to true if clone succeeded, false otherwise
*/
public async cloneSiteWithProgress(
sourcePath: string,
outputDirectory: string,
name: string
): Promise<boolean> {
const pacArguments = ["pages", "clone", "--path", sourcePath, "--outputDirectory", outputDirectory, "--name", name, "--overwrite"];

return this.pacInterop.executeCommandWithProgress(
new PacArguments(...pacArguments)
);
}

/**
* Uploads a site with output streamed to a VS Code Output Channel.
* @param uploadPath Path from where the site content is uploaded
* @param modelVersion Data model version
* @returns Promise that resolves to true if upload succeeded, false otherwise
*/
public async uploadSiteWithProgress(
uploadPath: string,
modelVersion: string
): Promise<boolean> {
const pacArguments = ["pages", "upload", "--path", uploadPath, "--modelVersion", modelVersion];

return this.pacInterop.executeCommandWithProgress(
new PacArguments(...pacArguments)
);
}

/**
* Uploads a code site with output streamed to a VS Code Output Channel.
* @param rootPath Root source folder of the code site
* @param siteName Name of the site
* @returns Promise that resolves to true if upload succeeded, false otherwise
*/
public async uploadCodeSiteWithProgress(
rootPath: string,
siteName: string
): Promise<boolean> {
const pacArguments = ["pages", "upload-code-site", "--rootPath", rootPath, "--siteName", siteName];

return this.pacInterop.executeCommandWithProgress(
new PacArguments(...pacArguments)
);
}

public async resetPacProcess(): Promise<void> {
try {
await this.pacInterop.exit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { reactivateSite } from "./handlers/ReactivateSiteHandler";
import { uploadSite } from "./handlers/UploadSiteHandler";
import { showSiteDetails } from "./handlers/ShowSiteDetailsHandler";
import { downloadSite } from "./handlers/DownloadSiteHandler";
import { cloneSite } from "./handlers/CloneSiteHandler";
import { loginToMatch } from "./handlers/LoginToMatchHandler";
import { ActionsHub } from "./ActionsHub";
import { compareWithLocal } from "./handlers/metadata-diff/CompareWithLocalHandler";
Expand Down Expand Up @@ -352,6 +353,8 @@ export class ActionsHubTreeDataProvider implements vscode.TreeDataProvider<Actio

vscode.commands.registerCommand("microsoft.powerplatform.pages.actionsHub.inactiveSite.reactivateSite", reactivateSite),

vscode.commands.registerCommand("microsoft.powerplatform.pages.actionsHub.site.cloneSite", cloneSite(this._pacTerminal)),

vscode.commands.registerCommand("microsoft.powerplatform.pages.actionsHub.loginToMatch", () => {
const serviceEndpointStamp = ArtemisContext.ServiceResponse?.stamp;
return loginToMatch(serviceEndpointStamp);
Expand Down
41 changes: 41 additions & 0 deletions src/client/power-pages/actions-hub/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@ export const Constants = {
REPLACE: vscode.l10n.t("Replace"),
METADATA_DIFF_RESYNC_COMPLETED: vscode.l10n.t("Comparison has been refreshed with the latest data from the environment."),
METADATA_DIFF_CANNOT_RESYNC_IMPORTED: vscode.l10n.t("Cannot refresh an imported comparison. Import a new file or run a new comparison."),
CLONE_SITE_NAME_PROMPT: vscode.l10n.t("Enter a name for the cloned site"),
CLONE_SITE_NAME_VALIDATION: vscode.l10n.t("Site name cannot be empty."),
CLONE_SITE_DOWNLOAD_FAILED: vscode.l10n.t("Failed to download the site for cloning. Please try again."),
CLONE_SITE_FAILED: vscode.l10n.t("Failed to clone the site. Please try again."),
UPLOAD_CLONED_SITE_FAILED: vscode.l10n.t("Failed to upload the cloned site. Please try again."),
CLONE_SITE_SUCCESS: vscode.l10n.t("Site cloned and uploaded successfully."),
},
/**
* Functions that return localized strings with dynamic parameters.
Expand Down Expand Up @@ -509,6 +515,33 @@ export const Constants = {
args: [siteName],
comment: ["This is a markdown formatting which must persist across translations."]
}),
/**
* Returns the progress message when cloning a site
*/
CLONING_SITE: (siteName: string) =>
vscode.l10n.t({
message: "Cloning {0} ([details](command:microsoft.powerplatform.pages.actionsHub.showOutputChannel \"Show output\"))...",
args: [siteName],
comment: ["This is a markdown formatting which must persist across translations."]
}),
/**
* Returns the progress message when downloading a site for cloning
*/
DOWNLOADING_SITE_FOR_CLONE: (siteName: string) =>
vscode.l10n.t({
message: "Downloading {0} for cloning ([details](command:microsoft.powerplatform.pages.actionsHub.showOutputChannel \"Show output\"))...",
args: [siteName],
comment: ["This is a markdown formatting which must persist across translations."]
}),
/**
* Returns the progress message when uploading a cloned site
*/
UPLOADING_CLONED_SITE: (siteName: string) =>
vscode.l10n.t({
message: "Uploading cloned site {0} ([details](command:microsoft.powerplatform.pages.actionsHub.showOutputChannel \"Show output\"))...",
args: [siteName],
comment: ["This is a markdown formatting which must persist across translations."]
}),
},
EventNames: {
ACTIONS_HUB_ENABLED: "ActionsHubEnabled",
Expand Down Expand Up @@ -666,6 +699,14 @@ export const Constants = {
ACTIONS_HUB_PRE_AUTH_COMPLETED: "ActionsHubPreAuthCompleted",
ACTIONS_HUB_PRE_AUTH_FAILED: "ActionsHubPreAuthFailed",
ACTIONS_HUB_PRE_AUTH_SKIPPED: "ActionsHubPreAuthSkipped",
ACTIONS_HUB_CLONE_SITE_CALLED: "ActionsHubCloneSiteCalled",
ACTIONS_HUB_CLONE_SITE_DOWNLOAD_TRIGGERED: "ActionsHubCloneSiteDownloadTriggered",
ACTIONS_HUB_CLONE_SITE_DOWNLOAD_FAILED: "ActionsHubCloneSiteDownloadFailed",
ACTIONS_HUB_CLONE_SITE_PAC_TRIGGERED: "ActionsHubCloneSitePacTriggered",
ACTIONS_HUB_CLONE_SITE_FAILED: "ActionsHubCloneSiteFailed",
ACTIONS_HUB_CLONE_SITE_COMPLETED: "ActionsHubCloneSiteCompleted",
ACTIONS_HUB_UPLOAD_CLONED_SITE_PAC_TRIGGERED: "ActionsHubUploadClonedSitePacTriggered",
ACTIONS_HUB_UPLOAD_CLONED_SITE_FAILED: "ActionsHubUploadClonedSiteFailed",
},
StudioEndpoints: {
TEST: "https://make.test.powerpages.microsoft.com",
Expand Down
Loading
Loading