From 222afe12c1b0d76af4f735e1faf7af7caa42b7fb Mon Sep 17 00:00:00 2001 From: Hai Cao Date: Thu, 3 Nov 2022 20:16:16 -0700 Subject: [PATCH] Encryption welcome dialog followup (#21101) --- .../notifyEncryption/notifyEncryptionDialog.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/sql/workbench/contrib/welcome/notifyEncryption/notifyEncryptionDialog.ts b/src/sql/workbench/contrib/welcome/notifyEncryption/notifyEncryptionDialog.ts index c08245a0f3..0b823c86d0 100644 --- a/src/sql/workbench/contrib/welcome/notifyEncryption/notifyEncryptionDialog.ts +++ b/src/sql/workbench/contrib/welcome/notifyEncryption/notifyEncryptionDialog.ts @@ -18,6 +18,8 @@ import { ErrorMessageDialog } from 'sql/workbench/services/errorMessage/browser/ 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'; export class NotifyEncryptionDialog extends ErrorMessageDialog { private static NOTIFY_ENCRYPT_SHOWN = 'workbench.notifyEncryptionShown'; @@ -33,7 +35,8 @@ export class NotifyEncryptionDialog extends ErrorMessageDialog { @ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService, @IOpenerService openerService: IOpenerService, @IInstantiationService private _instantiationService: IInstantiationService, - @IStorageService private _storageService: IStorageService + @IStorageService private _storageService: IStorageService, + @IConnectionManagementService private _connectionManagementService: IConnectionManagementService, ) { super(themeService, clipboardService, layoutService, telemetryService, contextKeyService, logService, textResourcePropertiesService, openerService); } @@ -43,10 +46,15 @@ export class NotifyEncryptionDialog extends ErrorMessageDialog { return; } + this._storageService.store(NotifyEncryptionDialog.NOTIFY_ENCRYPT_SHOWN, true, StorageScope.GLOBAL, StorageTarget.MACHINE); + + if (!this._connectionManagementService.getConnections()?.some(conn => conn.providerName === mssqlProviderName)) { + return; + } + super.open(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.{0}We recommend you review the link below for more details.', '\n\n')); - this._storageService.store(NotifyEncryptionDialog.NOTIFY_ENCRYPT_SHOWN, true, StorageScope.GLOBAL, StorageTarget.MACHINE); + 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 {