mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-30 17:23:29 -05:00
Fixes for Save & Close (#17341)
* wip * wip * fixes * cleanup * cleanup
This commit is contained in:
@@ -70,7 +70,6 @@ export class SavedAssessmentDialog {
|
||||
if (this.stateModel.resumeAssessment) {
|
||||
const wizardController = new WizardController(this.context, this.stateModel);
|
||||
await wizardController.openWizard(this.stateModel.sourceConnectionId);
|
||||
console.log(this.stateModel.savedInfo.selectedDatabases);
|
||||
} else {
|
||||
// normal flow
|
||||
const wizardController = new WizardController(this.context, this.stateModel);
|
||||
|
||||
@@ -115,12 +115,18 @@ export interface SavedInfo {
|
||||
selectedDatabases: azdata.DeclarativeTableCellValue[][];
|
||||
migrationTargetType: MigrationTargetType | null;
|
||||
migrationDatabases: azdata.DeclarativeTableCellValue[][];
|
||||
databaseList: string[];
|
||||
subscription: azureResource.AzureResourceSubscription | null;
|
||||
location: azureResource.AzureLocation | null;
|
||||
resourceGroup: azureResource.AzureResourceResourceGroup | null;
|
||||
targetServerInstance: azureResource.AzureSqlManagedInstance | SqlVMServer | null;
|
||||
migrationMode: MigrationMode | null;
|
||||
databaseAssessment: string[] | null;
|
||||
networkContainerType: NetworkContainerType | null;
|
||||
networkShare: NetworkShare | null;
|
||||
targetSubscription: azureResource.AzureResourceSubscription | null;
|
||||
blobs: Blob[];
|
||||
targetDatabaseNames: string[];
|
||||
}
|
||||
|
||||
|
||||
@@ -1019,12 +1025,18 @@ export class MigrationStateModel implements Model, vscode.Disposable {
|
||||
selectedDatabases: [],
|
||||
migrationTargetType: null,
|
||||
migrationDatabases: [],
|
||||
databaseList: [],
|
||||
subscription: null,
|
||||
location: null,
|
||||
resourceGroup: null,
|
||||
targetServerInstance: null,
|
||||
migrationMode: null,
|
||||
databaseAssessment: null
|
||||
databaseAssessment: null,
|
||||
networkContainerType: null,
|
||||
networkShare: null,
|
||||
targetSubscription: null,
|
||||
blobs: [],
|
||||
targetDatabaseNames: []
|
||||
};
|
||||
switch (currentPage) {
|
||||
case Page.Summary:
|
||||
@@ -1032,7 +1044,11 @@ export class MigrationStateModel implements Model, vscode.Disposable {
|
||||
case Page.IntegrationRuntime:
|
||||
|
||||
case Page.DatabaseBackup:
|
||||
|
||||
saveInfo.networkContainerType = this._databaseBackup.networkContainerType;
|
||||
saveInfo.networkShare = this._databaseBackup.networkShare;
|
||||
saveInfo.targetSubscription = this._databaseBackup.subscription;
|
||||
saveInfo.blobs = this._databaseBackup.blobs;
|
||||
saveInfo.targetDatabaseNames = this._targetDatabaseNames;
|
||||
case Page.MigrationMode:
|
||||
saveInfo.migrationMode = this._databaseBackup.migrationMode;
|
||||
case Page.SKURecommendation:
|
||||
@@ -1040,6 +1056,7 @@ export class MigrationStateModel implements Model, vscode.Disposable {
|
||||
saveInfo.databaseAssessment = this._databaseAssessment;
|
||||
saveInfo.serverAssessment = this._assessmentResults;
|
||||
saveInfo.migrationDatabases = this._databaseSelection;
|
||||
saveInfo.databaseList = this._migrationDbs;
|
||||
saveInfo.subscription = this._targetSubscription;
|
||||
saveInfo.location = this._location;
|
||||
saveInfo.resourceGroup = this._resourceGroup;
|
||||
|
||||
@@ -6,13 +6,14 @@
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { EOL } from 'os';
|
||||
import { getStorageAccountAccessKeys } from '../api/azure';
|
||||
import { getStorageAccountAccessKeys, SqlManagedInstance, SqlVMServer } from '../api/azure';
|
||||
import { MigrationWizardPage } from '../models/migrationWizardPage';
|
||||
import { Blob, MigrationMode, MigrationSourceAuthenticationType, MigrationStateModel, MigrationTargetType, NetworkContainerType, StateChangeEvent } from '../models/stateMachine';
|
||||
import { Blob, MigrationMode, MigrationSourceAuthenticationType, MigrationStateModel, MigrationTargetType, NetworkContainerType, Page, StateChangeEvent } from '../models/stateMachine';
|
||||
import * as constants from '../constants/strings';
|
||||
import { IconPathHelper } from '../constants/iconPathHelper';
|
||||
import { WIZARD_INPUT_COMPONENT_WIDTH } from './wizardController';
|
||||
import { findDropDownItemIndex, selectDropDownIndex } from '../api/utils';
|
||||
import { azureResource } from 'azureResource';
|
||||
import * as styles from '../constants/styles';
|
||||
|
||||
const WIZARD_TABLE_COLUMN_WIDTH = '200px';
|
||||
@@ -282,6 +283,9 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
}
|
||||
return true;
|
||||
}).component();
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.MigrationMode) {
|
||||
this._networkSharePath.value = this.migrationStateModel.savedInfo.networkShare?.networkShareLocation;
|
||||
}
|
||||
this._disposables.push(this._networkSharePath.onTextChanged(async (value) => {
|
||||
await this.validateFields();
|
||||
this.migrationStateModel._databaseBackup.networkShare.networkShareLocation = value;
|
||||
@@ -327,6 +331,9 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
}
|
||||
return true;
|
||||
}).component();
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.DatabaseBackup) {
|
||||
this._windowsUserAccountText.value = this.migrationStateModel.savedInfo.networkShare?.windowsUser;
|
||||
}
|
||||
this._disposables.push(this._windowsUserAccountText.onTextChanged((value) => {
|
||||
this.migrationStateModel._databaseBackup.networkShare.windowsUser = value;
|
||||
}));
|
||||
@@ -754,6 +761,9 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
|
||||
public async onPageEnter(pageChangeInfo: azdata.window.WizardPageChangeInfo): Promise<void> {
|
||||
if (this.migrationStateModel.refreshDatabaseBackupPage) {
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.DatabaseBackup) {
|
||||
this.migrationStateModel._migrationDbs = this.migrationStateModel.savedInfo.databaseList;
|
||||
}
|
||||
const isOfflineMigration = this.migrationStateModel._databaseBackup?.migrationMode === MigrationMode.OFFLINE;
|
||||
const lastBackupFileColumnIndex = this._blobContainerTargetDatabaseNamesTable.columns.length - 1;
|
||||
this._blobContainerTargetDatabaseNamesTable.columns[lastBackupFileColumnIndex].hidden = !isOfflineMigration;
|
||||
@@ -761,13 +771,33 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
column.width = isOfflineMigration ? WIZARD_TABLE_COLUMN_WIDTH_SMALL : WIZARD_TABLE_COLUMN_WIDTH;
|
||||
});
|
||||
|
||||
this._networkShareButton.checked = false;
|
||||
this._networkTableContainer.display = 'none';
|
||||
await this._networkShareContainer.updateCssStyles({ 'display': 'none' });
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.MigrationMode) {
|
||||
if (this.migrationStateModel.savedInfo.networkContainerType === NetworkContainerType.NETWORK_SHARE) {
|
||||
this._networkShareButton.checked = true;
|
||||
} else {
|
||||
this._networkShareButton.checked = false;
|
||||
this._networkTableContainer.display = 'none';
|
||||
await this._networkShareContainer.updateCssStyles({ 'display': 'none' });
|
||||
}
|
||||
} else {
|
||||
this._networkShareButton.checked = false;
|
||||
this._networkTableContainer.display = 'none';
|
||||
await this._networkShareContainer.updateCssStyles({ 'display': 'none' });
|
||||
}
|
||||
|
||||
this._blobContainerButton.checked = false;
|
||||
this._blobTableContainer.display = 'none';
|
||||
await this._blobContainer.updateCssStyles({ 'display': 'none' });
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.MigrationMode) {
|
||||
if (this.migrationStateModel.savedInfo.networkContainerType === NetworkContainerType.BLOB_CONTAINER) {
|
||||
this._blobContainerButton.checked = true;
|
||||
} else {
|
||||
this._blobContainerButton.checked = false;
|
||||
this._blobTableContainer.display = 'none';
|
||||
await this._blobContainer.updateCssStyles({ 'display': 'none' });
|
||||
}
|
||||
} else {
|
||||
this._blobContainerButton.checked = false;
|
||||
this._blobTableContainer.display = 'none';
|
||||
await this._blobContainer.updateCssStyles({ 'display': 'none' });
|
||||
}
|
||||
|
||||
await this._targetDatabaseContainer.updateCssStyles({ 'display': 'none' });
|
||||
await this._networkShareStorageAccountDetails.updateCssStyles({ 'display': 'none' });
|
||||
@@ -794,7 +824,6 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
this.migrationStateModel._targetDatabaseNames = [];
|
||||
this.migrationStateModel._databaseBackup.blobs = [];
|
||||
this.migrationStateModel._migrationDbs.forEach((db, index) => {
|
||||
|
||||
this.migrationStateModel._targetDatabaseNames.push('');
|
||||
this.migrationStateModel._databaseBackup.blobs.push(<Blob>{});
|
||||
const targetDatabaseInput = this._view.modelBuilder.inputBox().withProps({
|
||||
@@ -820,6 +849,9 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
this.migrationStateModel._targetDatabaseNames[index] = value.trim();
|
||||
await this.validateFields();
|
||||
}));
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.DatabaseBackup) {
|
||||
targetDatabaseInput.value = this.migrationStateModel.savedInfo.targetDatabaseNames[index];
|
||||
}
|
||||
this._networkShareTargetDatabaseNames.push(targetDatabaseInput);
|
||||
|
||||
const blobTargetDatabaseInput = this._view.modelBuilder.inputBox().withProps({
|
||||
@@ -843,6 +875,9 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
this._disposables.push(blobTargetDatabaseInput.onTextChanged((value) => {
|
||||
this.migrationStateModel._targetDatabaseNames[index] = value.trim();
|
||||
}));
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.DatabaseBackup) {
|
||||
blobTargetDatabaseInput.value = this.migrationStateModel.savedInfo.targetDatabaseNames[index];
|
||||
}
|
||||
this._blobContainerTargetDatabaseNames.push(blobTargetDatabaseInput);
|
||||
|
||||
const blobContainerResourceDropdown = this._view.modelBuilder.dropDown().withProps({
|
||||
@@ -940,7 +975,6 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
this._networkShareTargetDatabaseNamesTable.dataValues = data;
|
||||
|
||||
data = [];
|
||||
|
||||
this.migrationStateModel._migrationDbs.forEach((db, index) => {
|
||||
const targetRow: azdata.DeclarativeTableCellValue[] = [];
|
||||
targetRow.push({
|
||||
@@ -1096,6 +1130,9 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
this._blobTableContainer.display = (containerType === NetworkContainerType.BLOB_CONTAINER) ? 'inline' : 'none';
|
||||
|
||||
//Preserving the database Names between the 2 tables.
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.DatabaseBackup) {
|
||||
this.migrationStateModel._targetDatabaseNames = this.migrationStateModel.savedInfo.targetDatabaseNames;
|
||||
}
|
||||
this.migrationStateModel._targetDatabaseNames?.forEach((v, index) => {
|
||||
this._networkShareTargetDatabaseNames[index].value = v;
|
||||
this._blobContainerTargetDatabaseNames[index].value = v;
|
||||
@@ -1141,6 +1178,10 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
}
|
||||
|
||||
private async getSubscriptionValues(): Promise<void> {
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.DatabaseBackup) {
|
||||
this.migrationStateModel._targetSubscription = <azureResource.AzureResourceSubscription>this.migrationStateModel.savedInfo.targetSubscription;
|
||||
this.migrationStateModel._targetServerInstance = <SqlManagedInstance | SqlVMServer>this.migrationStateModel.savedInfo.targetServerInstance;
|
||||
}
|
||||
|
||||
this._networkShareContainerSubscription.value = this.migrationStateModel._targetSubscription.name;
|
||||
this._networkShareContainerLocation.value = await this.migrationStateModel.getLocationDisplayName(this.migrationStateModel._targetServerInstance.location);
|
||||
@@ -1158,7 +1199,15 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
this._networkShareStorageAccountResourceGroupDropdown.loading = true;
|
||||
try {
|
||||
this._networkShareStorageAccountResourceGroupDropdown.values = await this.migrationStateModel.getAzureResourceGroupDropdownValues(this.migrationStateModel._databaseBackup.subscription);
|
||||
selectDropDownIndex(this._networkShareStorageAccountResourceGroupDropdown, 0);
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.DatabaseBackup && this._networkShareStorageAccountResourceGroupDropdown.values) {
|
||||
this._networkShareStorageAccountResourceGroupDropdown.values.forEach((resource, index) => {
|
||||
if ((<azdata.CategoryValue>resource).name === this.migrationStateModel.savedInfo?.networkShare?.resourceGroup.id) {
|
||||
selectDropDownIndex(this._networkShareStorageAccountResourceGroupDropdown, index);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
selectDropDownIndex(this._networkShareStorageAccountResourceGroupDropdown, 0);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
} finally {
|
||||
@@ -1183,9 +1232,17 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
this._blobContainerResourceGroupDropdowns.forEach(v => v.loading = true);
|
||||
try {
|
||||
const resourceGroupValues = await this.migrationStateModel.getAzureResourceGroupDropdownValues(this.migrationStateModel._databaseBackup.subscription);
|
||||
this._blobContainerResourceGroupDropdowns.forEach(dropDown => {
|
||||
this._blobContainerResourceGroupDropdowns.forEach((dropDown, index) => {
|
||||
dropDown.values = resourceGroupValues;
|
||||
selectDropDownIndex(dropDown, 0);
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.DatabaseBackup && dropDown.values) {
|
||||
dropDown.values.forEach((resource, index) => {
|
||||
if ((<azdata.CategoryValue>resource).name === this.migrationStateModel.savedInfo?.blobs[index]?.resourceGroup.id) {
|
||||
selectDropDownIndex(dropDown, index);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
selectDropDownIndex(dropDown, 0);
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
@@ -1198,7 +1255,15 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
this._blobContainerStorageAccountDropdowns[index].loading = true;
|
||||
try {
|
||||
this._blobContainerStorageAccountDropdowns[index].values = await this.migrationStateModel.getStorageAccountValues(this.migrationStateModel._databaseBackup.subscription, this.migrationStateModel._databaseBackup.blobs[index].resourceGroup);
|
||||
selectDropDownIndex(this._blobContainerStorageAccountDropdowns[index], 0);
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.DatabaseBackup && this._blobContainerStorageAccountDropdowns[index].values && this.migrationStateModel.savedInfo.blobs[index].storageAccount) {
|
||||
this._blobContainerStorageAccountDropdowns[index].values!.forEach((resource, index) => {
|
||||
if ((<azdata.CategoryValue>resource).name === this.migrationStateModel.savedInfo?.blobs[index]?.storageAccount.id) {
|
||||
selectDropDownIndex(this._blobContainerStorageAccountDropdowns[index], index);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
selectDropDownIndex(this._blobContainerStorageAccountDropdowns[index], 0);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
} finally {
|
||||
@@ -1211,7 +1276,15 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
try {
|
||||
const blobContainerValues = await this.migrationStateModel.getBlobContainerValues(this.migrationStateModel._databaseBackup.subscription, this.migrationStateModel._databaseBackup.blobs[index].storageAccount);
|
||||
this._blobContainerDropdowns[index].values = blobContainerValues;
|
||||
selectDropDownIndex(this._blobContainerDropdowns[index], 0);
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.DatabaseBackup && this._blobContainerDropdowns[index].values && this.migrationStateModel.savedInfo.blobs[index].blobContainer) {
|
||||
this._blobContainerDropdowns[index].values!.forEach((resource, index) => {
|
||||
if ((<azdata.CategoryValue>resource).name === this.migrationStateModel.savedInfo?.blobs[index]?.blobContainer.id) {
|
||||
selectDropDownIndex(this._blobContainerDropdowns[index], index);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
selectDropDownIndex(this._blobContainerDropdowns[index], 0);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
} finally {
|
||||
@@ -1224,7 +1297,15 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
try {
|
||||
const blobLastBackupFileValues = await this.migrationStateModel.getBlobLastBackupFileNameValues(this.migrationStateModel._databaseBackup.subscription, this.migrationStateModel._databaseBackup.blobs[index].storageAccount, this.migrationStateModel._databaseBackup.blobs[index].blobContainer);
|
||||
this._blobContainerLastBackupFileDropdowns[index].values = blobLastBackupFileValues;
|
||||
selectDropDownIndex(this._blobContainerLastBackupFileDropdowns[index], 0);
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.DatabaseBackup && this._blobContainerLastBackupFileDropdowns[index].values && this.migrationStateModel.savedInfo.blobs[index].lastBackupFile) {
|
||||
this._blobContainerLastBackupFileDropdowns[index].values!.forEach((resource, index) => {
|
||||
if ((<azdata.CategoryValue>resource).name === this.migrationStateModel.savedInfo?.blobs[index]?.lastBackupFile) {
|
||||
selectDropDownIndex(this._blobContainerLastBackupFileDropdowns[index], index);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
selectDropDownIndex(this._blobContainerLastBackupFileDropdowns[index], 0);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
} finally {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { MigrationWizardPage } from '../models/migrationWizardPage';
|
||||
import { MigrationStateModel, MigrationTargetType, ServerAssessment, StateChangeEvent } from '../models/stateMachine';
|
||||
import { MigrationStateModel, MigrationTargetType, Page, ServerAssessment, StateChangeEvent } from '../models/stateMachine';
|
||||
import { AssessmentResultsDialog } from '../dialog/assessmentResults/assessmentResultsDialog';
|
||||
import * as constants from '../constants/strings';
|
||||
import { EOL } from 'os';
|
||||
@@ -454,6 +454,9 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
}
|
||||
|
||||
private async changeTargetType(newTargetType: string) {
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.SKURecommendation) {
|
||||
this.migrationStateModel._databaseAssessment = <string[]>this.migrationStateModel.savedInfo.databaseAssessment;
|
||||
}
|
||||
// remove assessed databases that have been removed from the source selection list
|
||||
const miDbs = this.migrationStateModel._miDbs.filter(
|
||||
db => this.migrationStateModel._databaseAssessment.findIndex(
|
||||
@@ -465,19 +468,31 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
|
||||
if (newTargetType === MigrationTargetType.SQLMI) {
|
||||
this._viewAssessmentsHelperText.value = constants.SKU_RECOMMENDATION_VIEW_ASSESSMENT_MI;
|
||||
this._databaseSelectedHelperText.value = constants.TOTAL_DATABASES_SELECTED(miDbs.length, this.migrationStateModel._databaseAssessment.length);
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.SKURecommendation) {
|
||||
this._databaseSelectedHelperText.value = constants.TOTAL_DATABASES_SELECTED(this.migrationStateModel.savedInfo.databaseList.length, this.migrationStateModel._databaseAssessment.length);
|
||||
} else {
|
||||
this._databaseSelectedHelperText.value = constants.TOTAL_DATABASES_SELECTED(miDbs.length, this.migrationStateModel._databaseAssessment.length);
|
||||
}
|
||||
this.migrationStateModel._targetType = MigrationTargetType.SQLMI;
|
||||
this._azureSubscriptionText.value = constants.SELECT_AZURE_MI;
|
||||
this.migrationStateModel._migrationDbs = miDbs;
|
||||
} else {
|
||||
this._viewAssessmentsHelperText.value = constants.SKU_RECOMMENDATION_VIEW_ASSESSMENT_VM;
|
||||
this._databaseSelectedHelperText.value = constants.TOTAL_DATABASES_SELECTED(vmDbs.length, this.migrationStateModel._databaseAssessment.length);
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.SKURecommendation) {
|
||||
this._databaseSelectedHelperText.value = constants.TOTAL_DATABASES_SELECTED(this.migrationStateModel.savedInfo.databaseList.length, this.migrationStateModel._databaseAssessment.length);
|
||||
} else {
|
||||
this._databaseSelectedHelperText.value = constants.TOTAL_DATABASES_SELECTED(vmDbs.length, this.migrationStateModel._databaseAssessment.length);
|
||||
}
|
||||
this.migrationStateModel._targetType = MigrationTargetType.SQLVM;
|
||||
this._azureSubscriptionText.value = constants.SELECT_AZURE_VM;
|
||||
this.migrationStateModel._migrationDbs = vmDbs;
|
||||
}
|
||||
this.migrationStateModel.refreshDatabaseBackupPage = true;
|
||||
this._targetContainer.display = (this.migrationStateModel._migrationDbs.length === 0) ? 'none' : 'inline';
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.SKURecommendation) {
|
||||
this._targetContainer.display = 'inline';
|
||||
} else {
|
||||
this._targetContainer.display = (this.migrationStateModel._migrationDbs.length === 0) ? 'none' : 'inline';
|
||||
}
|
||||
await this.populateResourceInstanceDropdown();
|
||||
}
|
||||
|
||||
@@ -529,6 +544,13 @@ errorId: ${e.errorId}
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.SKURecommendation) {
|
||||
if (this.migrationStateModel.savedInfo.migrationTargetType) {
|
||||
this._rbg.selectedCardId = this.migrationStateModel.savedInfo.migrationTargetType;
|
||||
await this.refreshCardText();
|
||||
}
|
||||
}
|
||||
|
||||
await this.refreshCardText();
|
||||
this._assessmentLoader.loading = false;
|
||||
await this._assessmentComponent.updateCssStyles({ display: 'none' });
|
||||
@@ -536,7 +558,7 @@ errorId: ${e.errorId}
|
||||
}
|
||||
|
||||
private async populateSubscriptionDropdown(): Promise<void> {
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= 0) {
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.SKURecommendation) {
|
||||
this.migrationStateModel._azureAccount = <azdata.Account>this.migrationStateModel.savedInfo.azureAccount;
|
||||
}
|
||||
if (!this.migrationStateModel._targetSubscription) {
|
||||
@@ -630,6 +652,9 @@ errorId: ${e.errorId}
|
||||
|
||||
public async onPageEnter(pageChangeInfo: azdata.window.WizardPageChangeInfo): Promise<void> {
|
||||
this.wizard.registerNavigationValidator((pageChangeInfo) => {
|
||||
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= Page.SKURecommendation) {
|
||||
this.migrationStateModel._migrationDbs = this.migrationStateModel.savedInfo.databaseList;
|
||||
}
|
||||
const errors: string[] = [];
|
||||
this.wizard.message = {
|
||||
text: '',
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as mssql from '../../../mssql';
|
||||
import { MigrationStateModel } from '../models/stateMachine';
|
||||
import { MigrationStateModel, Page } from '../models/stateMachine';
|
||||
import * as loc from '../constants/strings';
|
||||
import { MigrationWizardPage } from '../models/migrationWizardPage';
|
||||
import { SKURecommendationPage } from './skuRecommendationPage';
|
||||
@@ -65,7 +65,11 @@ export class WizardController {
|
||||
wizardSetupPromises.push(...pages.map(p => p.registerWizardContent()));
|
||||
wizardSetupPromises.push(this._wizardObject.open());
|
||||
if (this._model.resumeAssessment) {
|
||||
if (this._model.savedInfo.closedPage >= Page.MigrationMode) {
|
||||
this._model.refreshDatabaseBackupPage = true;
|
||||
}
|
||||
wizardSetupPromises.push(this._wizardObject.setCurrentPage(this._model.savedInfo.closedPage));
|
||||
//TODO: switch statement here initializing important values?
|
||||
}
|
||||
|
||||
this._model.extensionContext.subscriptions.push(this._wizardObject.onPageChanged(async (pageChangeInfo: azdata.window.WizardPageChangeInfo) => {
|
||||
|
||||
Reference in New Issue
Block a user