mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-31 09:35:39 -05:00
Respect 'showDashboard' disabled by default (#22907)
This commit is contained in:
@@ -124,7 +124,12 @@ export class CommandLineWorkbenchContribution implements IWorkbenchContribution,
|
||||
let showConnectDialogOnStartup: boolean = this._configurationService.getValue('workbench.showConnectDialogOnStartup');
|
||||
if (showConnectDialogOnStartup && !commandName && !profile && !this._connectionManagementService.hasRegisteredServers()) {
|
||||
// prompt the user for a new connection on startup if no profiles are registered
|
||||
await this._connectionManagementService.showConnectionDialog();
|
||||
await this._connectionManagementService.showConnectionDialog(undefined, {
|
||||
showDashboard: true,
|
||||
saveTheConnection: true,
|
||||
showConnectionDialogOnError: true,
|
||||
showFirewallRuleOnError: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
let connectedContext: azdata.ConnectedContext = undefined;
|
||||
@@ -235,7 +240,12 @@ export class CommandLineWorkbenchContribution implements IWorkbenchContribution,
|
||||
}
|
||||
|
||||
const connectionProfile = this.readProfileFromArgs(args);
|
||||
await this._connectionManagementService.showConnectionDialog(undefined, undefined, connectionProfile);
|
||||
await this._connectionManagementService.showConnectionDialog(undefined, {
|
||||
saveTheConnection: true,
|
||||
showDashboard: true,
|
||||
showConnectionDialogOnError: true,
|
||||
showFirewallRuleOnError: true
|
||||
}, connectionProfile);
|
||||
} catch (err) {
|
||||
this._notificationService.error(localize('errConnectUrl', "Could not open URL due to error {0}", getErrorMessage(err)));
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ suite('commandLineService tests', () => {
|
||||
const connectionManagementService: TypeMoq.Mock<IConnectionManagementService>
|
||||
= TypeMoq.Mock.ofType<IConnectionManagementService>(TestConnectionManagementService, TypeMoq.MockBehavior.Strict);
|
||||
|
||||
connectionManagementService.setup((c) => c.showConnectionDialog())
|
||||
connectionManagementService.setup((c) => c.showConnectionDialog(undefined, TypeMoq.It.isAny()))
|
||||
.returns(() => new Promise<void>((resolve, reject) => { resolve(); }))
|
||||
.verifiable();
|
||||
connectionManagementService.setup(c => c.hasRegisteredServers()).returns(() => false);
|
||||
|
||||
@@ -147,12 +147,16 @@ CommandsRegistry.registerCommand('azdata.connect',
|
||||
connectionManagementService.connect(connectionProfile, undefined, {
|
||||
saveTheConnection: true,
|
||||
showDashboard: true,
|
||||
params: undefined,
|
||||
showConnectionDialogOnError: true,
|
||||
showFirewallRuleOnError: true
|
||||
});
|
||||
} else {
|
||||
connectionManagementService.showConnectionDialog();
|
||||
connectionManagementService.showConnectionDialog(undefined, {
|
||||
saveTheConnection: true,
|
||||
showDashboard: true,
|
||||
showConnectionDialogOnError: true,
|
||||
showFirewallRuleOnError: true
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ CommandsRegistry.registerCommand({
|
||||
let options = {
|
||||
showDashboard: true,
|
||||
saveTheConnection: false,
|
||||
params: undefined,
|
||||
showConnectionDialogOnError: true,
|
||||
showFirewallRuleOnError: true
|
||||
};
|
||||
@@ -122,7 +121,6 @@ export class OEManageConnectionAction extends Action {
|
||||
}
|
||||
|
||||
let options: IConnectionCompletionOptions = {
|
||||
params: undefined,
|
||||
saveTheConnection: false,
|
||||
showConnectionDialogOnError: true,
|
||||
showDashboard: true,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -278,7 +278,6 @@ export class NewProfilerAction extends Task {
|
||||
let profilerInput = accessor.get<IInstantiationService>(IInstantiationService).createInstance(ProfilerInput, profile);
|
||||
await accessor.get<IEditorService>(IEditorService).openEditor(profilerInput, { pinned: true }, ACTIVE_GROUP);
|
||||
let options: IConnectionCompletionOptions = {
|
||||
params: undefined,
|
||||
saveTheConnection: false,
|
||||
showConnectionDialogOnError: true,
|
||||
showDashboard: false,
|
||||
|
||||
Reference in New Issue
Block a user