mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-20 01:25:37 -05:00
Validation in database selection wizard page added (#16561)
This commit is contained in:
@@ -434,6 +434,7 @@ export const LAST_BACKUP = localize('sql.migration.last.backup', "Last backup");
|
||||
export const DATABASE_FOR_MIGRATION = localize('sql.migration.database.migration', "Databases for migration");
|
||||
export const DATABASE_MIGRATE_TEXT = localize('sql.migrate.text', "Select database(s) that you want to migrate to Azure SQL");
|
||||
export const OFFLINE_CAPS = localize('sql.migration.offline.caps', "OFFLINE");
|
||||
export const SELECT_DATABASE_TO_CONTINUE = localize('sql.migration.select.database.to.continue', "Please select 1 or more databases to assess for migration");
|
||||
|
||||
//Assessment Dialog
|
||||
export const ISSUES = localize('sql.migration.issues', "Issues");
|
||||
|
||||
@@ -77,6 +77,20 @@ export class DatabaseSelectorPage extends MigrationWizardPage {
|
||||
|
||||
public async onPageEnter(): Promise<void> {
|
||||
this.wizard.registerNavigationValidator((pageChangeInfo) => {
|
||||
this.wizard.message = {
|
||||
text: '',
|
||||
level: azdata.window.MessageLevel.Error
|
||||
};
|
||||
if (pageChangeInfo.newPage < pageChangeInfo.lastPage) {
|
||||
return true;
|
||||
}
|
||||
if (this.selectedDbs().length === 0) {
|
||||
this.wizard.message = {
|
||||
text: constants.SELECT_DATABASE_TO_CONTINUE,
|
||||
level: azdata.window.MessageLevel.Error
|
||||
};
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
@@ -92,6 +106,10 @@ export class DatabaseSelectorPage extends MigrationWizardPage {
|
||||
|| assessedDatabases.some(db => selectedDatabases.indexOf(db) < 0);
|
||||
|
||||
this.migrationStateModel._databaseAssessment = selectedDatabases;
|
||||
this.wizard.message = {
|
||||
text: '',
|
||||
level: azdata.window.MessageLevel.Error
|
||||
};
|
||||
|
||||
this.wizard.registerNavigationValidator((pageChangeInfo) => {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user