Skip to content

Commit

Permalink
Merge branch 'main' into users/amitjoshi/@powerpagesReemoveVariables
Browse files Browse the repository at this point in the history
  • Loading branch information
amitjoshi committed Sep 3, 2024
2 parents 8b2bbbc + fe3db7f commit 2b78c94
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 30 deletions.
8 changes: 4 additions & 4 deletions l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@
"Tell us more.": "Tell us more.",
"Try and be as specific as possible. Your feedback will be used to improve Copilot. <a href=\"https://privacy.microsoft.com/en-US/data-privacy-notice\"> View privacy details </a>": "Try and be as specific as possible. Your feedback will be used to improve Copilot. <a href=\"https://privacy.microsoft.com/en-US/data-privacy-notice\"> View privacy details </a>",
"Submit": "Submit",
"Hi! Power Pages lets you build secure, professional websites that you can quickly configure and publish across web browsers and devices.\n\nTo create your website, visit the [Power Pages](https://powerpages.microsoft.com/).\nReturn to this chat and @powerpages can help you write and edit your website code.": "Hi! Power Pages lets you build secure, professional websites that you can quickly configure and publish across web browsers and devices.\n\nTo create your website, visit the [Power Pages](https://powerpages.microsoft.com/).\nReturn to this chat and @powerpages can help you write and edit your website code.",
"Explain the following code {% include 'Page Copy'%}": "Explain the following code {% include 'Page Copy'%}",
"Hi! @powerpages can help you write, edit, and even summarize your website code.": "Hi! @powerpages can help you write, edit, and even summarize your website code.",
"Authentication failed. Please try again.": "Authentication failed. Please try again.",
"Copilot is not available. Please contact your administrator.": "Copilot is not available. Please contact your administrator.",
"Active auth profile is not found or has expired. Please try again.": "Active auth profile is not found or has expired. Please try again.",
"Something went wrong. Don’t worry, you can try again.": "Something went wrong. Don’t worry, you can try again.",
"Make sure AI-generated content is accurate and appropriate before using. [Learn more](https://go.microsoft.com/fwlink/?linkid=2240145) | [View terms](https://go.microsoft.com/fwlink/?linkid=2189520)": "Make sure AI-generated content is accurate and appropriate before using. [Learn more](https://go.microsoft.com/fwlink/?linkid=2240145) | [View terms](https://go.microsoft.com/fwlink/?linkid=2189520)",
"Checking for active auth profile...": "Checking for active auth profile...",
"Explain the following code {% include 'Page Copy'%}": "Explain the following code {% include 'Page Copy'%}",
"Hi! @powerpages can help you write, edit, and even summarize your website code.": "Hi! @powerpages can help you write, edit, and even summarize your website code.",
"Hi! Power Pages lets you build secure, professional websites that you can quickly configure and publish across web browsers and devices.\n\nTo create your website, visit the [Power Pages](https://powerpages.microsoft.com/).\nReturn to this chat and @powerpages can help you write and edit your website code.": "Hi! Power Pages lets you build secure, professional websites that you can quickly configure and publish across web browsers and devices.\n\nTo create your website, visit the [Power Pages](https://powerpages.microsoft.com/).\nReturn to this chat and @powerpages can help you write and edit your website code.",
"Select Folder for new PCF Control/Do not translate 'PCF' as it is a product name.": {
"message": "Select Folder for new PCF Control",
"comment": [
Expand Down Expand Up @@ -255,4 +255,4 @@
"The {0} represents profile's Azure Cloud Instances"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,12 @@
import * as vscode from 'vscode';
import { ADX_ENTITYFORM, ADX_ENTITYLIST } from '../../copilot/constants';

export const NO_PROMPT_MESSAGE = vscode.l10n.t('Hi! Power Pages lets you build secure, professional websites that you can quickly configure and publish across web browsers and devices.\n\nTo create your website, visit the [Power Pages](https://powerpages.microsoft.com/).\nReturn to this chat and @powerpages can help you write and edit your website code.');
// Constants
export const POWERPAGES_CHAT_PARTICIPANT_ID = 'powerpages';
export const RESPONSE_AWAITED_MSG = vscode.l10n.t('Working on it...');
export const AUTHENTICATION_FAILED_MSG = vscode.l10n.t('Authentication failed. Please try again.');
export const COPILOT_NOT_AVAILABLE_MSG = vscode.l10n.t('Copilot is not available. Please contact your administrator.');
export const PAC_AUTH_NOT_FOUND = vscode.l10n.t('Active auth profile is not found or has expired. Please try again.');
export const INVALID_RESPONSE = vscode.l10n.t('Something went wrong. Don’t worry, you can try again.');
export const DISCLAIMER_MESSAGE = vscode.l10n.t('Make sure AI-generated content is accurate and appropriate before using. [Learn more](https://go.microsoft.com/fwlink/?linkid=2240145) | [View terms](https://go.microsoft.com/fwlink/?linkid=2189520)');
export const PAC_AUTH_INPUT = vscode.l10n.t("Checking for active auth profile...");
export const SUPPORTED_ENTITIES = [ADX_ENTITYFORM, ADX_ENTITYLIST];
// Telemetry Event Names
export const VSCODE_EXTENSION_GITHUB_POWER_PAGES_AGENT_INVOKED = 'GitHubPowerPagesAgentInvoked';
export const VSCODE_EXTENSION_GITHUB_POWER_PAGES_AGENT_ORG_DETAILS = 'GitHubPowerPagesAgentOrgDetails';
export const VSCODE_EXTENSION_GITHUB_POWER_PAGES_AGENT_ORG_DETAILS_NOT_FOUND = 'GitHubPowerPagesAgentOrgDetailsNotFound';
export const VSCODE_EXTENSION_GITHUB_POWER_PAGES_AGENT_SCENARIO = 'GitHubPowerPagesAgentScenario';
export const VSCODE_EXTENSION_GITHUB_POWER_PAGES_AGENT_SCENARIO_FEEDBACK_THUMBSUP = 'GitHubPowerPagesAgentScenarioFeedbackThumbsUp';
export const VSCODE_EXTENSION_GITHUB_POWER_PAGES_AGENT_SCENARIO_FEEDBACK_THUMBSDOWN = 'GitHubPowerPagesAgentScenarioFeedbackThumbsDown';
export const VSCODE_EXTENSION_GITHUB_POWER_PAGES_AGENT_ERROR = 'GitHubPowerPagesAgentError';
export const SKIP_CODES = ["", null, undefined, "violation", "unclear", "explain"];
export const EXPLAIN_CODE_PROMPT = vscode.l10n.t('Explain the following code {% include \'Page Copy\'%}');
export const WEB_API_PROMPT = vscode.l10n.t('Write web API code to query active contact records.');
export const FORM_PROMPT = vscode.l10n.t('Write JavaScript code for form field validation to check phone field value is in the valid format.');
export const LIST_PROMPT = vscode.l10n.t('Write JavaScript code to highlight the row where email field is empty in table list.');
export const STATER_PROMPTS = "starterPrompts"
export const WELCOME_PROMPT = 'how can you help with coding for my website?'
export const WELCOME_MESSAGE = vscode.l10n.t('Hi! @powerpages can help you write, edit, and even summarize your website code.')
export const SUPPORTED_ENTITIES = [ADX_ENTITYFORM, ADX_ENTITYLIST];
export const SKIP_CODES = ["", null, undefined, "violation", "unclear", "explain"];
export const RESPONSE_SCENARIOS = {
PAC_AUTH_NOT_FOUND: 'PAC_AUTH_NOT_FOUND',
AUTHENTICATION_FAILED: 'AUTHENTICATION_FAILED',
Expand All @@ -45,5 +25,29 @@ export const RESPONSE_SCENARIOS = {
WEB_API_PROMPT: 'WEB_API_PROMPT',
WELCOME_PROMPT: 'WELCOME_PROMPT'
};

// Localized strings
export const EXPLAIN_CODE_PROMPT = vscode.l10n.t('Explain the following code {% include \'Page Copy\'%}');
export const WEB_API_PROMPT = vscode.l10n.t('Write web API code to query active contact records.');
export const FORM_PROMPT = vscode.l10n.t('Write JavaScript code for form field validation to check phone field value is in the valid format.');
export const LIST_PROMPT = vscode.l10n.t('Write JavaScript code to highlight the row where email field is empty in table list.');
export const WELCOME_MESSAGE = vscode.l10n.t('Hi! @powerpages can help you write, edit, and even summarize your website code.')
export const RESPONSE_AWAITED_MSG = vscode.l10n.t('Working on it...');
export const AUTHENTICATION_FAILED_MSG = vscode.l10n.t('Authentication failed. Please try again.');
export const COPILOT_NOT_AVAILABLE_MSG = vscode.l10n.t('Copilot is not available. Please contact your administrator.');
export const PAC_AUTH_NOT_FOUND = vscode.l10n.t('Active auth profile is not found or has expired. Please try again.');
export const INVALID_RESPONSE = vscode.l10n.t('Something went wrong. Don’t worry, you can try again.');
export const DISCLAIMER_MESSAGE = vscode.l10n.t('Make sure AI-generated content is accurate and appropriate before using. [Learn more](https://go.microsoft.com/fwlink/?linkid=2240145) | [View terms](https://go.microsoft.com/fwlink/?linkid=2189520)');
export const NO_PROMPT_MESSAGE = vscode.l10n.t('Hi! Power Pages lets you build secure, professional websites that you can quickly configure and publish across web browsers and devices.\n\nTo create your website, visit the [Power Pages](https://powerpages.microsoft.com/).\nReturn to this chat and @powerpages can help you write and edit your website code.');
export const PAC_AUTH_INPUT = vscode.l10n.t("Checking for active auth profile...");

// Telemetry Event Names
export const VSCODE_EXTENSION_GITHUB_POWER_PAGES_AGENT_INVOKED = 'GitHubPowerPagesAgentInvoked';
export const VSCODE_EXTENSION_GITHUB_POWER_PAGES_AGENT_ORG_DETAILS = 'GitHubPowerPagesAgentOrgDetails';
export const VSCODE_EXTENSION_GITHUB_POWER_PAGES_AGENT_ORG_DETAILS_NOT_FOUND = 'GitHubPowerPagesAgentOrgDetailsNotFound';
export const VSCODE_EXTENSION_GITHUB_POWER_PAGES_AGENT_SCENARIO = 'GitHubPowerPagesAgentScenario';
export const VSCODE_EXTENSION_GITHUB_POWER_PAGES_AGENT_SCENARIO_FEEDBACK_THUMBSUP = 'GitHubPowerPagesAgentScenarioFeedbackThumbsUp';
export const VSCODE_EXTENSION_GITHUB_POWER_PAGES_AGENT_SCENARIO_FEEDBACK_THUMBSDOWN = 'GitHubPowerPagesAgentScenarioFeedbackThumbsDown';
export const VSCODE_EXTENSION_GITHUB_POWER_PAGES_AGENT_ERROR = 'GitHubPowerPagesAgentError';


12 changes: 9 additions & 3 deletions src/web/client/common/worker/webworker.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ async function loadContainer(config, swpId, entityInfo) {
try {
self.postMessage({
type: "telemetry-info",
methodName: loadContainer.name,
eventName: "webExtensionWebWorkerLoadContainerStart",
});

Expand Down Expand Up @@ -139,6 +140,7 @@ async function loadContainer(config, swpId, entityInfo) {
self.postMessage({
type: "telemetry-error",
methodName: "webWorker initialLoad",
eventName: "webExtensionContainerInitialPopulateFailed",
errorMessage: error?.message,
error: error,
});
Expand All @@ -147,6 +149,7 @@ async function loadContainer(config, swpId, entityInfo) {

self.postMessage({
type: "telemetry-info",
methodName: "webWorker initialLoad",
eventName: "webExtensionContainerInitialPopulateSuccess",
});
}
Expand All @@ -162,13 +165,15 @@ async function loadContainer(config, swpId, entityInfo) {
});
self.postMessage({
type: "telemetry-info",
methodName: "webWorker memberRemoved",
eventName: "webExtensionWebWorkerMemberRemovedSuccess",
userId: member.additionalDetails.AadObjectId,
});
} else {
self.postMessage({
type: "telemetry-error",
methodName: "webWorker memberRemoved",
eventName: "webExtensionWebWorkerMemberRemovedFailed",
errorMessage: "Web Extension WebWorker Member Removed Failed",
});
}
Expand Down Expand Up @@ -203,14 +208,15 @@ async function loadContainer(config, swpId, entityInfo) {

self.postMessage({
type: "telemetry-info",
eventName:
"webExtensionWebWorkerGetUserIdByConnectionIdSuccess",
methodName: "webWorker valueChanged",
eventName: "webExtensionWebWorkerGetUserIdByConnectionIdSuccess",
userId: user.aadObjectId,
});
} catch (error) {
self.postMessage({
type: "telemetry-error",
methodName: "webWorker valueChanged",
eventName: "webExtensionWebWorkerGetUserIdByConnectionIdFailed",
errorMessage: error?.message,
error: error,
});
Expand Down Expand Up @@ -241,4 +247,4 @@ function runFluidApp() {
});
}

runFluidApp();
runFluidApp();

0 comments on commit 2b78c94

Please sign in to comment.