mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-20 09:35:38 -05:00
add error banner for failed migration cutover and cancel migration (#17106)
This commit is contained in:
@@ -88,11 +88,11 @@ export class AccountsSelectionPage extends MigrationWizardPage {
|
||||
this.migrationStateModel._accountTenants = selectedAzureAccount.properties.tenants;
|
||||
this._accountTenantDropdown.values = await this.migrationStateModel.getTenantValues();
|
||||
selectDropDownIndex(this._accountTenantDropdown, 0);
|
||||
this._accountTenantFlexContainer.updateCssStyles({
|
||||
await this._accountTenantFlexContainer.updateCssStyles({
|
||||
'display': 'inline'
|
||||
});
|
||||
} else {
|
||||
this._accountTenantFlexContainer.updateCssStyles({
|
||||
await this._accountTenantFlexContainer.updateCssStyles({
|
||||
'display': 'none'
|
||||
});
|
||||
}
|
||||
@@ -119,7 +119,7 @@ export class AccountsSelectionPage extends MigrationWizardPage {
|
||||
this.wizard.message = {
|
||||
text: ''
|
||||
};
|
||||
this._azureAccountsDropdown.validate();
|
||||
await this._azureAccountsDropdown.validate();
|
||||
}));
|
||||
|
||||
const flexContainer = view.modelBuilder.flexContainer()
|
||||
|
||||
@@ -126,9 +126,9 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
}
|
||||
}).component();
|
||||
|
||||
this._disposables.push(this._networkShareButton.onDidChangeCheckedState((e) => {
|
||||
this._disposables.push(this._networkShareButton.onDidChangeCheckedState(async (e) => {
|
||||
if (e) {
|
||||
this.switchNetworkContainerFields(NetworkContainerType.NETWORK_SHARE);
|
||||
await this.switchNetworkContainerFields(NetworkContainerType.NETWORK_SHARE);
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -141,9 +141,9 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
}
|
||||
}).component();
|
||||
|
||||
this._disposables.push(this._blobContainerButton.onDidChangeCheckedState((e) => {
|
||||
this._disposables.push(this._blobContainerButton.onDidChangeCheckedState(async (e) => {
|
||||
if (e) {
|
||||
this.switchNetworkContainerFields(NetworkContainerType.BLOB_CONTAINER);
|
||||
await this.switchNetworkContainerFields(NetworkContainerType.BLOB_CONTAINER);
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -273,8 +273,8 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
}
|
||||
return true;
|
||||
}).component();
|
||||
this._disposables.push(this._networkSharePath.onTextChanged((value) => {
|
||||
this.validateFields();
|
||||
this._disposables.push(this._networkSharePath.onTextChanged(async (value) => {
|
||||
await this.validateFields();
|
||||
this.migrationStateModel._databaseBackup.networkShare.networkShareLocation = value;
|
||||
}));
|
||||
|
||||
@@ -745,14 +745,14 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
|
||||
this._networkShareButton.checked = false;
|
||||
this._networkTableContainer.display = 'none';
|
||||
this._networkShareContainer.updateCssStyles({ 'display': 'none' });
|
||||
await this._networkShareContainer.updateCssStyles({ 'display': 'none' });
|
||||
|
||||
this._blobContainerButton.checked = false;
|
||||
this._blobTableContainer.display = 'none';
|
||||
this._blobContainer.updateCssStyles({ 'display': 'none' });
|
||||
await this._blobContainer.updateCssStyles({ 'display': 'none' });
|
||||
|
||||
this._targetDatabaseContainer.updateCssStyles({ 'display': 'none' });
|
||||
this._networkShareStorageAccountDetails.updateCssStyles({ 'display': 'none' });
|
||||
await this._targetDatabaseContainer.updateCssStyles({ 'display': 'none' });
|
||||
await this._networkShareStorageAccountDetails.updateCssStyles({ 'display': 'none' });
|
||||
const connectionProfile = await this.migrationStateModel.getSourceConnectionProfile();
|
||||
const queryProvider = azdata.dataprotocol.getProvider<azdata.QueryProvider>((await this.migrationStateModel.getSourceConnectionProfile()).providerId, azdata.DataProviderType.QueryProvider);
|
||||
const query = 'select SUSER_NAME()';
|
||||
@@ -798,9 +798,9 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
}
|
||||
return true;
|
||||
}).component();
|
||||
this._disposables.push(targetDatabaseInput.onTextChanged((value) => {
|
||||
this._disposables.push(targetDatabaseInput.onTextChanged(async (value) => {
|
||||
this.migrationStateModel._targetDatabaseNames[index] = value.trim();
|
||||
this.validateFields();
|
||||
await this.validateFields();
|
||||
}));
|
||||
this._networkShareTargetDatabaseNames.push(targetDatabaseInput);
|
||||
|
||||
@@ -863,9 +863,9 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
if (selectedIndex > -1 && !blobResourceGroupErrorStrings.includes(value)) {
|
||||
this.migrationStateModel._databaseBackup.blobs[index].resourceGroup = this.migrationStateModel.getAzureResourceGroup(selectedIndex);
|
||||
await this.loadBlobStorageDropdown(index);
|
||||
blobContainerStorageAccountDropdown.updateProperties({ enabled: true });
|
||||
await blobContainerStorageAccountDropdown.updateProperties({ enabled: true });
|
||||
} else {
|
||||
this.disableBlobTableDropdowns(index, constants.RESOURCE_GROUP);
|
||||
await this.disableBlobTableDropdowns(index, constants.RESOURCE_GROUP);
|
||||
}
|
||||
}));
|
||||
this._blobContainerResourceGroupDropdowns.push(blobContainerResourceDropdown);
|
||||
@@ -875,9 +875,9 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
if (selectedIndex > -1 && !blobStorageAccountErrorStrings.includes(value)) {
|
||||
this.migrationStateModel._databaseBackup.blobs[index].storageAccount = this.migrationStateModel.getStorageAccount(selectedIndex);
|
||||
await this.loadBlobContainerDropdown(index);
|
||||
blobContainerDropdown.updateProperties({ enabled: true });
|
||||
await blobContainerDropdown.updateProperties({ enabled: true });
|
||||
} else {
|
||||
this.disableBlobTableDropdowns(index, constants.STORAGE_ACCOUNT);
|
||||
await this.disableBlobTableDropdowns(index, constants.STORAGE_ACCOUNT);
|
||||
}
|
||||
}));
|
||||
this._blobContainerStorageAccountDropdowns.push(blobContainerStorageAccountDropdown);
|
||||
@@ -888,10 +888,10 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
this.migrationStateModel._databaseBackup.blobs[index].blobContainer = this.migrationStateModel.getBlobContainer(selectedIndex);
|
||||
if (this.migrationStateModel._databaseBackup.migrationMode === MigrationMode.OFFLINE) {
|
||||
await this.loadBlobLastBackupFileDropdown(index);
|
||||
blobContainerLastBackupFileDropdown.updateProperties({ enabled: true });
|
||||
await blobContainerLastBackupFileDropdown.updateProperties({ enabled: true });
|
||||
}
|
||||
} else {
|
||||
this.disableBlobTableDropdowns(index, constants.BLOB_CONTAINER);
|
||||
await this.disableBlobTableDropdowns(index, constants.BLOB_CONTAINER);
|
||||
}
|
||||
}));
|
||||
this._blobContainerDropdowns.push(blobContainerDropdown);
|
||||
@@ -1062,7 +1062,7 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
protected async handleStateChange(e: StateChangeEvent): Promise<void> {
|
||||
}
|
||||
|
||||
private switchNetworkContainerFields(containerType: NetworkContainerType): void {
|
||||
private async switchNetworkContainerFields(containerType: NetworkContainerType): Promise<void> {
|
||||
this.wizard.message = {
|
||||
text: '',
|
||||
level: azdata.window.MessageLevel.Error
|
||||
@@ -1070,10 +1070,10 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
|
||||
this.wizard.nextButton.enabled = true;
|
||||
this.migrationStateModel._databaseBackup.networkContainerType = containerType;
|
||||
this._blobContainer.updateCssStyles({ 'display': (containerType === NetworkContainerType.BLOB_CONTAINER) ? 'inline' : 'none' });
|
||||
this._networkShareContainer.updateCssStyles({ 'display': (containerType === NetworkContainerType.NETWORK_SHARE) ? 'inline' : 'none' });
|
||||
this._networkShareStorageAccountDetails.updateCssStyles({ 'display': (containerType === NetworkContainerType.NETWORK_SHARE) ? 'inline' : 'none' });
|
||||
this._targetDatabaseContainer.updateCssStyles({ 'display': 'inline' });
|
||||
await this._blobContainer.updateCssStyles({ 'display': (containerType === NetworkContainerType.BLOB_CONTAINER) ? 'inline' : 'none' });
|
||||
await this._networkShareContainer.updateCssStyles({ 'display': (containerType === NetworkContainerType.NETWORK_SHARE) ? 'inline' : 'none' });
|
||||
await this._networkShareStorageAccountDetails.updateCssStyles({ 'display': (containerType === NetworkContainerType.NETWORK_SHARE) ? 'inline' : 'none' });
|
||||
await this._targetDatabaseContainer.updateCssStyles({ 'display': 'inline' });
|
||||
this._networkTableContainer.display = (containerType === NetworkContainerType.NETWORK_SHARE) ? 'inline' : 'none';
|
||||
this._blobTableContainer.display = (containerType === NetworkContainerType.BLOB_CONTAINER) ? 'inline' : 'none';
|
||||
|
||||
@@ -1083,19 +1083,19 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
this._blobContainerTargetDatabaseNames[index].value = v;
|
||||
});
|
||||
|
||||
this._windowsUserAccountText.updateProperties({
|
||||
await this._windowsUserAccountText.updateProperties({
|
||||
required: containerType === NetworkContainerType.NETWORK_SHARE
|
||||
});
|
||||
this._passwordText.updateProperties({
|
||||
await this._passwordText.updateProperties({
|
||||
required: containerType === NetworkContainerType.NETWORK_SHARE
|
||||
});
|
||||
this._sqlSourceUsernameInput.updateProperties({
|
||||
await this._sqlSourceUsernameInput.updateProperties({
|
||||
required: containerType === NetworkContainerType.NETWORK_SHARE
|
||||
});
|
||||
this._sqlSourcepassword.updateProperties({
|
||||
await this._sqlSourcepassword.updateProperties({
|
||||
required: containerType === NetworkContainerType.NETWORK_SHARE
|
||||
});
|
||||
this.validateFields();
|
||||
await this.validateFields();
|
||||
}
|
||||
|
||||
|
||||
@@ -1132,9 +1132,8 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
|
||||
this.migrationStateModel._databaseBackup.subscription = this.migrationStateModel._targetSubscription;
|
||||
|
||||
|
||||
this.loadNetworkStorageResourceGroup();
|
||||
this.loadBlobResourceGroup();
|
||||
await this.loadNetworkStorageResourceGroup();
|
||||
await this.loadBlobResourceGroup();
|
||||
}
|
||||
|
||||
private async loadNetworkStorageResourceGroup(): Promise<void> {
|
||||
@@ -1219,24 +1218,24 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
return v.value === undefined || errorStrings.includes((<azdata.CategoryValue>v.value)?.displayName);
|
||||
}
|
||||
|
||||
private disableBlobTableDropdowns(rowIndex: number, columnName: string): void {
|
||||
private async disableBlobTableDropdowns(rowIndex: number, columnName: string): Promise<void> {
|
||||
const dropdownProps = { enabled: false, loading: false };
|
||||
const createDropdownValuesWithPrereq = (displayName: string, name: string = '') => [{ displayName, name }];
|
||||
|
||||
if (this.migrationStateModel._databaseBackup?.migrationMode === MigrationMode.OFFLINE) {
|
||||
this._blobContainerLastBackupFileDropdowns[rowIndex].values = createDropdownValuesWithPrereq(constants.SELECT_BLOB_CONTAINER);
|
||||
selectDropDownIndex(this._blobContainerLastBackupFileDropdowns[rowIndex], 0);
|
||||
this._blobContainerLastBackupFileDropdowns[rowIndex]?.updateProperties(dropdownProps);
|
||||
await this._blobContainerLastBackupFileDropdowns[rowIndex]?.updateProperties(dropdownProps);
|
||||
}
|
||||
if (columnName === constants.BLOB_CONTAINER) { return; }
|
||||
|
||||
this._blobContainerDropdowns[rowIndex].values = createDropdownValuesWithPrereq(constants.SELECT_STORAGE_ACCOUNT);
|
||||
selectDropDownIndex(this._blobContainerDropdowns[rowIndex], 0);
|
||||
this._blobContainerDropdowns[rowIndex].updateProperties(dropdownProps);
|
||||
await this._blobContainerDropdowns[rowIndex].updateProperties(dropdownProps);
|
||||
if (columnName === constants.STORAGE_ACCOUNT) { return; }
|
||||
|
||||
this._blobContainerStorageAccountDropdowns[rowIndex].values = createDropdownValuesWithPrereq(constants.SELECT_RESOURCE_GROUP);
|
||||
selectDropDownIndex(this._blobContainerStorageAccountDropdowns[rowIndex], 0);
|
||||
this._blobContainerStorageAccountDropdowns[rowIndex].updateProperties(dropdownProps);
|
||||
await this._blobContainerStorageAccountDropdowns[rowIndex].updateProperties(dropdownProps);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,8 +288,8 @@ export class DatabaseSelectorPage extends MigrationWizardPage {
|
||||
).component();
|
||||
|
||||
await this._databaseSelectorTable.setDataValues(this._databaseTableValues);
|
||||
this._disposables.push(this._databaseSelectorTable.onDataChanged(() => {
|
||||
this._dbCount.updateProperties({
|
||||
this._disposables.push(this._databaseSelectorTable.onDataChanged(async () => {
|
||||
await this._dbCount.updateProperties({
|
||||
'value': constants.DATABASES_SELECTED(this.selectedDbs().length, this._databaseTableValues.length)
|
||||
});
|
||||
}));
|
||||
|
||||
@@ -106,7 +106,7 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
||||
this._subscription.value = this.migrationStateModel._targetSubscription.name;
|
||||
this._location.value = await getLocationDisplayName(this.migrationStateModel._targetServerInstance.location);
|
||||
this._dmsInfoContainer.display = (this.migrationStateModel._databaseBackup.networkContainerType === NetworkContainerType.NETWORK_SHARE && this.migrationStateModel._sqlMigrationService) ? 'inline' : 'none';
|
||||
this.loadResourceGroupDropdown();
|
||||
await this.loadResourceGroupDropdown();
|
||||
this.wizard.registerNavigationValidator((pageChangeInfo) => {
|
||||
if (pageChangeInfo.newPage < pageChangeInfo.lastPage) {
|
||||
this.wizard.message = {
|
||||
@@ -337,7 +337,7 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
||||
|
||||
this._disposables.push(this._copy1.onDidClick(async (e) => {
|
||||
await vscode.env.clipboard.writeText(<string>this._authKeyTable.dataValues![0][1].value);
|
||||
vscode.window.showInformationMessage(constants.SERVICE_KEY1_COPIED_HELP);
|
||||
void vscode.window.showInformationMessage(constants.SERVICE_KEY1_COPIED_HELP);
|
||||
}));
|
||||
|
||||
this._copy2 = this._view.modelBuilder.button().withProps({
|
||||
@@ -348,7 +348,7 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
||||
|
||||
this._disposables.push(this._copy2.onDidClick(async (e) => {
|
||||
await vscode.env.clipboard.writeText(<string>this._authKeyTable.dataValues![1][1].value);
|
||||
vscode.window.showInformationMessage(constants.SERVICE_KEY2_COPIED_HELP);
|
||||
void vscode.window.showInformationMessage(constants.SERVICE_KEY2_COPIED_HELP);
|
||||
}));
|
||||
|
||||
this._refresh1 = this._view.modelBuilder.button().withProps({
|
||||
@@ -500,12 +500,12 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
||||
|
||||
const state = migrationService.properties.integrationRuntimeState;
|
||||
if (state === 'Online') {
|
||||
this._dmsStatusInfoBox.updateProperties(<azdata.InfoBoxComponentProperties>{
|
||||
await this._dmsStatusInfoBox.updateProperties(<azdata.InfoBoxComponentProperties>{
|
||||
text: constants.SERVICE_READY(this.migrationStateModel._sqlMigrationService!.name, this.migrationStateModel._nodeNames.join(', ')),
|
||||
style: 'success'
|
||||
});
|
||||
} else {
|
||||
this._dmsStatusInfoBox.updateProperties(<azdata.InfoBoxComponentProperties>{
|
||||
await this._dmsStatusInfoBox.updateProperties(<azdata.InfoBoxComponentProperties>{
|
||||
text: constants.SERVICE_NOT_READY(this.migrationStateModel._sqlMigrationService!.name),
|
||||
style: 'error'
|
||||
});
|
||||
|
||||
@@ -92,8 +92,8 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
width: 130
|
||||
}).component();
|
||||
|
||||
this._disposables.push(refreshAssessmentButton.onDidClick(() => {
|
||||
this.constructDetails();
|
||||
this._disposables.push(refreshAssessmentButton.onDidClick(async () => {
|
||||
await this.constructDetails();
|
||||
}));
|
||||
|
||||
const chooseYourTargetText = this._view.modelBuilder.text().withProps({
|
||||
@@ -225,10 +225,10 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
});
|
||||
});
|
||||
|
||||
this._disposables.push(this._rbg.onSelectionChanged((value) => {
|
||||
this._disposables.push(this._rbg.onSelectionChanged(async (value) => {
|
||||
if (value) {
|
||||
this.assessmentGroupContainer.display = 'inline';
|
||||
this.changeTargetType(value.cardId);
|
||||
await this.changeTargetType(value.cardId);
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -427,7 +427,7 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
|
||||
}
|
||||
|
||||
private changeTargetType(newTargetType: string) {
|
||||
private async changeTargetType(newTargetType: string) {
|
||||
// remove assessed databases that have been removed from the source selection list
|
||||
const miDbs = this.migrationStateModel._miDbs.filter(
|
||||
db => this.migrationStateModel._databaseAssessment.findIndex(
|
||||
@@ -452,7 +452,7 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
}
|
||||
this.migrationStateModel.refreshDatabaseBackupPage = true;
|
||||
this._targetContainer.display = (this.migrationStateModel._migrationDbs.length === 0) ? 'none' : 'inline';
|
||||
this.populateResourceInstanceDropdown();
|
||||
await this.populateResourceInstanceDropdown();
|
||||
}
|
||||
|
||||
private async constructDetails(): Promise<void> {
|
||||
@@ -460,8 +460,8 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
text: '',
|
||||
level: azdata.window.MessageLevel.Error
|
||||
};
|
||||
this._assessmentComponent.updateCssStyles({ display: 'block' });
|
||||
this._formContainer.component().updateCssStyles({ display: 'none' });
|
||||
await this._assessmentComponent.updateCssStyles({ display: 'block' });
|
||||
await this._formContainer.component().updateCssStyles({ display: 'none' });
|
||||
|
||||
this._assessmentLoader.loading = true;
|
||||
const serverName = (await this.migrationStateModel.getSourceConnectionProfile()).serverName;
|
||||
@@ -499,10 +499,10 @@ errorId: ${e.errorId}
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
this.refreshCardText();
|
||||
await this.refreshCardText();
|
||||
this._assessmentLoader.loading = false;
|
||||
this._assessmentComponent.updateCssStyles({ display: 'none' });
|
||||
this._formContainer.component().updateCssStyles({ display: 'block' });
|
||||
await this._assessmentComponent.updateCssStyles({ display: 'none' });
|
||||
await this._formContainer.component().updateCssStyles({ display: 'block' });
|
||||
}
|
||||
|
||||
private async populateSubscriptionDropdown(): Promise<void> {
|
||||
@@ -612,14 +612,14 @@ errorId: ${e.errorId}
|
||||
if (this.migrationStateModel._runAssessments) {
|
||||
await this.constructDetails();
|
||||
}
|
||||
this._assessmentComponent.updateCssStyles({
|
||||
await this._assessmentComponent.updateCssStyles({
|
||||
display: 'none'
|
||||
});
|
||||
this._formContainer.component().updateCssStyles({
|
||||
await this._formContainer.component().updateCssStyles({
|
||||
display: 'block'
|
||||
});
|
||||
|
||||
this.populateSubscriptionDropdown();
|
||||
await this.populateSubscriptionDropdown();
|
||||
this.wizard.nextButton.enabled = true;
|
||||
}
|
||||
|
||||
@@ -637,16 +637,16 @@ errorId: ${e.errorId}
|
||||
protected async handleStateChange(e: StateChangeEvent): Promise<void> {
|
||||
}
|
||||
|
||||
public refreshDatabaseCount(selectedDbs: string[]): void {
|
||||
public async refreshDatabaseCount(selectedDbs: string[]): Promise<void> {
|
||||
this.wizard.message = {
|
||||
text: '',
|
||||
level: azdata.window.MessageLevel.Error
|
||||
};
|
||||
this.migrationStateModel._migrationDbs = selectedDbs;
|
||||
this.refreshCardText();
|
||||
await this.refreshCardText();
|
||||
}
|
||||
|
||||
public refreshCardText(): void {
|
||||
public async refreshCardText(): Promise<void> {
|
||||
this._rbgLoader.loading = true;
|
||||
if (this._rbg.selectedCardId === MigrationTargetType.SQLMI) {
|
||||
this.migrationStateModel._migrationDbs = this.migrationStateModel._miDbs;
|
||||
@@ -667,20 +667,20 @@ errorId: ${e.errorId}
|
||||
const vmCardText = constants.CAN_BE_MIGRATED(dbCount, dbCount);
|
||||
this._rbg.cards[1].descriptions[1].textValue = vmCardText;
|
||||
|
||||
this._rbg.updateProperties({
|
||||
await this._rbg.updateProperties({
|
||||
cards: this._rbg.cards
|
||||
});
|
||||
} else {
|
||||
this._rbg.cards[0].descriptions[1].textValue = '';
|
||||
this._rbg.cards[1].descriptions[1].textValue = '';
|
||||
|
||||
this._rbg.updateProperties({
|
||||
await this._rbg.updateProperties({
|
||||
cards: this._rbg.cards
|
||||
});
|
||||
}
|
||||
|
||||
if (this._rbg.selectedCardId) {
|
||||
this.changeTargetType(this._rbg.selectedCardId);
|
||||
await this.changeTargetType(this._rbg.selectedCardId);
|
||||
}
|
||||
|
||||
this._rbgLoader.loading = false;
|
||||
|
||||
@@ -60,7 +60,7 @@ export class SqlSourceConfigurationPage extends MigrationWizardPage {
|
||||
const username = results.rows[0][0].displayValue;
|
||||
this.migrationStateModel._authenticationType = connectionProfile.authenticationType === 'SqlLogin' ? MigrationSourceAuthenticationType.Sql : connectionProfile.authenticationType === 'Integrated' ? MigrationSourceAuthenticationType.Integrated : undefined!;
|
||||
|
||||
const sourceCredText = createHeadingTextComponent(this._view, constants.SOURCE_CREDENTIALS);
|
||||
const sourceCredText = await createHeadingTextComponent(this._view, constants.SOURCE_CREDENTIALS);
|
||||
|
||||
const enterYourCredText = createLabelTextComponent(
|
||||
this._view,
|
||||
|
||||
@@ -56,8 +56,8 @@ export class SummaryPage extends MigrationWizardPage {
|
||||
}
|
||||
}).component();
|
||||
|
||||
this._disposables.push(targetDatabaseHyperlink.onDidClick(e => {
|
||||
targetDatabaseSummary.initialize();
|
||||
this._disposables.push(targetDatabaseHyperlink.onDidClick(async e => {
|
||||
await targetDatabaseSummary.initialize();
|
||||
}));
|
||||
|
||||
const targetDatabaseRow = this._view.modelBuilder.flexContainer()
|
||||
@@ -87,26 +87,26 @@ export class SummaryPage extends MigrationWizardPage {
|
||||
|
||||
this._flexContainer.addItems(
|
||||
[
|
||||
createHeadingTextComponent(this._view, constants.ACCOUNTS_SELECTION_PAGE_TITLE),
|
||||
await createHeadingTextComponent(this._view, constants.ACCOUNTS_SELECTION_PAGE_TITLE),
|
||||
createInformationRow(this._view, constants.ACCOUNTS_SELECTION_PAGE_TITLE, this.migrationStateModel._azureAccount.displayInfo.displayName),
|
||||
|
||||
createHeadingTextComponent(this._view, constants.SOURCE_DATABASES),
|
||||
await createHeadingTextComponent(this._view, constants.SOURCE_DATABASES),
|
||||
targetDatabaseRow,
|
||||
|
||||
createHeadingTextComponent(this._view, constants.SKU_RECOMMENDATION_PAGE_TITLE),
|
||||
await createHeadingTextComponent(this._view, constants.SKU_RECOMMENDATION_PAGE_TITLE),
|
||||
createInformationRow(this._view, constants.SKU_RECOMMENDATION_PAGE_TITLE, (this.migrationStateModel._targetType === MigrationTargetType.SQLVM) ? constants.SUMMARY_VM_TYPE : constants.SUMMARY_MI_TYPE),
|
||||
createInformationRow(this._view, constants.SUBSCRIPTION, this.migrationStateModel._targetSubscription.name),
|
||||
createInformationRow(this._view, constants.LOCATION, await this.migrationStateModel.getLocationDisplayName(this.migrationStateModel._targetServerInstance.location)),
|
||||
createInformationRow(this._view, constants.RESOURCE_GROUP, getResourceGroupFromId(this.migrationStateModel._targetServerInstance.id)),
|
||||
createInformationRow(this._view, (this.migrationStateModel._targetType === MigrationTargetType.SQLVM) ? constants.SUMMARY_VM_TYPE : constants.SUMMARY_MI_TYPE, await this.migrationStateModel.getLocationDisplayName(this.migrationStateModel._targetServerInstance.name!)),
|
||||
|
||||
createHeadingTextComponent(this._view, constants.DATABASE_BACKUP_MIGRATION_MODE_LABEL),
|
||||
await createHeadingTextComponent(this._view, constants.DATABASE_BACKUP_MIGRATION_MODE_LABEL),
|
||||
createInformationRow(this._view, constants.MODE, this.migrationStateModel._databaseBackup.migrationMode === MigrationMode.ONLINE ? constants.DATABASE_BACKUP_MIGRATION_MODE_ONLINE_LABEL : constants.DATABASE_BACKUP_MIGRATION_MODE_OFFLINE_LABEL),
|
||||
|
||||
createHeadingTextComponent(this._view, constants.DATABASE_BACKUP_PAGE_TITLE),
|
||||
await createHeadingTextComponent(this._view, constants.DATABASE_BACKUP_PAGE_TITLE),
|
||||
await this.createNetworkContainerRows(),
|
||||
|
||||
createHeadingTextComponent(this._view, constants.IR_PAGE_TITLE),
|
||||
await createHeadingTextComponent(this._view, constants.IR_PAGE_TITLE),
|
||||
createInformationRow(this._view, constants.SUBSCRIPTION, this.migrationStateModel._targetSubscription.name),
|
||||
createInformationRow(this._view, constants.LOCATION, this.migrationStateModel._sqlMigrationService?.location!),
|
||||
createInformationRow(this._view, constants.RESOURCE_GROUP, this.migrationStateModel._sqlMigrationService?.properties?.resourceGroup!),
|
||||
@@ -140,7 +140,7 @@ export class SummaryPage extends MigrationWizardPage {
|
||||
createInformationRow(this._view, constants.BACKUP_LOCATION, constants.NETWORK_SHARE),
|
||||
createInformationRow(this._view, constants.NETWORK_SHARE, this.migrationStateModel._databaseBackup.networkShare.networkShareLocation),
|
||||
createInformationRow(this._view, constants.USER_ACCOUNT, this.migrationStateModel._databaseBackup.networkShare.windowsUser),
|
||||
createHeadingTextComponent(this._view, constants.AZURE_STORAGE_ACCOUNT_TO_UPLOAD_BACKUPS),
|
||||
await createHeadingTextComponent(this._view, constants.AZURE_STORAGE_ACCOUNT_TO_UPLOAD_BACKUPS),
|
||||
createInformationRow(this._view, constants.SUBSCRIPTION, this.migrationStateModel._databaseBackup.subscription.name),
|
||||
createInformationRow(this._view, constants.LOCATION, this.migrationStateModel._databaseBackup.networkShare.storageAccount.location),
|
||||
createInformationRow(this._view, constants.RESOURCE_GROUP, this.migrationStateModel._databaseBackup.networkShare.storageAccount.resourceGroup!),
|
||||
|
||||
@@ -30,7 +30,7 @@ export class WizardController {
|
||||
if (api) {
|
||||
this._model = new MigrationStateModel(this.extensionContext, connectionId, api.sqlMigration);
|
||||
this.extensionContext.subscriptions.push(this._model);
|
||||
this.createWizard(this._model);
|
||||
await this.createWizard(this._model);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,16 +170,15 @@ export function createInformationRow(view: azdata.ModelView, label: string, valu
|
||||
.component();
|
||||
}
|
||||
|
||||
export function createHeadingTextComponent(view: azdata.ModelView, value: string): azdata.TextComponent {
|
||||
export async function createHeadingTextComponent(view: azdata.ModelView, value: string): Promise<azdata.TextComponent> {
|
||||
const component = createTextCompononent(view, value);
|
||||
component.updateCssStyles({
|
||||
await component.updateCssStyles({
|
||||
'font-size': '13px',
|
||||
'font-weight': 'bold',
|
||||
});
|
||||
return component;
|
||||
}
|
||||
|
||||
|
||||
export function createLabelTextComponent(view: azdata.ModelView, value: string, styles: { [key: string]: string; } = { 'width': '300px' }): azdata.TextComponent {
|
||||
const component = createTextCompononent(view, value, styles);
|
||||
return component;
|
||||
|
||||
Reference in New Issue
Block a user