Respect 'showDashboard' disabled by default (#22907)

This commit is contained in:
Cheena Malhotra
2023-05-01 11:55:38 -07:00
committed by GitHub
parent ea6bb41f45
commit 7b2a07befd
15 changed files with 39 additions and 26 deletions

View File

@@ -186,7 +186,12 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
connectButton.label = localize('serverTree.newConnection', "New Connection");
this._register(attachButtonStyler(connectButton, this._themeService));
this._register(connectButton.onDidClick(() => {
this._connectionManagementService.showConnectionDialog();
this._connectionManagementService.showConnectionDialog(undefined, {
showDashboard: true,
saveTheConnection: true,
showConnectionDialogOnError: true,
showFirewallRuleOnError: true
});
}));
}
@@ -872,7 +877,6 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
if (node instanceof ConnectionProfile) {
connectionProfile = node;
await TreeUpdateUtils.connectAndCreateOeSession(connectionProfile, {
params: undefined,
saveTheConnection: true,
showConnectionDialogOnError: true,
showFirewallRuleOnError: true,

View File

@@ -283,14 +283,14 @@ suite('SQL Connection Tree Action tests', () => {
});
});
test('AddServerAction - test if show connection dialog is called', () => {
test('AddServerAction - test if show connection dialog is called', async () => {
let connectionManagementService = createConnectionManagementService(true, undefined);
connectionManagementService.setup(x => x.showConnectionDialog(undefined, TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns(
() => new Promise<void>((resolve, reject) => resolve()));
let connectionTreeAction: AddServerAction = new AddServerAction(AddServerAction.ID, AddServerAction.LABEL, connectionManagementService.object);
let conProfGroup = new ConnectionProfileGroup('testGroup', undefined, 'testGroup', undefined, undefined);
return connectionTreeAction.run(conProfGroup).then((value) => {
connectionManagementService.verify(x => x.showConnectionDialog(undefined, undefined, TypeMoq.It.isAny()), TypeMoq.Times.once());
});
await connectionTreeAction.run(conProfGroup);
connectionManagementService.verify(x => x.showConnectionDialog(undefined, TypeMoq.It.isAny(), TypeMoq.It.isAny()), TypeMoq.Times.once());
});
test('ActiveConnectionsFilterAction - test if view is called to display filtered results', () => {