Encryption welcome dialog followup (#21101)

This commit is contained in:
Hai Cao
2022-11-03 20:16:16 -07:00
committed by GitHub
parent 25b0e07366
commit 222afe12c1

View File

@@ -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 {