dashboard refresh fix (#20596)

This commit is contained in:
Alan Ren
2022-09-12 20:34:02 -07:00
committed by GitHub
parent 3f6f6ed07b
commit b25b591994
2 changed files with 11 additions and 2 deletions

View File

@@ -11,6 +11,7 @@ import { TextWithIconColumn } from 'sql/base/browser/ui/table/plugins/textWithIc
import { Table } from 'sql/base/browser/ui/table/table'; import { Table } from 'sql/base/browser/ui/table/table';
import { TableDataView } from 'sql/base/browser/ui/table/tableDataView'; import { TableDataView } from 'sql/base/browser/ui/table/tableDataView';
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
import { IDashboardService } from 'sql/platform/dashboard/browser/dashboardService';
import { attachTableStyler } from 'sql/platform/theme/common/styler'; import { attachTableStyler } from 'sql/platform/theme/common/styler';
import { BaseActionContext, ManageActionContext } from 'sql/workbench/browser/actions'; import { BaseActionContext, ManageActionContext } from 'sql/workbench/browser/actions';
import { getFlavor, ObjectListViewProperty } from 'sql/workbench/contrib/dashboard/browser/dashboardRegistry'; import { getFlavor, ObjectListViewProperty } from 'sql/workbench/contrib/dashboard/browser/dashboardRegistry';
@@ -60,7 +61,8 @@ export class ExplorerTable extends Disposable {
private readonly menuService: IMenuService, private readonly menuService: IMenuService,
private readonly contextKeyService: IContextKeyService, private readonly contextKeyService: IContextKeyService,
private readonly progressService: IEditorProgressService, private readonly progressService: IEditorProgressService,
private readonly logService: ILogService) { private readonly logService: ILogService,
private readonly dashboardService: IDashboardService) {
super(); super();
this._explorerView = new ExplorerView(this.context); this._explorerView = new ExplorerView(this.context);
const connectionInfo = this.bootStrapService.connectionManagementService.connectionInfo; const connectionInfo = this.bootStrapService.connectionManagementService.connectionInfo;
@@ -102,6 +104,10 @@ export class ExplorerTable extends Disposable {
this._table.grid.invalidateAllRows(); this._table.grid.invalidateAllRows();
this._table.updateRowCount(); this._table.updateRowCount();
})); }));
this._register(this.dashboardService.onLayout(() => {
this._table.grid.invalidateAllRows();
this._table.updateRowCount();
}));
} }
private showContextMenu(item: Slick.SlickData, anchor: HTMLElement | { x: number, y: number }): void { private showContextMenu(item: Slick.SlickData, anchor: HTMLElement | { x: number, y: number }): void {

View File

@@ -30,6 +30,7 @@ import { IEditorProgressService } from 'vs/platform/progress/common/progress';
import { attachInputBoxStyler } from 'vs/platform/theme/common/styler'; import { attachInputBoxStyler } from 'vs/platform/theme/common/styler';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { getFlavor } from 'sql/workbench/contrib/dashboard/browser/dashboardRegistry'; import { getFlavor } from 'sql/workbench/contrib/dashboard/browser/dashboardRegistry';
import { IDashboardService } from 'sql/platform/dashboard/browser/dashboardService';
@Component({ @Component({
selector: 'explorer-widget', selector: 'explorer-widget',
@@ -57,6 +58,7 @@ export class ExplorerWidget extends DashboardWidget implements IDashboardWidget,
@Inject(IEditorProgressService) private readonly progressService: IEditorProgressService, @Inject(IEditorProgressService) private readonly progressService: IEditorProgressService,
@Inject(IConnectionManagementService) private readonly connectionManagementService: IConnectionManagementService, @Inject(IConnectionManagementService) private readonly connectionManagementService: IConnectionManagementService,
@Inject(ICapabilitiesService) private readonly capabilitiesService: ICapabilitiesService, @Inject(ICapabilitiesService) private readonly capabilitiesService: ICapabilitiesService,
@Inject(IDashboardService) private readonly dashboardService: IDashboardService,
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef @Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef
) { ) {
super(changeRef); super(changeRef);
@@ -87,7 +89,8 @@ export class ExplorerWidget extends DashboardWidget implements IDashboardWidget,
this.menuService, this.menuService,
this.contextKeyService, this.contextKeyService,
this.progressService, this.progressService,
this.logService); this.logService,
this.dashboardService);
this._register(this._input); this._register(this._input);
this._register(attachInputBoxStyler(this._input, this.themeService)); this._register(attachInputBoxStyler(this._input, this.themeService));
this._register(this._table); this._register(this._table);