mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
fix bugs in navigation validation (#20844)
* fix bugs in navigation validation * fix sql db tutorial link, convert doc links
This commit is contained in:
@@ -347,27 +347,27 @@ export class DashboardTab extends TabBase<DashboardTab> {
|
|||||||
{
|
{
|
||||||
title: loc.DASHBOARD_HELP_LINK_MIGRATE_USING_ADS,
|
title: loc.DASHBOARD_HELP_LINK_MIGRATE_USING_ADS,
|
||||||
description: loc.DASHBOARD_HELP_DESCRIPTION_MIGRATE_USING_ADS,
|
description: loc.DASHBOARD_HELP_DESCRIPTION_MIGRATE_USING_ADS,
|
||||||
link: 'https://docs.microsoft.com/azure/dms/migration-using-azure-data-studio'
|
link: 'https://learn.microsoft.com/azure/dms/migration-using-azure-data-studio'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: loc.DASHBOARD_HELP_LINK_MI_TUTORIAL,
|
title: loc.DASHBOARD_HELP_LINK_MI_TUTORIAL,
|
||||||
description: loc.DASHBOARD_HELP_DESCRIPTION_MI_TUTORIAL,
|
description: loc.DASHBOARD_HELP_DESCRIPTION_MI_TUTORIAL,
|
||||||
link: 'https://docs.microsoft.com/azure/dms/tutorial-sql-server-managed-instance-online-ads'
|
link: 'https://learn.microsoft.com/azure/dms/tutorial-sql-server-managed-instance-online-ads'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: loc.DASHBOARD_HELP_LINK_VM_TUTORIAL,
|
title: loc.DASHBOARD_HELP_LINK_VM_TUTORIAL,
|
||||||
description: loc.DASHBOARD_HELP_DESCRIPTION_VMTUTORIAL,
|
description: loc.DASHBOARD_HELP_DESCRIPTION_VMTUTORIAL,
|
||||||
link: 'https://docs.microsoft.com/azure/dms/tutorial-sql-server-to-virtual-machine-online-ads'
|
link: 'https://learn.microsoft.com/azure/dms/tutorial-sql-server-to-virtual-machine-online-ads'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: loc.DASHBOARD_HELP_LINK_SQLDB_TUTORIAL,
|
title: loc.DASHBOARD_HELP_LINK_SQLDB_TUTORIAL,
|
||||||
description: loc.DASHBOARD_HELP_DESCRIPTION_SQLDBTUTORIAL,
|
description: loc.DASHBOARD_HELP_DESCRIPTION_SQLDBTUTORIAL,
|
||||||
link: 'https://docs.microsoft.com/azure/dms/tutorial-sql-server-to-sql-db-offline-ads'
|
link: 'https://learn.microsoft.com/azure/dms/tutorial-sql-server-azure-sql-database-offline-ads'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: loc.DASHBOARD_HELP_LINK_DMS_GUIDE,
|
title: loc.DASHBOARD_HELP_LINK_DMS_GUIDE,
|
||||||
description: loc.DASHBOARD_HELP_DESCRIPTION_DMS_GUIDE,
|
description: loc.DASHBOARD_HELP_DESCRIPTION_DMS_GUIDE,
|
||||||
link: 'https://docs.microsoft.com/data-migration/'
|
link: 'https://learn.microsoft.com/data-migration/'
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -558,10 +558,6 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async onPageEnter(pageChangeInfo: azdata.window.WizardPageChangeInfo): Promise<void> {
|
public async onPageEnter(pageChangeInfo: azdata.window.WizardPageChangeInfo): Promise<void> {
|
||||||
if (pageChangeInfo.newPage < pageChangeInfo.lastPage) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.wizard.registerNavigationValidator((pageChangeInfo) => {
|
this.wizard.registerNavigationValidator((pageChangeInfo) => {
|
||||||
this.wizard.message = { text: '' };
|
this.wizard.message = { text: '' };
|
||||||
if (pageChangeInfo.newPage < pageChangeInfo.lastPage) {
|
if (pageChangeInfo.newPage < pageChangeInfo.lastPage) {
|
||||||
@@ -585,20 +581,14 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
this.wizard.nextButton.enabled = false;
|
|
||||||
await this.constructDetails();
|
await this.constructDetails();
|
||||||
this.wizard.nextButton.enabled = this.migrationStateModel._assessmentResults !== undefined;
|
this.wizard.nextButton.enabled = this.migrationStateModel._assessmentResults !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async onPageLeave(pageChangeInfo: azdata.window.WizardPageChangeInfo): Promise<void> {
|
public async onPageLeave(pageChangeInfo: azdata.window.WizardPageChangeInfo): Promise<void> {
|
||||||
|
this.wizard.message = { text: '' };
|
||||||
|
this.wizard.registerNavigationValidator((pageChangeInfo) => true);
|
||||||
this.eventListener?.dispose();
|
this.eventListener?.dispose();
|
||||||
this.wizard.message = {
|
|
||||||
text: '',
|
|
||||||
level: azdata.window.MessageLevel.Error
|
|
||||||
};
|
|
||||||
this.wizard.registerNavigationValidator((pageChangeInfo) => {
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async handleStateChange(e: StateChangeEvent): Promise<void> {
|
protected async handleStateChange(e: StateChangeEvent): Promise<void> {
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ export class TargetSelectionPage extends MigrationWizardPage {
|
|||||||
if (!targetMi || resourceDropdownValue === constants.NO_MANAGED_INSTANCE_FOUND) {
|
if (!targetMi || resourceDropdownValue === constants.NO_MANAGED_INSTANCE_FOUND) {
|
||||||
errors.push(constants.INVALID_MANAGED_INSTANCE_ERROR);
|
errors.push(constants.INVALID_MANAGED_INSTANCE_ERROR);
|
||||||
}
|
}
|
||||||
if (targetMi.properties.state !== 'Ready') {
|
if (targetMi?.properties?.state !== 'Ready') {
|
||||||
errors.push(constants.MI_NOT_READY_ERROR(targetMi.name, targetMi.properties.state));
|
errors.push(constants.MI_NOT_READY_ERROR(targetMi.name, targetMi.properties.state));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -168,7 +168,7 @@ export class TargetSelectionPage extends MigrationWizardPage {
|
|||||||
errors.push(constants.INVALID_SQL_DATABASE_ERROR);
|
errors.push(constants.INVALID_SQL_DATABASE_ERROR);
|
||||||
}
|
}
|
||||||
// TODO: verify what state check is needed/possible?
|
// TODO: verify what state check is needed/possible?
|
||||||
if (targetSqlDB.properties.state !== 'Ready') {
|
if (targetSqlDB?.properties?.state !== 'Ready') {
|
||||||
errors.push(constants.SQLDB_NOT_READY_ERROR(targetSqlDB.name, targetSqlDB.properties.state));
|
errors.push(constants.SQLDB_NOT_READY_ERROR(targetSqlDB.name, targetSqlDB.properties.state));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -666,6 +666,8 @@ export class TargetSelectionPage extends MigrationWizardPage {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await this._validateFields();
|
||||||
} else {
|
} else {
|
||||||
this.migrationStateModel._targetServerInstance = undefined!;
|
this.migrationStateModel._targetServerInstance = undefined!;
|
||||||
if (isSqlDbTarget) {
|
if (isSqlDbTarget) {
|
||||||
@@ -751,7 +753,10 @@ export class TargetSelectionPage extends MigrationWizardPage {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
.withValidation(table => table.dataValues !== undefined && table.dataValues.length > 0)
|
.withValidation(
|
||||||
|
table =>
|
||||||
|
this.migrationStateModel._targetType !== MigrationTargetType.SQLDB
|
||||||
|
|| (table.dataValues !== undefined && table.dataValues.length > 0))
|
||||||
.component();
|
.component();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1012,4 +1017,16 @@ export class TargetSelectionPage extends MigrationWizardPage {
|
|||||||
}
|
}
|
||||||
return errors;
|
return errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async _validateFields(): Promise<void> {
|
||||||
|
await this._azureAccountsDropdown.validate();
|
||||||
|
await this._accountTenantDropdown.validate();
|
||||||
|
await this._azureSubscriptionDropdown.validate();
|
||||||
|
await this._azureLocationDropdown.validate();
|
||||||
|
await this._azureResourceGroupDropdown.validate();
|
||||||
|
await this._azureResourceDropdown.validate();
|
||||||
|
await this._targetPasswordInputBox.validate();
|
||||||
|
await this._targetUserNameInputBox.validate();
|
||||||
|
await this._azureResourceTable.validate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user