make connectiondialog react to provider event (#4544)

* make connectiondialog react to provider event

* fix unit test error

* code review comments
This commit is contained in:
Alan Ren
2019-03-15 14:47:23 -07:00
committed by GitHub
parent 86bac90001
commit 5caf0b02f0
2 changed files with 43 additions and 8 deletions

View File

@@ -102,6 +102,17 @@ export class ConnectionDialogWidget extends Modal {
super(localize('connection', 'Connection'), TelemetryKeys.Connection, _partService, telemetryService, clipboardService, _workbenchThemeService, contextKeyService, { hasSpinner: true, hasErrors: true });
}
/**
* Update the available connection providers, this is called when new providers are registered
* So that the connection type dropdown always has up to date values
*/
public updateConnectionProviders(providerTypeOptions: string[],
providerNameToDisplayNameMap: { [providerDisplayName: string]: string }) {
this.providerTypeOptions = providerTypeOptions;
this.providerNameToDisplayNameMap = providerNameToDisplayNameMap;
this.refresh();
}
public refresh(): void {
let filteredProviderTypes = this.providerTypeOptions;