mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 09:35:38 -05:00
Adding on change event in editable dropdowns when value is changes through code. (#14952)
* Adding onChange events in editable dropdowns for values changed through code. * moved event generation from angular wrapper to core component * Moving event firing to value setter * converting back updateSelection to private method * Removing extra check * Fixing broken tests by mocking used stuff * Fixing onTextChange event * Adding some tests * Adding necessary tests * small test name edit * Fix an assert message
This commit is contained in:
@@ -98,11 +98,13 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
width: WIZARD_INPUT_COMPONENT_WIDTH
|
||||
}).component();
|
||||
this._managedInstanceSubscriptionDropdown = view.modelBuilder.dropDown().withProps({
|
||||
width: WIZARD_INPUT_COMPONENT_WIDTH
|
||||
width: WIZARD_INPUT_COMPONENT_WIDTH,
|
||||
editable: true
|
||||
}).component();
|
||||
this._managedInstanceSubscriptionDropdown.onValueChanged((e) => {
|
||||
if (e.selected) {
|
||||
this.migrationStateModel._targetSubscription = this.migrationStateModel.getSubscription(e.index);
|
||||
if (e) {
|
||||
const selectedIndex = (<azdata.CategoryValue[]>this._managedInstanceSubscriptionDropdown.values)?.findIndex(v => v.displayName === e);
|
||||
this.migrationStateModel._targetSubscription = this.migrationStateModel.getSubscription(selectedIndex);
|
||||
this.migrationStateModel._targetServerInstance = undefined!;
|
||||
this.migrationStateModel._sqlMigrationService = undefined!;
|
||||
this.populateLocationAndResourceGroupDropdown();
|
||||
@@ -393,6 +395,7 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
this._resourceDropdown.loading = true;
|
||||
try {
|
||||
this._managedInstanceSubscriptionDropdown.values = await this.migrationStateModel.getSubscriptionsDropdownValues();
|
||||
this._managedInstanceSubscriptionDropdown.value = this._managedInstanceSubscriptionDropdown.values[0];
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user