diff --git a/src/sql/platform/telemetry/common/telemetryKeys.ts b/src/sql/platform/telemetry/common/telemetryKeys.ts index 745a35893f..8b704bb30c 100644 --- a/src/sql/platform/telemetry/common/telemetryKeys.ts +++ b/src/sql/platform/telemetry/common/telemetryKeys.ts @@ -45,8 +45,6 @@ export const enum TelemetryView { ExtensionRecommendationDialog = 'ExtensionRecommendationDialog', LinkedAccounts = 'LinkedAccounts', Notebook = 'Notebook', - NotifyEncryptionDialog = 'NotifyEncryptionDialog', - NotifyHiddenTenantDialog = 'NotifyHiddenTenantDialog', ResultsPanel = 'ResultsPanel', Shell = 'Shell', SqlAssessment = 'SqlAssessment', diff --git a/src/sql/workbench/contrib/welcome/constants.ts b/src/sql/workbench/contrib/welcome/constants.ts index a077d70bff..0f4c3c3d44 100644 --- a/src/sql/workbench/contrib/welcome/constants.ts +++ b/src/sql/workbench/contrib/welcome/constants.ts @@ -3,8 +3,5 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -export const NOTIFY_ENCRYPT_SHOWN = 'workbench.notifyEncryptionShown'; -export const NOTIFY_HIDETENANT_SHOWN = 'workbench.notifyHiddenTenantShown'; - // Link is regularly updated with new information from release. export const NOTIFY_READMORE_LINK = 'https://aka.ms/azuredatastudio-connection'; diff --git a/src/sql/workbench/contrib/welcome/notifyEncryption/notifyEncryption.contribution.ts b/src/sql/workbench/contrib/welcome/notifyEncryption/notifyEncryption.contribution.ts deleted file mode 100644 index 8ef873c27b..0000000000 --- a/src/sql/workbench/contrib/welcome/notifyEncryption/notifyEncryption.contribution.ts +++ /dev/null @@ -1,25 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the Source EULA. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { Registry } from 'vs/platform/registry/common/platform'; -import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry, IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { NotifyEncryptionDialog } from 'sql/workbench/contrib/welcome/notifyEncryption/notifyEncryptionDialog' -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; - -export class NotifyEncryption extends Disposable implements IWorkbenchContribution { - - constructor( - @IInstantiationService private readonly _instantiationService: IInstantiationService, - ) { - super(); - const dialog = this._instantiationService.createInstance(NotifyEncryptionDialog); - dialog.render(); - dialog.open(); - } -} - -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(NotifyEncryption, LifecyclePhase.Starting); diff --git a/src/sql/workbench/contrib/welcome/notifyEncryption/notifyEncryptionDialog.ts b/src/sql/workbench/contrib/welcome/notifyEncryption/notifyEncryptionDialog.ts deleted file mode 100644 index 8f57c88cee..0000000000 --- a/src/sql/workbench/contrib/welcome/notifyEncryption/notifyEncryptionDialog.ts +++ /dev/null @@ -1,69 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the Source EULA. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import Severity from 'vs/base/common/severity'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { localize } from 'vs/nls'; -import * as DOM from 'vs/base/browser/dom'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry'; -import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; -import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfiguration'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ErrorMessageDialog } from 'sql/workbench/services/errorMessage/browser/errorMessageDialog'; -import { Link } from 'vs/platform/opener/browser/link'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; -import { mssqlProviderName } from 'sql/platform/connection/common/constants'; -import { TelemetryView } from 'sql/platform/telemetry/common/telemetryKeys'; -import { NOTIFY_ENCRYPT_SHOWN, NOTIFY_READMORE_LINK } from 'sql/workbench/contrib/welcome/constants'; - -export class NotifyEncryptionDialog extends ErrorMessageDialog { - - constructor( - @IThemeService themeService: IThemeService, - @IClipboardService clipboardService: IClipboardService, - @ILayoutService layoutService: ILayoutService, - @IAdsTelemetryService telemetryService: IAdsTelemetryService, - @IContextKeyService contextKeyService: IContextKeyService, - @ILogService logService: ILogService, - @ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService, - @IOpenerService openerService: IOpenerService, - @IInstantiationService private _instantiationService: IInstantiationService, - @IStorageService private _storageService: IStorageService, - @IConnectionManagementService private _connectionManagementService: IConnectionManagementService, - ) { - super(themeService, clipboardService, layoutService, telemetryService, contextKeyService, logService, textResourcePropertiesService, openerService); - } - - public override open(): void { - if (this._storageService.get(NOTIFY_ENCRYPT_SHOWN, StorageScope.APPLICATION)) { - return; - } - - this._storageService.store(NOTIFY_ENCRYPT_SHOWN, true, StorageScope.APPLICATION, StorageTarget.MACHINE); - - if (!this._connectionManagementService.getConnections()?.some(conn => conn.providerName === mssqlProviderName)) { - return; - } - - super.open(TelemetryView.NotifyEncryptionDialog, Severity.Info, - localize('notifyEncryption.title', 'Important Update'), - localize('notifyEncryption.message', 'Azure Data Studio now has encryption enabled by default for all SQL Server connections. This may result in your existing connections no longer working unless certain Encryption related connection properties are changed.{0}We recommend you review the link below for more details.', '\n\n')); - } - - protected override updateDialogBody(): void { - super.updateDialogBody(); - let moreInfoLink = DOM.append(this.getBody()!, DOM.$('.more-info')); - this._instantiationService.createInstance(Link, moreInfoLink, - { - label: localize('notifyEncryption.moreInfoLink', 'More information'), - href: NOTIFY_READMORE_LINK - }, undefined); - } -} diff --git a/src/sql/workbench/contrib/welcome/notifyHiddenTenant/notifyHiddenTenant.contribution.ts b/src/sql/workbench/contrib/welcome/notifyHiddenTenant/notifyHiddenTenant.contribution.ts deleted file mode 100644 index b3b1ea509f..0000000000 --- a/src/sql/workbench/contrib/welcome/notifyHiddenTenant/notifyHiddenTenant.contribution.ts +++ /dev/null @@ -1,25 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the Source EULA. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { Registry } from 'vs/platform/registry/common/platform'; -import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry, IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { NotifyHiddenTenantDialog } from 'sql/workbench/contrib/welcome/notifyHiddenTenant/notifyHiddenTenantDialog'; - -export class NotifyHiddenTenant extends Disposable implements IWorkbenchContribution { - - constructor( - @IInstantiationService private readonly _instantiationService: IInstantiationService, - ) { - super(); - const dialog = this._instantiationService.createInstance(NotifyHiddenTenantDialog); - dialog.render(); - dialog.open(); - } -} - -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(NotifyHiddenTenant, LifecyclePhase.Starting); diff --git a/src/sql/workbench/contrib/welcome/notifyHiddenTenant/notifyHiddenTenantDialog.ts b/src/sql/workbench/contrib/welcome/notifyHiddenTenant/notifyHiddenTenantDialog.ts deleted file mode 100644 index a02d315435..0000000000 --- a/src/sql/workbench/contrib/welcome/notifyHiddenTenant/notifyHiddenTenantDialog.ts +++ /dev/null @@ -1,79 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the Source EULA. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import Severity from 'vs/base/common/severity'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { localize } from 'vs/nls'; -import * as DOM from 'vs/base/browser/dom'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry'; -import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; -import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfiguration'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ErrorMessageDialog } from 'sql/workbench/services/errorMessage/browser/errorMessageDialog'; -import { Link } from 'vs/platform/opener/browser/link'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; -import { mssqlProviderName } from 'sql/platform/connection/common/constants'; -import { TelemetryView } from 'sql/platform/telemetry/common/telemetryKeys'; -import { NOTIFY_HIDETENANT_SHOWN, NOTIFY_READMORE_LINK } from 'sql/workbench/contrib/welcome/constants'; -import { IAccountManagementService } from 'sql/platform/accounts/common/interfaces'; -import { isMssqlAuthProviderEnabled } from 'sql/workbench/services/connection/browser/utils'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; - -export class NotifyHiddenTenantDialog extends ErrorMessageDialog { - - constructor( - @IThemeService themeService: IThemeService, - @IClipboardService clipboardService: IClipboardService, - @ILayoutService layoutService: ILayoutService, - @IAdsTelemetryService telemetryService: IAdsTelemetryService, - @IContextKeyService contextKeyService: IContextKeyService, - @ILogService logService: ILogService, - @ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService, - @IOpenerService openerService: IOpenerService, - @IInstantiationService private _instantiationService: IInstantiationService, - @IStorageService private _storageService: IStorageService, - @IConnectionManagementService private _connectionManagementService: IConnectionManagementService, - @IAccountManagementService private _accountManagementService: IAccountManagementService, - @IConfigurationService private _configurationService: IConfigurationService, - ) { - super(themeService, clipboardService, layoutService, telemetryService, contextKeyService, logService, textResourcePropertiesService, openerService); - } - - public override open(): void { - if (this._storageService.get(NOTIFY_HIDETENANT_SHOWN, StorageScope.APPLICATION)) { - return; - } - - this._storageService.store(NOTIFY_HIDETENANT_SHOWN, true, StorageScope.APPLICATION, StorageTarget.MACHINE); - this._accountManagementService.getAccounts().then(accounts => { - // Do not notify users who don't have any Azure connection in their list of connections and no Azure accounts registered - // or are not yet impacted with the changes from 'Enable Sql Authentication Provider' with MSAL - if (!this._connectionManagementService.getConnections()?.some(conn => conn.providerName === mssqlProviderName - && conn.authenticationType === 'AzureMFA') && (!accounts || accounts.length === 0) - && isMssqlAuthProviderEnabled(mssqlProviderName, this._configurationService)) { - return; - } - - super.open(TelemetryView.NotifyHiddenTenantDialog, Severity.Info, - localize('notifyHiddenTenant.title', 'Important Update'), - localize('notifyHiddenTenant.message', `Connections using Azure Active Directory authentication will now retrieve tenant information from the server during login. The 'Azure AD Tenant' entry no longer needs to be provided when connecting to Azure SQL instances.`, '\n\n')); - }); - } - - protected override updateDialogBody(): void { - super.updateDialogBody(); - let moreInfoLink = DOM.append(this.getBody()!, DOM.$('.more-info')); - this._instantiationService.createInstance(Link, moreInfoLink, - { - label: localize('notifyHiddenTenant.moreInfoLink', 'More information'), - href: NOTIFY_READMORE_LINK - }, undefined); - } -} diff --git a/src/vs/workbench/workbench.common.main.ts b/src/vs/workbench/workbench.common.main.ts index e2e988e8d6..9400a89e24 100644 --- a/src/vs/workbench/workbench.common.main.ts +++ b/src/vs/workbench/workbench.common.main.ts @@ -415,8 +415,6 @@ import 'vs/workbench/contrib/surveys/browser/languageSurveys.contribution'; // Welcome import 'vs/workbench/contrib/welcomeOverlay/browser/welcomeOverlay'; import 'sql/workbench/contrib/welcome/page/browser/welcomePage.contribution'; // {{SQL CARBON EDIT}} - add welcome page contribution -import 'sql/workbench/contrib/welcome/notifyEncryption/notifyEncryption.contribution'; // {{SQL CARBON EDIT}} - add notifying Encrypt change contribution -import 'sql/workbench/contrib/welcome/notifyHiddenTenant/notifyHiddenTenant.contribution'; // {{SQL CARBON EDIT}} - add notifying Hidden Tenant change contribution // import 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution'; // {{SQL CARBON EDIT}} - remove vscode getting started import 'vs/workbench/contrib/welcomeWalkthrough/browser/walkThrough.contribution'; import 'vs/workbench/contrib/welcomeViews/common/viewsWelcome.contribution';