Skip to content

Commit

Permalink
Merge branch 'main' into users/nityagi/CrossGeoAndECSflagReadFix
Browse files Browse the repository at this point in the history
  • Loading branch information
tyaginidhi committed Sep 10, 2024
2 parents edce327 + 5db529f commit f794ec6
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 10 deletions.
6 changes: 5 additions & 1 deletion gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const packagedir = path.resolve('./package');
const feedPAT = argv.feedPAT || process.env['AZ_DevOps_Read_PAT'];
const isOfficialBuild = argv.isOfficialBuild && argv.isOfficialBuild.toLowerCase() == "true";
const isPreviewBuild = argv.isPreviewBuild && argv.isPreviewBuild.toLowerCase() == "true";
const feedName = argv.useFeed || 'nuget.org';

async function clean() {
(await pslist())
Expand Down Expand Up @@ -121,6 +122,10 @@ async function nugetInstall(nugetSource, packageName, version, targetDir) {
// https://dev.azure.com/msazure/One/_packaging?_a=feed&feed=CAP_ISVExp_Tools_Stable
baseUrl: 'https://pkgs.dev.azure.com/msazure/_packaging/b0441cf8-0bc8-4fad-b126-841a6184e784/nuget/v3/flat2/'
},
'Power_Platform_Tools_Feed': {
authenticated: true,
baseUrl: 'https://pkgs.dev.azure.com/dynamicscrm/OneCRM/_packaging/6f6505ca-e632-4c4c-9115-6d45f61758cc/nuget/v3/flat2/'
}
}

const selectedFeed = feeds[nugetSource];
Expand Down Expand Up @@ -350,7 +355,6 @@ async function snapshot() {
}
}

const feedName = 'nuget.org';
const cliVersion = '1.34.4';

