Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@powerpages][5x5] Update Webpage Content and Create Site Records on DV #1073

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

amitjoshi438
Copy link
Contributor

@amitjoshi438 amitjoshi438 commented Dec 12, 2024

This pull request includes several changes to the localization files and the PowerPagesChatParticipant class to improve error messaging, site creation, and file system handling. The most important changes include updates to localization strings, modifications to the PowerPagesChatParticipant class to register a new content provider, and updates to the command execution logic.

Localization updates:

  • Added new error messages and status updates related to site creation, such as "Failed to create a new Power Pages site. Please try again." and "Saving site..." in l10n/bundle.l10n.json and loc/translations-export/vscode-powerplatform.xlf. [1] [2]

Enhancements to PowerPagesChatParticipant:

  • Registered a new EditableFileSystemProvider to handle file system operations related to site creation.
  • Updated the CommandRegistry and PowerPagesChatParticipant classes to pass the EditableFileSystemProvider to commands. [1] [2]

Command execution improvements:

  • Modified the CreateSiteCommand class to include the EditableFileSystemProvider in its execution logic, enabling better handling of file system operations during site creation. [1] [2]

Telemetry updates:

  • Added new telemetry events to track the progress and success of site creation operations, such as VSCODE_EXTENSION_POPULATE_SITE_RECORDS_START and VSCODE_EXTENSION_CREATE_SITE_OPERATION_SUCCESS.

These changes collectively enhance the functionality and user experience of the Power Pages site creation process in the VS Code extension.

amitjoshi added 28 commits November 13, 2024 19:28
…lyFileSystemProvider for site page previews
…ions and improve readability; add CreateSiteTypes for better type management
 into users/amitjoshi/copilotSiteCreateQuickPick
…itableFileSystemProvider for improved content management
@amitjoshi438 amitjoshi438 requested review from a team as code owners December 12, 2024 08:43

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function populateSiteRecords(siteName: string, sitePagesList: string[], sitePages: any, orgUrl: string, telemetry: ITelemetry) {
return vscode.window.withProgress({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use showProgressWithNotification. You can modify it to pass progress parameter

}
const { siteName, siteDescription, sitePages } = await fetchSiteAndPageData(intelligenceAPIEndpointInfo.intelligenceEndpoint, intelligenceApiToken, userPrompt, sessionId, telemetry, stream, orgId, envId, userId);
const { siteName, siteDescription, sitePages, sitePagesList } = await fetchSiteAndPageData(intelligenceAPIEndpointInfo.intelligenceEndpoint, intelligenceApiToken, userPrompt, sessionId, telemetry, stream, orgId, envId, userId);

// eslint-disable-next-line @typescript-eslint/no-unused-vars
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's unused here?

}

export enum PowerPagesComponentType {
PublishingState = '1',
Copy link
Contributor

@priyanshu92 priyanshu92 Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment mentioning what are these numbers? Also, I think this is duplicate in SiteComponents.ts

Comment on lines +5 to +6


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extra lines can be removed

}

export enum PowerPagesComponentType {
PublishingState = '1',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment mentioning what are these numbers?

Comment on lines +142 to +146
export function base64ToArrayBuffer(base64String: string): ArrayBuffer {
const binaryString = atob(base64String);
const bytes = new Uint8Array(binaryString.length).map((_, i) => binaryString.charCodeAt(i));
return bytes.buffer;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be moved to common utils

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants