Telemetry event name update for web worker and formatting update (#1028)

* Telemetry event name update for web worker and formatting update

* including bundle json latest
This commit is contained in:
tyaginidhi 2024-09-03 15:41:47 +05:30 коммит произвёл GitHub
Родитель 15eeb9439b
Коммит fe3db7f100
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 38 добавлений и 28 удалений

Просмотреть файл

@ -73,14 +73,14 @@
"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. Dont worry, you can try again.": "Something went wrong. Dont 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)",
"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": [

Просмотреть файл

@ -6,31 +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. Dont 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 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',
@ -45,4 +26,27 @@ export const RESPONSE_SCENARIOS = {
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. Dont 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.');
// 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';

Просмотреть файл

@ -84,6 +84,7 @@ async function loadContainer(config, swpId, entityInfo) {
try {
self.postMessage({
type: "telemetry-info",
methodName: loadContainer.name,
eventName: "webExtensionWebWorkerLoadContainerStart",
});
@ -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,
});
@ -147,6 +149,7 @@ async function loadContainer(config, swpId, entityInfo) {
self.postMessage({
type: "telemetry-info",
methodName: "webWorker initialLoad",
eventName: "webExtensionContainerInitialPopulateSuccess",
});
}
@ -162,6 +165,7 @@ async function loadContainer(config, swpId, entityInfo) {
});
self.postMessage({
type: "telemetry-info",
methodName: "webWorker memberRemoved",
eventName: "webExtensionWebWorkerMemberRemovedSuccess",
userId: member.additionalDetails.AadObjectId,
});
@ -169,6 +173,7 @@ async function loadContainer(config, swpId, entityInfo) {
self.postMessage({
type: "telemetry-error",
methodName: "webWorker memberRemoved",
eventName: "webExtensionWebWorkerMemberRemovedFailed",
errorMessage: "Web Extension WebWorker Member Removed Failed",
});
}
@ -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,
});
@ -241,4 +247,4 @@ function runFluidApp() {
});
}
runFluidApp();
runFluidApp();