mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Fixing the disabled next button on migration wizard (#15226)
* Fixing the next button disabled on wizard * vbump extension
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -49,7 +49,7 @@ export class AccountsSelectionPage extends MigrationWizardPage {
|
||||
})
|
||||
.withValidation((c) => {
|
||||
if (c.value) {
|
||||
if ((<azdata.CategoryValue>c.value).displayName === constants.ACCOUNT_SELECTION_PAGE_NO_LINKED_ACCOUNTS_ERROR) {
|
||||
if ((<azdata.CategoryValue>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
|
||||
|
||||
@@ -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 = (<azdata.CategoryValue[]>this._resourceGroupDropdown.values).findIndex(v => v.displayName.toLowerCase() === resourceGroupName.toLowerCase());
|
||||
if (resourceGroupName.toLowerCase() === (<azdata.CategoryValue>this._resourceGroupDropdown.value).displayName.toLowerCase()) {
|
||||
this.populateDms(resourceGroupName);
|
||||
} else {
|
||||
this._resourceGroupDropdown.value = this._resourceGroupDropdown.values[index];
|
||||
}
|
||||
index = (<azdata.CategoryValue[]>this._resourceGroupDropdown.values).findIndex(v => v.displayName.toLowerCase() === resourceGroupName.toLowerCase());
|
||||
}
|
||||
if ((<azdata.CategoryValue>this._resourceGroupDropdown.value)?.displayName.toLowerCase() === (<azdata.CategoryValue>this._resourceGroupDropdown.values[index])?.displayName.toLowerCase()) {
|
||||
this.populateDms((<azdata.CategoryValue>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<void> {
|
||||
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<void> {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -451,14 +451,14 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
errors.push('Please select databases to migrate');
|
||||
|
||||
}
|
||||
if ((<azdata.CategoryValue>this._managedInstanceSubscriptionDropdown.value).displayName === constants.NO_SUBSCRIPTIONS_FOUND) {
|
||||
if ((<azdata.CategoryValue>this._managedInstanceSubscriptionDropdown.value)?.displayName === constants.NO_SUBSCRIPTIONS_FOUND) {
|
||||
errors.push(constants.INVALID_SUBSCRIPTION_ERROR);
|
||||
}
|
||||
if ((<azdata.CategoryValue>this._azureLocationDropdown.value).displayName === constants.NO_LOCATION_FOUND) {
|
||||
if ((<azdata.CategoryValue>this._azureLocationDropdown.value)?.displayName === constants.NO_LOCATION_FOUND) {
|
||||
errors.push(constants.INVALID_LOCATION_ERROR);
|
||||
}
|
||||
|
||||
if ((<azdata.CategoryValue>this._managedInstanceSubscriptionDropdown.value).displayName === constants.RESOURCE_GROUP_NOT_FOUND) {
|
||||
if ((<azdata.CategoryValue>this._managedInstanceSubscriptionDropdown.value)?.displayName === constants.RESOURCE_GROUP_NOT_FOUND) {
|
||||
errors.push(constants.INVALID_RESOURCE_GROUP_ERROR);
|
||||
}
|
||||
const resourceDropdownValue = (<azdata.CategoryValue>this._resourceDropdown.value).displayName;
|
||||
|
||||
Reference in New Issue
Block a user