mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 01:25:37 -05:00
use context view provider to show the filter (#15106)
* use context view provider * handle promise * replace .then with .catch
This commit is contained in:
@@ -25,6 +25,7 @@ import { Emitter } from 'vs/base/common/event';
|
||||
import { ContextMenuAnchor } from 'sql/workbench/contrib/resourceViewer/browser/resourceViewerEditor';
|
||||
import { LoadingSpinnerPlugin } from 'sql/base/browser/ui/table/plugins/loadingSpinner.plugin';
|
||||
import { attachButtonStyler } from 'vs/platform/theme/common/styler';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
|
||||
export class ResourceViewerTable extends Disposable {
|
||||
|
||||
@@ -38,7 +39,8 @@ export class ResourceViewerTable extends Disposable {
|
||||
@IWorkbenchThemeService private _themeService: IWorkbenchThemeService,
|
||||
@IOpenerService private _openerService: IOpenerService,
|
||||
@ICommandService private _commandService: ICommandService,
|
||||
@INotificationService private _notificationService: INotificationService) {
|
||||
@INotificationService private _notificationService: INotificationService,
|
||||
@IContextViewService private _contextViewService: IContextViewService) {
|
||||
super();
|
||||
let filterFn = (data: Array<azdata.DataGridItem>): Array<azdata.DataGridItem> => {
|
||||
return data.filter(item => this.filter(item));
|
||||
@@ -54,7 +56,7 @@ export class ResourceViewerTable extends Disposable {
|
||||
}));
|
||||
|
||||
this._resourceViewerTable.setSelectionModel(new RowSelectionModel());
|
||||
let filterPlugin = new HeaderFilter<azdata.DataGridItem>();
|
||||
let filterPlugin = new HeaderFilter<azdata.DataGridItem>(this._contextViewService);
|
||||
this._register(attachButtonStyler(filterPlugin, this._themeService));
|
||||
this._register(attachTableStyler(this._resourceViewerTable, this._themeService));
|
||||
this._register(this._resourceViewerTable.onClick(this.onTableClick, this));
|
||||
|
||||
Reference in New Issue
Block a user