mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-24 01:25:37 -05:00
Connection management service updates to support multiple providers (#9698)
* Connection management service work * Fix tests * Change how accounts are deleted * Be consistent with names * feedback * Fix based on feedback * Change sqltoolsservice version
This commit is contained in:
@@ -20,7 +20,7 @@ export class AccountPickerViewModel {
|
||||
public selectedAccount: azdata.Account | undefined;
|
||||
|
||||
constructor(
|
||||
private _providerId: string,
|
||||
_providerId: string,
|
||||
@IAccountManagementService private _accountManagementService: IAccountManagementService
|
||||
) {
|
||||
// Create our event emitters
|
||||
@@ -37,7 +37,7 @@ export class AccountPickerViewModel {
|
||||
*/
|
||||
public initialize(): Thenable<azdata.Account[]> {
|
||||
// Load a baseline of the accounts for the provider
|
||||
return this._accountManagementService.getAccountsForProvider(this._providerId)
|
||||
return this._accountManagementService.getAccounts()
|
||||
.then(undefined, () => {
|
||||
// In the event we failed to lookup accounts for the provider, just send
|
||||
// back an empty collection
|
||||
|
||||
@@ -47,6 +47,7 @@ export default class AccountStore implements IAccountStore {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public remove(key: azdata.AccountKey): Thenable<boolean> {
|
||||
return this.doOperation(() => {
|
||||
return this.readFromMemento()
|
||||
|
||||
@@ -20,8 +20,10 @@ export interface IAccountManagementService {
|
||||
addAccount(providerId: string): Thenable<void>;
|
||||
getAccountProviderMetadata(): Thenable<azdata.AccountProviderMetadata[]>;
|
||||
getAccountsForProvider(providerId: string): Thenable<azdata.Account[]>;
|
||||
getAccounts(): Thenable<azdata.Account[]>;
|
||||
getSecurityToken(account: azdata.Account, resource: azdata.AzureResource): Thenable<{ [key: string]: { token: string } }>;
|
||||
removeAccount(accountKey: azdata.AccountKey): Thenable<boolean>;
|
||||
removeAccounts(): Thenable<boolean>;
|
||||
refreshAccount(account: azdata.Account): Thenable<azdata.Account>;
|
||||
|
||||
// UI METHODS //////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user