mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-25 09:35:37 -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:
@@ -138,11 +138,10 @@ export class FirewallRuleDialog extends Modal {
|
||||
});
|
||||
this._accountPickerService.addAccountStartEvent(() => this.spinner = true);
|
||||
this._accountPickerService.onAccountSelectionChangeEvent((account) => this.onAccountSelectionChange(account));
|
||||
this._accountPickerService.onTenantSelectionChangeEvent((tenantId) => this.onTenantSelectionChange(tenantId));
|
||||
|
||||
const azureAccountSection = DOM.append(body, DOM.$('.azure-account-section.new-section'));
|
||||
const azureAccountLabel = localize('azureAccount', "Azure account");
|
||||
this.createLabelElement(azureAccountSection, azureAccountLabel, true);
|
||||
this._accountPickerService.renderAccountPicker(DOM.append(azureAccountSection, DOM.$('.dialog-input')));
|
||||
this._accountPickerService.renderAccountPicker(azureAccountSection);
|
||||
|
||||
const firewallRuleSection = DOM.append(body, DOM.$('.firewall-rule-section.new-section'));
|
||||
const firewallRuleLabel = localize('filewallRule', "Firewall rule");
|
||||
@@ -215,7 +214,9 @@ export class FirewallRuleDialog extends Modal {
|
||||
if (isHeader) {
|
||||
className += ' header';
|
||||
}
|
||||
DOM.append(container, DOM.$(`.${className}`)).innerText = content;
|
||||
const element = DOM.append(container, DOM.$(`.${className}`));
|
||||
element.innerText = content;
|
||||
return element;
|
||||
}
|
||||
|
||||
// Update theming that is specific to firewall rule flyout body
|
||||
@@ -289,6 +290,10 @@ export class FirewallRuleDialog extends Modal {
|
||||
}
|
||||
}
|
||||
|
||||
public onTenantSelectionChange(tenantId: string): void {
|
||||
this.viewModel.selectedTenantId = tenantId;
|
||||
}
|
||||
|
||||
public onServiceComplete() {
|
||||
this._createButton.enabled = true;
|
||||
this.spinner = false;
|
||||
|
||||
@@ -60,7 +60,7 @@ export class FirewallRuleDialogController {
|
||||
private async handleOnCreateFirewallRule(): Promise<void> {
|
||||
const resourceProviderId = this._resourceProviderId;
|
||||
try {
|
||||
const tenantId = this._connection.azureTenantId;
|
||||
const tenantId = this._firewallRuleDialog.viewModel.selectedTenantId;
|
||||
const token = await this._accountManagementService.getAccountSecurityToken(this._firewallRuleDialog.viewModel.selectedAccount!, tenantId, AzureResource.ResourceManagement);
|
||||
const securityTokenMappings = {
|
||||
[tenantId]: token
|
||||
|
||||
@@ -42,10 +42,6 @@
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
|
||||
.modal .firewall-rule-dialog .azure-account-section {
|
||||
height: 92px;
|
||||
}
|
||||
|
||||
/* Firewall rule description section */
|
||||
.modal .firewall-rule-dialog a:link {
|
||||
text-decoration: underline;
|
||||
|
||||
@@ -52,6 +52,7 @@ suite('Firewall rule dialog controller tests', () => {
|
||||
mockFirewallRuleViewModel.setup(x => x.updateDefaultValues(TypeMoq.It.isAny()))
|
||||
.returns((ipAddress) => undefined);
|
||||
mockFirewallRuleViewModel.object.selectedAccount = account;
|
||||
mockFirewallRuleViewModel.object.selectedTenantId = 'tenantId';
|
||||
mockFirewallRuleViewModel.object.isIPAddressSelected = true;
|
||||
|
||||
// Create a mocked out instantiation service
|
||||
|
||||
Reference in New Issue
Block a user