mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Capabilities Cache (#831)
* init * finished compile erros * fixed all merge conflicts * fix dialog problems * formatting * fix opening dialog on first open * fix various problems with connectiondialog * formatting * fix tests
This commit is contained in:
@@ -137,9 +137,9 @@ export class ConnectionManagementService implements IConnectionManagementService
|
||||
100 /* High Priority */
|
||||
));
|
||||
|
||||
if (_capabilitiesService && _capabilitiesService.onProviderRegisteredEvent) {
|
||||
_capabilitiesService.onProviderRegisteredEvent((capabilities => {
|
||||
if (capabilities.providerName === 'MSSQL') {
|
||||
if (_capabilitiesService) {
|
||||
_capabilitiesService.onCapabilitiesRegistered((p => {
|
||||
if (p === 'MSSQL') {
|
||||
if (!this.hasRegisteredServers()) {
|
||||
// prompt the user for a new connection on startup if no profiles are registered
|
||||
this.showConnectionDialog();
|
||||
@@ -679,21 +679,13 @@ export class ConnectionManagementService implements IConnectionManagementService
|
||||
return Object.keys(this._providers);
|
||||
}
|
||||
|
||||
public getCapabilities(providerName: string): sqlops.DataProtocolServerCapabilities {
|
||||
let capabilities = this._capabilitiesService.getCapabilities();
|
||||
if (capabilities !== undefined && capabilities.length > 0) {
|
||||
return capabilities.find(c => c.providerName === providerName);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public getAdvancedProperties(): sqlops.ConnectionOption[] {
|
||||
|
||||
let capabilities = this._capabilitiesService.getCapabilities();
|
||||
if (capabilities !== undefined && capabilities.length > 0) {
|
||||
let providers = this._capabilitiesService.providers;
|
||||
if (providers !== undefined && providers.length > 0) {
|
||||
// just grab the first registered provider for now, this needs to change
|
||||
// to lookup based on currently select provider
|
||||
let providerCapabilities = capabilities[0];
|
||||
let providerCapabilities = this._capabilitiesService.getCapabilities(providers[0]);
|
||||
if (!!providerCapabilities.connectionProvider) {
|
||||
return providerCapabilities.connectionProvider.options;
|
||||
}
|
||||
@@ -1362,7 +1354,7 @@ export class ConnectionManagementService implements IConnectionManagementService
|
||||
}
|
||||
|
||||
// Find the password option for the connection provider
|
||||
let passwordOption = this._capabilitiesService.getCapabilities().find(capability => capability.providerName === profile.providerName).connectionProvider.options.find(
|
||||
let passwordOption = this._capabilitiesService.getCapabilities(profile.providerName).connectionProvider.options.find(
|
||||
option => option.specialValueType === ConnectionOptionSpecialType.password);
|
||||
if (!passwordOption) {
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user