Database Migration Details: Empty table should have a status saying 'no backup files' (#16618)

* empty table shows no backup file image

* string displayed modified and empty table text will only be displayed after checking function _shouldDisplayBackupFileTable

* format fix

* format changes

* format fix
This commit is contained in:
stuti149
2021-08-10 12:31:16 +05:30
committed by GitHub
parent a5a9250ae1
commit a032426ac0
4 changed files with 78 additions and 1 deletions

View File

@@ -37,6 +37,7 @@ export class IconPathHelper {
public static expandButtonClosed: IconPath;
public static expandButtonOpen: IconPath;
public static newSupportRequest: IconPath;
public static emptyTable: IconPath;
public static setExtensionContext(context: vscode.ExtensionContext) {
IconPathHelper.copy = {
@@ -143,5 +144,9 @@ export class IconPathHelper {
light: context.asAbsolutePath('images/newSupportRequest.svg'),
dark: context.asAbsolutePath('images/newSupportRequest.svg')
};
IconPathHelper.emptyTable = {
light: context.asAbsolutePath('images/emptyTable.svg'),
dark: context.asAbsolutePath('images/emptyTable.svg')
};
}
}

View File

@@ -313,6 +313,8 @@ export const DETAILS_COPIED = localize('sql.migration.details.copied', "Details
export const CANCEL_MIGRATION_CONFIRMATION = localize('sql.cancel.migration.confirmation', "Are you sure you want to cancel this migration?");
export const YES = localize('sql.migration.yes', "Yes");
export const NO = localize('sql.migration.no', "No");
export const EMPTY_TABLE_TEXT = localize('sql.migration.empty.table.text', "No backup files to show");
export const EMPTY_TABLE_SUBTEXT = localize('sql.migration.empty.table.subtext', "If results were expected, reconfirm the connection to the SQL Server Instance.");
//Migration confirm cutover dialog
export const COMPLETING_CUTOVER_WARNING = localize('sql.migration.completing.cutover.warning', "Completing cutover without restoring all the backup(s) may result in a data loss.");

View File

@@ -47,6 +47,7 @@ export class MigrationCutoverDialog {
private _fileTable!: azdata.TableComponent;
private _autoRefreshHandle!: any;
private _disposables: vscode.Disposable[] = [];
private _emptyTableFill!: azdata.FlexContainer;
private isRefreshing = false;
@@ -124,13 +125,58 @@ export class MigrationCutoverDialog {
}
}).component();
const _emptyTableImage = view.modelBuilder.image().withProps({
iconPath: IconPathHelper.emptyTable,
iconHeight: '100px',
iconWidth: '100px',
height: '100px',
width: '100px',
CSSStyles: {
'text-align': 'center'
}
}).component();
const _emptyTableText = view.modelBuilder.text().withProps({
value: loc.EMPTY_TABLE_TEXT,
CSSStyles: {
'text-align': 'center',
'font-size': 'large',
'font-weight': 'bold',
'width': '300px'
}
}).component();
const _emptyTableSubText = view.modelBuilder.text().withProps({
value: loc.EMPTY_TABLE_SUBTEXT,
CSSStyles: {
'text-align': 'center',
'margin-top': '0px',
'font-size': '15px',
'width': '300px'
}
}).component();
this._emptyTableFill = view.modelBuilder.flexContainer()
.withLayout({
flexFlow: 'column',
alignItems: 'center'
}).withItems([
_emptyTableImage,
_emptyTableText,
_emptyTableSubText
]).withProps({
width: 1000,
display: 'none'
}).component();
let formItems = [
{ component: this.migrationContainerHeader() },
{ component: this._view.modelBuilder.separator().withProps({ width: 1000 }).component() },
{ component: this.migrationInfoGrid() },
{ component: this._view.modelBuilder.separator().withProps({ width: 1000 }).component() },
{ component: this._fileCount },
{ component: this._fileTable }
{ component: this._fileTable },
{ component: this._emptyTableFill }
];
const formBuilder = view.modelBuilder.formContainer().withFormItems(
@@ -578,6 +624,13 @@ export class MigrationCutoverDialog {
this.showInfoField(this._lastLSNInfoField);
this.showInfoField(this._lastAppliedBackupTakenOnInfoField);
if (tableData.length === 0 && this._shouldDisplayBackupFileTable()) {
this._emptyTableFill.updateCssStyles({
'display': 'flex'
});
this._fileTable.height = '50px';
}
if (this._shouldDisplayBackupFileTable()) {
this._fileCount.updateCssStyles({
display: 'inline'