const recompile = gulp.series(
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 16 additions & 2 deletions src/client/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ import { disposeDiagnostics } from "./power-pages/validationDiagnostics";
import { bootstrapDiff } from "./power-pages/bootstrapdiff/BootstrapDiff";
import { CopilotNotificationShown } from "../common/copilot/telemetry/telemetryConstants";
import { copilotNotificationPanel, disposeNotificationPanel } from "../common/copilot/welcome-notification/CopilotNotificationPanel";
import { COPILOT_NOTIFICATION_DISABLED } from "../common/copilot/constants";
import { COPILOT_NOTIFICATION_DISABLED, EXTENSION_VERSION_KEY } from "../common/copilot/constants";
import { oneDSLoggerWrapper } from "../common/OneDSLoggerTelemetry/oneDSLoggerWrapper";
import { OrgChangeNotifier, orgChangeEvent } from "./OrgChangeNotifier";
import { ActiveOrgOutput } from "./pac/PacTypes";
import { desktopTelemetryEventNames } from "../common/OneDSLoggerTelemetry/client/desktopExtensionTelemetryEventNames";
import { ArtemisService } from "../common/services/ArtemisService";
import { workspaceContainsPortalConfigFolder } from "../common/utilities/PathFinderUtil";
import { getPortalsOrgURLs } from "../common/utilities/WorkspaceInfoFinderUtil";
import { SUCCESS } from "../common/constants";
import { EXTENSION_ID, SUCCESS } from "../common/constants";
import { AadIdKey } from "../common/OneDSLoggerTelemetry/telemetryConstants";

let client: LanguageClient;
Expand Down Expand Up @@ -419,6 +419,20 @@ function showNotificationForCopilot(telemetry: TelemetryReporter, telemetryData:
return;
}

const currentVersion = vscode.extensions.getExtension(EXTENSION_ID)?.packageJSON.version;
const storedVersion = _context.globalState.get(EXTENSION_VERSION_KEY);

if (!storedVersion || storedVersion !== currentVersion) {
// Show notification panel for the first load or after an update
telemetry.sendTelemetryEvent(CopilotNotificationShown, { listOfOrgs: telemetryData, countOfActivePortals });
oneDSLoggerWrapper.getLogger().traceInfo(CopilotNotificationShown, { listOfOrgs: telemetryData, countOfActivePortals });
copilotNotificationPanel(_context, telemetry, telemetryData, countOfActivePortals);

// Update the stored version to the current version
_context.globalState.update(EXTENSION_VERSION_KEY, currentVersion);
return;
}

const isCopilotNotificationDisabled = _context.globalState.get(COPILOT_NOTIFICATION_DISABLED, false);

if (!isCopilotNotificationDisabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const LIST_PROMPT = vscode.l10n.t('Write JavaScript code to highlight the
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 COPILOT_NOT_AVAILABLE_MSG = vscode.l10n.t('AI features have been disabled by your organization. Contact your admin for details. [Learn more](https://go.microsoft.com/fwlink/?linkid=2285848)');
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)');
Expand Down
1 change: 1 addition & 0 deletions src/common/copilot/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const ATTRIBUTE_DATAFIELD_NAME = 'datafieldname';
export const ATTRIBUTE_CLASSID = 'classid';
export const SYSTEFORMS_API_PATH = 'api/data/v9.2/systemforms';
export const COPILOT_IN_POWERPAGES = 'Copilot In Power Pages'
export const EXTENSION_VERSION_KEY = 'extensionVersion';

export type WebViewMessage = {
type: string;
Expand Down
19 changes: 17 additions & 2 deletions src/web/client/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { PowerPagesNavigationProvider } from "./webViews/powerPagesNavigationPro
import * as copilot from "../../common/copilot/PowerPagesCopilot";
import { IOrgInfo } from "../../common/copilot/model";
import { copilotNotificationPanel, disposeNotificationPanel } from "../../common/copilot/welcome-notification/CopilotNotificationPanel";
import { COPILOT_NOTIFICATION_DISABLED } from "../../common/copilot/constants";
import { COPILOT_NOTIFICATION_DISABLED, EXTENSION_VERSION_KEY } from "../../common/copilot/constants";
import * as Constants from "./common/constants"
import { oneDSLoggerWrapper } from "../../common/OneDSLoggerTelemetry/oneDSLoggerWrapper";
import { GeoNames } from "../../common/OneDSLoggerTelemetry/telemetryConstants";
Expand All @@ -44,6 +44,7 @@ import { IPortalWebExtensionInitQueryParametersTelemetryData } from "../../commo
import { ArtemisService } from "../../common/services/ArtemisService";
import { showErrorDialog } from "../../common/utilities/errorHandlerUtil";
import { ServiceEndpointCategory } from "../../common/services/Constants";
import { EXTENSION_ID } from "../../common/constants";

export function activate(context: vscode.ExtensionContext): void {
// setup telemetry
Expand Down Expand Up @@ -623,11 +624,25 @@ function showNotificationForCopilot(context: vscode.ExtensionContext, orgId: str
return;
}

const currentVersion = vscode.extensions.getExtension(EXTENSION_ID)?.packageJSON.version;
const storedVersion = context.globalState.get(EXTENSION_VERSION_KEY);

if (!storedVersion || storedVersion !== currentVersion) {
// Show notification panel for the first load or after an update
WebExtensionContext.telemetry.sendInfoTelemetry(webExtensionTelemetryEventNames.WEB_EXTENSION_WEB_COPILOT_NOTIFICATION_SHOWN,
{ orgId: orgId });
const telemetryData = JSON.stringify({ orgId: orgId });
copilotNotificationPanel(context, WebExtensionContext.telemetry.getTelemetryReporter(), telemetryData);

// Update the stored version to the current version
context.globalState.update(EXTENSION_VERSION_KEY, currentVersion);
return;
}

const isCopilotNotificationDisabled = context.globalState.get(COPILOT_NOTIFICATION_DISABLED, false);
if (!isCopilotNotificationDisabled) {
WebExtensionContext.telemetry.sendInfoTelemetry(webExtensionTelemetryEventNames.WEB_EXTENSION_WEB_COPILOT_NOTIFICATION_SHOWN,
{ orgId: orgId });

const telemetryData = JSON.stringify({ orgId: orgId });
copilotNotificationPanel(context, WebExtensionContext.telemetry.getTelemetryReporter(), telemetryData);
}
Expand Down

0 comments on commit f794ec6

Please sign in to comment.