mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-08 17:24:01 -05:00
Fixing migration private preview bugs WIP 3 (#14928)
* Adding server name to wizard and dialog title Surfacing async errors Fixing a bunch of strings to match the mockup * Adding auto refresh for migration status * Removing errors for sql vm migration * using new logic to get sql server username * Fixing help links * Removing unncessary await
This commit is contained in:
@@ -216,10 +216,21 @@ export class SqlDatabaseTree {
|
||||
}).component();
|
||||
|
||||
this._instanceTable.onRowSelected((e) => {
|
||||
|
||||
this._instanceTable.focus();
|
||||
this._activeIssues = this._model._assessmentResults?.issues;
|
||||
this._selectedIssue = this._model._assessmentResults?.issues[0];
|
||||
this._dbName.value = this._serverName;
|
||||
this.refreshResults();
|
||||
this._resultComponent.updateCssStyles({
|
||||
'display': 'block'
|
||||
});
|
||||
this._dbMessageContainer.updateCssStyles({
|
||||
'display': 'none'
|
||||
});
|
||||
|
||||
if (this._model._targetType === MigrationTargetType.SQLMI) {
|
||||
this.refreshResults();
|
||||
}
|
||||
});
|
||||
|
||||
return instanceContainer;
|
||||
@@ -247,7 +258,6 @@ export class SqlDatabaseTree {
|
||||
return container;
|
||||
}
|
||||
|
||||
|
||||
private createTopContainer(): azdata.FlexContainer {
|
||||
const title = this.createTitleComponent();
|
||||
const impact = this.createPlatformComponent();
|
||||
|
||||
@@ -147,10 +147,6 @@ export class CreateSqlMigrationServiceDialog {
|
||||
value: constants.MIGRATION_SERVICE_DIALOG_DESCRIPTION
|
||||
}).component();
|
||||
|
||||
const formHeading = this._view.modelBuilder.text().withProps({
|
||||
value: constants.CREATE_SERVICE_FORM_HEADING
|
||||
}).component();
|
||||
|
||||
const subscriptionDropdownLabel = this._view.modelBuilder.text().withProps({
|
||||
value: constants.SUBSCRIPTION
|
||||
}).component();
|
||||
@@ -184,9 +180,17 @@ export class CreateSqlMigrationServiceDialog {
|
||||
value: await this.migrationStateModel.getLocationDisplayName(this.migrationStateModel._targetServerInstance.location)
|
||||
}).component();
|
||||
|
||||
const targetlabel = this._view.modelBuilder.text().withProps({
|
||||
value: constants.TARGET
|
||||
}).component();
|
||||
|
||||
const targetText = this._view.modelBuilder.inputBox().withProps({
|
||||
enabled: false,
|
||||
value: constants.AZURE_SQL
|
||||
}).component();
|
||||
|
||||
const flexContainer = this._view.modelBuilder.flexContainer().withItems([
|
||||
dialogDescription,
|
||||
formHeading,
|
||||
subscriptionDropdownLabel,
|
||||
this.migrationServiceSubscription,
|
||||
locationDropdownLabel,
|
||||
@@ -194,7 +198,9 @@ export class CreateSqlMigrationServiceDialog {
|
||||
resourceGroupDropdownLabel,
|
||||
this.migrationServiceResourceGroupDropdown,
|
||||
migrationServiceNameLabel,
|
||||
this.migrationServiceNameText
|
||||
this.migrationServiceNameText,
|
||||
targetlabel,
|
||||
targetText
|
||||
]).withLayout({
|
||||
flexFlow: 'column'
|
||||
}).component();
|
||||
@@ -257,8 +263,12 @@ export class CreateSqlMigrationServiceDialog {
|
||||
}
|
||||
}).component();
|
||||
|
||||
const setupIRdescription = this._view.modelBuilder.text().withProps({
|
||||
value: constants.SERVICE_CONTAINER_DESCRIPTION,
|
||||
const setupIRdescription1 = this._view.modelBuilder.text().withProps({
|
||||
value: constants.SERVICE_CONTAINER_DESCRIPTION1,
|
||||
}).component();
|
||||
|
||||
const setupIRdescription2 = this._view.modelBuilder.text().withProps({
|
||||
value: constants.SERVICE_CONTAINER_DESCRIPTION2,
|
||||
}).component();
|
||||
|
||||
const irSetupStep1Text = this._view.modelBuilder.text().withProps({
|
||||
@@ -353,7 +363,8 @@ export class CreateSqlMigrationServiceDialog {
|
||||
this._setupContainer = this._view.modelBuilder.flexContainer().withItems(
|
||||
[
|
||||
setupIRHeadingText,
|
||||
setupIRdescription,
|
||||
setupIRdescription1,
|
||||
setupIRdescription2,
|
||||
irSetupStep1Text,
|
||||
irSetupStep2Text,
|
||||
this.migrationServiceAuthKeyTable,
|
||||
|
||||
@@ -358,7 +358,15 @@ export class MigrationCutoverDialog {
|
||||
|
||||
this._copyDatabaseMigrationDetails.onDidClick(async (e) => {
|
||||
await this.refreshStatus();
|
||||
vscode.env.clipboard.writeText(JSON.stringify(this._model.migrationStatus, undefined, 2));
|
||||
if (this._model.migrationOpStatus) {
|
||||
vscode.env.clipboard.writeText(JSON.stringify({
|
||||
'async-operation-details': this._model.migrationOpStatus,
|
||||
'details': this._model.migrationStatus
|
||||
}, undefined, 2));
|
||||
} else {
|
||||
vscode.env.clipboard.writeText(JSON.stringify(this._model.migrationStatus, undefined, 2));
|
||||
}
|
||||
|
||||
vscode.window.showInformationMessage(loc.DETAILS_COPIED);
|
||||
});
|
||||
|
||||
@@ -389,6 +397,7 @@ export class MigrationCutoverDialog {
|
||||
this._cancelButton.enabled = false;
|
||||
await this._model.fetchStatus();
|
||||
const errors = [];
|
||||
errors.push(this._model.migrationOpStatus.error.message);
|
||||
errors.push(this._model.migrationStatus.properties.migrationFailureError?.message);
|
||||
errors.push(this._model.migrationStatus.properties.migrationStatusDetails?.fileUploadBlockingErrors ?? []);
|
||||
errors.push(this._model.migrationStatus.properties.migrationStatusDetails?.restoreBlockingReason);
|
||||
@@ -409,7 +418,7 @@ export class MigrationCutoverDialog {
|
||||
targetServerVersion = loc.AZURE_SQL_DATABASE_VIRTUAL_MACHINE;
|
||||
}
|
||||
|
||||
const migrationStatusTextValue = this._model.migrationStatus.properties.migrationStatus;
|
||||
const migrationStatusTextValue = this._model.migrationStatus.properties.migrationStatus ? this._model.migrationStatus.properties.migrationStatus : this._model.migrationStatus.properties.provisioningState;
|
||||
|
||||
let fullBackupFileName: string;
|
||||
let lastAppliedSSN: string;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { getMigrationStatus, DatabaseMigration, startMigrationCutover, stopMigration } from '../../api/azure';
|
||||
import { getMigrationStatus, DatabaseMigration, startMigrationCutover, stopMigration, getMigrationAsyncOperationDetails, AzureAsyncOperationResource } from '../../api/azure';
|
||||
import { MigrationContext } from '../../models/migrationLocalStorage';
|
||||
|
||||
export enum MigrationStatus {
|
||||
@@ -16,11 +16,19 @@ export enum MigrationStatus {
|
||||
export class MigrationCutoverDialogModel {
|
||||
|
||||
public migrationStatus!: DatabaseMigration;
|
||||
public migrationOpStatus!: AzureAsyncOperationResource;
|
||||
|
||||
constructor(public _migration: MigrationContext) {
|
||||
}
|
||||
|
||||
public async fetchStatus(): Promise<void> {
|
||||
if (this._migration.asyncUrl) {
|
||||
this.migrationOpStatus = (await getMigrationAsyncOperationDetails(
|
||||
this._migration.azureAccount,
|
||||
this._migration.subscription,
|
||||
this._migration.asyncUrl
|
||||
));
|
||||
}
|
||||
this.migrationStatus = (await getMigrationStatus(
|
||||
this._migration.azureAccount,
|
||||
this._migration.subscription,
|
||||
|
||||
@@ -143,7 +143,7 @@ export class MigrationStatusDialog {
|
||||
});
|
||||
|
||||
migrationRow.push({
|
||||
value: migration.migrationContext.properties.migrationStatus
|
||||
value: migration.migrationContext.properties.migrationStatus ? migration.migrationContext.properties.migrationStatus : migration.migrationContext.properties.provisioningState
|
||||
});
|
||||
|
||||
const targetMigrationIcon = this._view.modelBuilder.image().withProps({
|
||||
@@ -247,7 +247,7 @@ export class MigrationStatusDialog {
|
||||
}
|
||||
},
|
||||
{
|
||||
displayName: loc.CUTOVER_TYPE,
|
||||
displayName: loc.MIGRATION_MODE,
|
||||
valueType: azdata.DeclarativeDataType.string,
|
||||
width: '100px',
|
||||
isReadOnly: true,
|
||||
|
||||
@@ -31,7 +31,8 @@ export class MigrationStatusDialogModel {
|
||||
} else if (category === 'Ongoing') {
|
||||
filteredMigration = this._migrations.filter((value) => {
|
||||
const status = value.migrationContext.properties.migrationStatus;
|
||||
return status === 'InProgress' || status === 'Creating' || status === 'Completing';
|
||||
const provisioning = value.migrationContext.properties.provisioningState;
|
||||
return status === 'InProgress' || status === 'Creating' || status === 'Completing' || provisioning === 'Creating';
|
||||
});
|
||||
} else if (category === 'Succeeded') {
|
||||
filteredMigration = this._migrations.filter((value) => {
|
||||
|
||||
Reference in New Issue
Block a user