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:
Amir Omidi
2020-07-31 20:07:30 -07:00
committed by GitHub
parent 68e7a293ad
commit f941f9910b
15 changed files with 267 additions and 49 deletions

View File

@@ -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 [];
}
}
}

View File

@@ -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;