mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 17:22:59 -05:00
Tenant list UI for Firewall Rules (#11539)
* Start on the tenant list * continue work * Finish up... * Fix test * Fix * Fix tests * Some PR feedback * Move responsibilities around * Fix comment
This commit is contained in:
@@ -18,6 +18,7 @@ export class AccountPickerViewModel {
|
||||
public get updateAccountListEvent(): Event<UpdateAccountListEventParams> { return this._updateAccountListEmitter.event; }
|
||||
|
||||
public selectedAccount: azdata.Account | undefined;
|
||||
public selectedTenantId: string | undefined;
|
||||
|
||||
constructor(
|
||||
_providerId: string,
|
||||
@@ -35,13 +36,12 @@ export class AccountPickerViewModel {
|
||||
* Loads an initial list of accounts from the account management service
|
||||
* @return Promise to return the list of accounts
|
||||
*/
|
||||
public initialize(): Thenable<azdata.Account[]> {
|
||||
// Load a baseline of the accounts for the provider
|
||||
return this._accountManagementService.getAccounts()
|
||||
.then(undefined, () => {
|
||||
// In the event we failed to lookup accounts for the provider, just send
|
||||
// back an empty collection
|
||||
return [];
|
||||
});
|
||||
public async initialize(): Promise<azdata.Account[]> {
|
||||
try {
|
||||
const accounts = await this._accountManagementService.getAccounts();
|
||||
return accounts;
|
||||
} catch{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import * as azdata from 'azdata';
|
||||
export class FirewallRuleViewModel {
|
||||
public isIPAddressSelected: boolean;
|
||||
public selectedAccount: azdata.Account | undefined;
|
||||
public selectedTenantId: string | undefined;
|
||||
|
||||
private _defaultIPAddress?: string;
|
||||
private _defaultFromSubnetIPRange?: string;
|
||||
|
||||
Reference in New Issue
Block a user