Migration extension UX update and bug fixes. (#15384)

* Adding a null check to prevent infinite next button loading on account selection page.

* Remove a useless validation in migration cutover page

* Fixed some component formatting in source selection page

* Completely updated target selection page UX according to latest figma mockup

* Adding confirmation for migration cutover and cancel

* migration vbump

* azdata vbump in migration extension

* letting users do a cutover with unrestored files

* Fixing some localized strings

* Adding readme file for migration extension.

* Adding a static link for readme gif

* added sql mi typing, localized strings, some null checks

* casting target instance as sql mi
This commit is contained in:
Aasim Khan
2021-05-11 16:27:16 +00:00
committed by GitHub
parent fff2bd5089
commit 0b41baaa0c
15 changed files with 495 additions and 242 deletions

View File

@@ -11,6 +11,7 @@ import * as loc from '../../constants/strings';
import { getSqlServerName } from '../../api/utils';
import { EOL } from 'os';
import * as vscode from 'vscode';
import { ConfirmCutoverDialog } from './confirmCutoverDialog';
export class MigrationCutoverDialog {
private _dialogObject!: azdata.window.Dialog;
@@ -41,8 +42,6 @@ export class MigrationCutoverDialog {
private fileTable!: azdata.TableComponent;
private _startCutover!: boolean;
constructor(migration: MigrationContext) {
this._model = new MigrationCutoverDialogModel(migration);
this._dialogObject = azdata.window.createModelViewDialog('', 'MigrationCutoverDialog', 1000);
@@ -333,22 +332,17 @@ export class MigrationCutoverDialog {
iconPath: IconPathHelper.cutover,
iconHeight: '14px',
iconWidth: '12px',
label: 'Start Cutover',
label: loc.COMPLETE_CUTOVER,
height: '20px',
width: '100px',
width: '130px',
enabled: false
}).component();
this._cutoverButton.onDidClick(async (e) => {
if (this._startCutover) {
await this._model.startCutover();
this.refreshStatus();
} else {
this._dialogObject.message = {
text: loc.CANNOT_START_CUTOVER_ERROR,
level: azdata.window.MessageLevel.Error
};
}
await this.refreshStatus();
const dialog = new ConfirmCutoverDialog(this._model);
await dialog.initialize();
await this.refreshStatus();
});
headerActions.addItem(this._cutoverButton, {
@@ -365,7 +359,12 @@ export class MigrationCutoverDialog {
}).component();
this._cancelButton.onDidClick((e) => {
this.cancelMigration();
vscode.window.showInformationMessage(loc.CANCEL_MIGRATION_CONFIRMATION, loc.YES, loc.NO).then(async (v) => {
if (v === loc.YES) {
await this.cancelMigration();
await this.refreshStatus();
}
});
});
headerActions.addItem(this._cancelButton, {
@@ -537,14 +536,9 @@ export class MigrationCutoverDialog {
row.lastLSN
];
});
if (this._model.migrationStatus.properties.migrationStatusDetails?.isFullBackupRestored) {
this._startCutover = true;
}
if (migrationStatusTextValue === MigrationStatus.InProgress) {
const fileNotRestored = await tableData.some(file => file.status !== 'Restored' && file.status !== 'Ignored');
this._cutoverButton.enabled = !fileNotRestored;
this._cancelButton.enabled = true;
this._cutoverButton.enabled = tableData.length > 0;
} else {
this._cutoverButton.enabled = false;
this._cancelButton.enabled = false;