diff --git a/extensions/sql-migration/package.json b/extensions/sql-migration/package.json index b728a72c20..3b03284102 100644 --- a/extensions/sql-migration/package.json +++ b/extensions/sql-migration/package.json @@ -2,7 +2,7 @@ "name": "sql-migration", "displayName": "%displayName%", "description": "%description%", - "version": "0.0.10", + "version": "0.0.11", "publisher": "Microsoft", "preview": true, "license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/main/LICENSE.txt", diff --git a/extensions/sql-migration/src/wizard/accountsSelectionPage.ts b/extensions/sql-migration/src/wizard/accountsSelectionPage.ts index 6146abb700..447ca946fe 100644 --- a/extensions/sql-migration/src/wizard/accountsSelectionPage.ts +++ b/extensions/sql-migration/src/wizard/accountsSelectionPage.ts @@ -49,7 +49,7 @@ export class AccountsSelectionPage extends MigrationWizardPage { }) .withValidation((c) => { if (c.value) { - if ((c.value).displayName === constants.ACCOUNT_SELECTION_PAGE_NO_LINKED_ACCOUNTS_ERROR) { + if ((c.value)?.displayName === constants.ACCOUNT_SELECTION_PAGE_NO_LINKED_ACCOUNTS_ERROR) { this.wizard.message = { text: constants.ACCOUNT_SELECTION_PAGE_NO_LINKED_ACCOUNTS_ERROR, level: azdata.window.MessageLevel.Error diff --git a/extensions/sql-migration/src/wizard/integrationRuntimePage.ts b/extensions/sql-migration/src/wizard/integrationRuntimePage.ts index 5bfb5b2d1a..3c44f08c45 100644 --- a/extensions/sql-migration/src/wizard/integrationRuntimePage.ts +++ b/extensions/sql-migration/src/wizard/integrationRuntimePage.ts @@ -176,7 +176,6 @@ export class IntergrationRuntimePage extends MigrationWizardPage { }).component(); this._dmsDropdown = this._view.modelBuilder.dropDown().withProps({ - required: true, width: WIZARD_INPUT_COMPONENT_WIDTH, editable: true }).component(); @@ -231,8 +230,10 @@ export class IntergrationRuntimePage extends MigrationWizardPage { width: '18px' }).component(); - this._refreshButton.onDidClick((e) => { - this.loadStatus(); + this._refreshButton.onDidClick(async (e) => { + this._connectionStatusLoader.loading = true; + await this.loadStatus(); + this._connectionStatusLoader.loading = false; }); const connectionLabelContainer = this._view.modelBuilder.flexContainer().withProps({ @@ -261,11 +262,6 @@ export class IntergrationRuntimePage extends MigrationWizardPage { CSSStyles: { 'font-size': '13px' } - }).withValidation(component => { - if (component.style === 'error') { - return false; - } - return true; }).component(); const authenticationKeysLabel = this._view.modelBuilder.text().withProps({ @@ -276,7 +272,6 @@ export class IntergrationRuntimePage extends MigrationWizardPage { } }).component(); - this._copy1 = this._view.modelBuilder.button().withProps({ iconPath: IconPathHelper.copy, }).component(); @@ -302,7 +297,6 @@ export class IntergrationRuntimePage extends MigrationWizardPage { this._refresh2 = this._view.modelBuilder.button().withProps({ iconPath: IconPathHelper.refresh, }).component(); - this._authKeyTable = this._view.modelBuilder.declarativeTable().withProps({ columns: [ { @@ -357,7 +351,9 @@ export class IntergrationRuntimePage extends MigrationWizardPage { this._connectionStatusLoader = this._view.modelBuilder.loadingComponent().withItem( statusContainer - ).component(); + ).withProps({ + loading: false + }).component(); container.addItems( [ @@ -376,20 +372,19 @@ export class IntergrationRuntimePage extends MigrationWizardPage { this.migrationStateModel._sqlMigrationService = sqlMigrationService; this.migrationStateModel._nodeNames = serviceNodes; } - try { this._subscription.value = this.migrationStateModel._targetSubscription.name; this._location.value = await getLocationDisplayName(this.migrationStateModel._targetServerInstance.location); this._resourceGroupDropdown.values = await this.migrationStateModel.getAzureResourceGroupDropdownValues(this.migrationStateModel._targetSubscription); + + let index = 0; if (resourceGroupName) { - const index = (this._resourceGroupDropdown.values).findIndex(v => v.displayName.toLowerCase() === resourceGroupName.toLowerCase()); - if (resourceGroupName.toLowerCase() === (this._resourceGroupDropdown.value).displayName.toLowerCase()) { - this.populateDms(resourceGroupName); - } else { - this._resourceGroupDropdown.value = this._resourceGroupDropdown.values[index]; - } + index = (this._resourceGroupDropdown.values).findIndex(v => v.displayName.toLowerCase() === resourceGroupName.toLowerCase()); + } + if ((this._resourceGroupDropdown.value)?.displayName.toLowerCase() === (this._resourceGroupDropdown.values[index])?.displayName.toLowerCase()) { + this.populateDms((this._resourceGroupDropdown.value)?.displayName); } else { - this._resourceGroupDropdown.value = this._resourceGroupDropdown.values[0]; + this._resourceGroupDropdown.value = this._resourceGroupDropdown.values[index]; } } catch (error) { console.log(error); @@ -400,6 +395,9 @@ export class IntergrationRuntimePage extends MigrationWizardPage { } public async populateDms(resourceGroupName: string): Promise { + if (!resourceGroupName) { + return; + } this._dmsDropdown.loading = true; try { this._dmsDropdown.values = await this.migrationStateModel.getSqlMigrationServiceValues(this.migrationStateModel._targetSubscription, this.migrationStateModel._targetServerInstance, resourceGroupName); @@ -432,7 +430,6 @@ export class IntergrationRuntimePage extends MigrationWizardPage { } private async loadStatus(): Promise { - this._connectionStatusLoader.loading = true; try { if (this.migrationStateModel._sqlMigrationService) { const migrationService = await getSqlMigrationService( @@ -474,10 +471,6 @@ export class IntergrationRuntimePage extends MigrationWizardPage { }); } - this._dmsStatusInfoBox.validate(); - - - const data = [ [ { @@ -503,14 +496,10 @@ export class IntergrationRuntimePage extends MigrationWizardPage { ] ]; - this._authKeyTable.updateProperties({ - dataValues: data - }); + this._authKeyTable.dataValues = data; } } catch (e) { console.log(e); - } finally { - this._connectionStatusLoader.loading = false; } } } diff --git a/extensions/sql-migration/src/wizard/skuRecommendationPage.ts b/extensions/sql-migration/src/wizard/skuRecommendationPage.ts index 4e10d7a3a4..d558b464a0 100644 --- a/extensions/sql-migration/src/wizard/skuRecommendationPage.ts +++ b/extensions/sql-migration/src/wizard/skuRecommendationPage.ts @@ -451,14 +451,14 @@ export class SKURecommendationPage extends MigrationWizardPage { errors.push('Please select databases to migrate'); } - if ((this._managedInstanceSubscriptionDropdown.value).displayName === constants.NO_SUBSCRIPTIONS_FOUND) { + if ((this._managedInstanceSubscriptionDropdown.value)?.displayName === constants.NO_SUBSCRIPTIONS_FOUND) { errors.push(constants.INVALID_SUBSCRIPTION_ERROR); } - if ((this._azureLocationDropdown.value).displayName === constants.NO_LOCATION_FOUND) { + if ((this._azureLocationDropdown.value)?.displayName === constants.NO_LOCATION_FOUND) { errors.push(constants.INVALID_LOCATION_ERROR); } - if ((this._managedInstanceSubscriptionDropdown.value).displayName === constants.RESOURCE_GROUP_NOT_FOUND) { + if ((this._managedInstanceSubscriptionDropdown.value)?.displayName === constants.RESOURCE_GROUP_NOT_FOUND) { errors.push(constants.INVALID_RESOURCE_GROUP_ERROR); } const resourceDropdownValue = (this._resourceDropdown.value).displayName;