[Sql Migration] Stabilize save and close logic and fix related ux bugs (#18579)

* add loadSavedInfo function in stateMachine; only open wizard if didLoadSavedInfo

* * add loadSavedInfo function in stateMachine; only open wizard if didLoadSavedInfo
* replaced savedInfo.miggrationServiceId string with sqlMigrationServer object
* selectDatbasesFromList helper function to check previously selected dbs in dbSelectorPage and sqlDatabaseTree

* * remove savedInfo references from targetSelectionPage, migrationModePage
* add selectDefaultDropdownValue helper to stateMachine to handle unify savedInfo selection logic
* add updateDropdownLoadingStatus to targetSelectionPage
* check if values exist before making api calls in statemachine

* removed savedInfo references from databaseBackupPage, integrationRuntimePage

* databaseBackupPage - targetDatabaseNames, networkShares, blobs need to rely on savedInfo as user may update the list of migrationdbs during the retry/saveAndClose

* re-add serverAssessments to savedInfo; only getAssessments if it does not exist or needs to be updated; fix networkShare type savedInfo

* rename _assessmentDbs to _databasesForAssessment; _migrationDbs to _databasesForMigration

* load blobs/networkshares savedinfo; move selectDefaultDropdownValue to utils

* fix selectDefaultDropdownValue; refreshDatabaseBackupPage when user changes target subscription or location
This commit is contained in:
Rachel Kim
2022-03-04 16:00:44 -08:00
committed by GitHub
parent c9aa3e9f4b
commit 33259764f7
17 changed files with 621 additions and 643 deletions

View File

@@ -50,6 +50,16 @@ export class SavedAssessmentDialog {
reject(ex);
}
});
dialog.registerCloseValidator(async () => {
if (this.stateModel.resumeAssessment) {
if (!this.stateModel.loadSavedInfo()) {
void vscode.window.showInformationMessage(constants.OPEN_SAVED_INFO_ERROR);
return false;
}
}
return true;
});
});
}
@@ -67,14 +77,8 @@ export class SavedAssessmentDialog {
}
protected async execute() {
if (this.stateModel.resumeAssessment) {
const wizardController = new WizardController(this.context, this.stateModel);
await wizardController.openWizard(this.stateModel.sourceConnectionId);
} else {
// normal flow
const wizardController = new WizardController(this.context, this.stateModel);
await wizardController.openWizard(this.stateModel.sourceConnectionId);
}
const wizardController = new WizardController(this.context, this.stateModel);
await wizardController.openWizard(this.stateModel.sourceConnectionId);
this._isOpen = false;
}
@@ -90,7 +94,7 @@ export class SavedAssessmentDialog {
const buttonGroup = 'resumeMigration';
const radioStart = view.modelBuilder.radioButton().withProps({
label: constants.START_MIGRATION,
label: constants.START_NEW_SESSION,
name: buttonGroup,
CSSStyles: {
...styles.BODY_CSS,
@@ -105,7 +109,7 @@ export class SavedAssessmentDialog {
}
});
const radioContinue = view.modelBuilder.radioButton().withProps({
label: constants.CONTINUE_MIGRATION,
label: constants.RESUME_SESSION,
name: buttonGroup,
CSSStyles: {
...styles.BODY_CSS,
@@ -122,11 +126,9 @@ export class SavedAssessmentDialog {
const flex = view.modelBuilder.flexContainer()
.withLayout({
flexFlow: 'column',
height: '100%',
width: '100%',
}).withProps({
CSSStyles: {
'margin': '20px 15px',
'padding': '20px 15px',
}
}).component();
flex.addItem(radioStart, { flex: '0 0 auto' });
@@ -134,5 +136,4 @@ export class SavedAssessmentDialog {
return flex;
}
}