mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Add error details to error banner in migration cutover dialog (#16494)
* Add error details to error banner in migration cutover dialog * Adding method functionality to copy migration details
This commit is contained in:
@@ -111,7 +111,7 @@ export class IconPathHelper {
|
|||||||
};
|
};
|
||||||
IconPathHelper.info = {
|
IconPathHelper.info = {
|
||||||
light: context.asAbsolutePath('images/info.svg'),
|
light: context.asAbsolutePath('images/info.svg'),
|
||||||
dark: context.asAbsolutePath('images/infoBox.svg')
|
dark: context.asAbsolutePath('images/info.svg')
|
||||||
};
|
};
|
||||||
IconPathHelper.error = {
|
IconPathHelper.error = {
|
||||||
light: context.asAbsolutePath('images/error.svg'),
|
light: context.asAbsolutePath('images/error.svg'),
|
||||||
|
|||||||
@@ -307,14 +307,7 @@ export class MigrationCutoverDialog {
|
|||||||
|
|
||||||
this._disposables.push(this._copyDatabaseMigrationDetails.onDidClick(async (e) => {
|
this._disposables.push(this._copyDatabaseMigrationDetails.onDidClick(async (e) => {
|
||||||
await this.refreshStatus();
|
await this.refreshStatus();
|
||||||
if (this._model.migrationOpStatus) {
|
vscode.env.clipboard.writeText(this.getMigrationDetails());
|
||||||
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);
|
vscode.window.showInformationMessage(loc.DETAILS_COPIED);
|
||||||
}));
|
}));
|
||||||
@@ -459,6 +452,19 @@ export class MigrationCutoverDialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getMigrationDetails(): string {
|
||||||
|
if (this._model.migrationOpStatus) {
|
||||||
|
return (JSON.stringify(
|
||||||
|
{
|
||||||
|
'async-operation-details': this._model.migrationOpStatus,
|
||||||
|
'details': this._model.migrationStatus
|
||||||
|
}
|
||||||
|
, undefined, 2));
|
||||||
|
} else {
|
||||||
|
return (JSON.stringify(this._model.migrationStatus, undefined, 2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async refreshStatus(): Promise<void> {
|
private async refreshStatus(): Promise<void> {
|
||||||
if (this.isRefreshing) {
|
if (this.isRefreshing) {
|
||||||
return;
|
return;
|
||||||
@@ -481,7 +487,8 @@ export class MigrationCutoverDialog {
|
|||||||
errors.push(this._model.migrationStatus.properties.migrationStatusDetails?.restoreBlockingReason);
|
errors.push(this._model.migrationStatus.properties.migrationStatusDetails?.restoreBlockingReason);
|
||||||
this._dialogObject.message = {
|
this._dialogObject.message = {
|
||||||
text: errors.filter(e => e !== undefined).join(EOL),
|
text: errors.filter(e => e !== undefined).join(EOL),
|
||||||
level: (this._model.migrationStatus.properties.migrationStatus === MigrationStatus.InProgress || this._model.migrationStatus.properties.migrationStatus === 'Completing') ? azdata.window.MessageLevel.Warning : azdata.window.MessageLevel.Error
|
level: (this._model.migrationStatus.properties.migrationStatus === MigrationStatus.InProgress || this._model.migrationStatus.properties.migrationStatus === 'Completing') ? azdata.window.MessageLevel.Warning : azdata.window.MessageLevel.Error,
|
||||||
|
description: this.getMigrationDetails()
|
||||||
};
|
};
|
||||||
const sqlServerInfo = await azdata.connection.getServerInfo((await azdata.connection.getCurrentConnection()).connectionId);
|
const sqlServerInfo = await azdata.connection.getServerInfo((await azdata.connection.getCurrentConnection()).connectionId);
|
||||||
const sqlServerName = this._model._migration.sourceConnectionProfile.serverName;
|
const sqlServerName = this._model._migration.sourceConnectionProfile.serverName;
|
||||||
|
|||||||
Reference in New Issue
Block a user