mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
* Removing database name from server connection and adding required asterisk to database dropdowns * also remove database name in flat file import wizard
This commit is contained in:
@@ -67,19 +67,14 @@ export abstract class BasePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let db = c.options.databaseDisplayName;
|
|
||||||
let usr = c.options.user;
|
let usr = c.options.user;
|
||||||
let srv = c.options.server;
|
let srv = c.options.server;
|
||||||
|
|
||||||
if (!db) {
|
|
||||||
db = localize('basePage.defaultDb', '<default>');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!usr) {
|
if (!usr) {
|
||||||
usr = localize('basePage.defaultUser', 'default');
|
usr = localize('basePage.defaultUser', 'default');
|
||||||
}
|
}
|
||||||
|
|
||||||
let finalName = `${srv}, ${db} (${usr})`;
|
let finalName = `${srv} (${usr})`;
|
||||||
return {
|
return {
|
||||||
connection: c,
|
connection: c,
|
||||||
displayName: finalName,
|
displayName: finalName,
|
||||||
|
|||||||
@@ -96,9 +96,7 @@ export abstract class DacFxConfigPage extends BasePage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected async createDatabaseDropdown(): Promise<azdata.FormComponent> {
|
protected async createDatabaseDropdown(): Promise<azdata.FormComponent> {
|
||||||
this.databaseDropdown = this.view.modelBuilder.dropDown().withProperties({
|
this.databaseDropdown = this.view.modelBuilder.dropDown().component();
|
||||||
required: true
|
|
||||||
}).component();
|
|
||||||
|
|
||||||
// Handle database changes
|
// Handle database changes
|
||||||
this.databaseDropdown.onValueChanged(async () => {
|
this.databaseDropdown.onValueChanged(async () => {
|
||||||
@@ -107,7 +105,9 @@ export abstract class DacFxConfigPage extends BasePage {
|
|||||||
this.model.filePath = this.fileTextBox.value;
|
this.model.filePath = this.fileTextBox.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
this.databaseLoader = this.view.modelBuilder.loadingComponent().withItem(this.databaseDropdown).component();
|
this.databaseLoader = this.view.modelBuilder.loadingComponent().withItem(this.databaseDropdown).withProperties({
|
||||||
|
required: true
|
||||||
|
}).component();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
component: this.databaseLoader,
|
component: this.databaseLoader,
|
||||||
|
|||||||
@@ -157,14 +157,17 @@ export class DeployConfigPage extends DacFxConfigPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected async createDeployDatabaseDropdown(): Promise<azdata.FormComponent> {
|
protected async createDeployDatabaseDropdown(): Promise<azdata.FormComponent> {
|
||||||
this.databaseDropdown = this.view.modelBuilder.dropDown().withProperties({
|
this.databaseDropdown = this.view.modelBuilder.dropDown().component();
|
||||||
required: true
|
|
||||||
}).component();
|
|
||||||
//Handle database changes
|
//Handle database changes
|
||||||
this.databaseDropdown.onValueChanged(async () => {
|
this.databaseDropdown.onValueChanged(async () => {
|
||||||
this.model.database = (<azdata.CategoryValue>this.databaseDropdown.value).name;
|
this.model.database = (<azdata.CategoryValue>this.databaseDropdown.value).name;
|
||||||
});
|
});
|
||||||
this.databaseLoader = this.view.modelBuilder.loadingComponent().withItem(this.databaseDropdown).component();
|
|
||||||
|
this.databaseLoader = this.view.modelBuilder.loadingComponent().withItem(this.databaseDropdown).withProperties({
|
||||||
|
required: true
|
||||||
|
}).component();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
component: this.databaseLoader,
|
component: this.databaseLoader,
|
||||||
title: localize('dacFx.targetDatabaseDropdownTitle', 'Database Name')
|
title: localize('dacFx.targetDatabaseDropdownTitle', 'Database Name')
|
||||||
|
|||||||
@@ -64,19 +64,14 @@ export abstract class BasePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let db = c.options.databaseDisplayName;
|
|
||||||
let usr = c.options.user;
|
let usr = c.options.user;
|
||||||
let srv = c.options.server;
|
let srv = c.options.server;
|
||||||
|
|
||||||
if (!db) {
|
|
||||||
db = '<default>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!usr) {
|
if (!usr) {
|
||||||
usr = 'default';
|
usr = 'default';
|
||||||
}
|
}
|
||||||
|
|
||||||
let finalName = `${srv}, ${db} (${usr})`;
|
let finalName = `${srv} (${usr})`;
|
||||||
return {
|
return {
|
||||||
connection: c,
|
connection: c,
|
||||||
displayName: finalName,
|
displayName: finalName,
|
||||||
|
|||||||
Reference in New Issue
Block a user