use context view provider to show the filter (#15106)

* use context view provider

* handle promise

* replace .then with .catch
This commit is contained in:
Alan Ren
2021-04-13 11:34:26 -07:00
committed by GitHub
parent 836da58c2c
commit 8d098c227d
9 changed files with 60 additions and 42 deletions

View File

@@ -46,6 +46,7 @@ import { TelemetryView } from 'sql/platform/telemetry/common/telemetryKeys';
import { LocalizedStrings } from 'sql/workbench/contrib/assessment/common/strings';
import { ConnectionManagementInfo } from 'sql/platform/connection/common/connectionManagementInfo';
import { attachButtonStyler } from 'vs/platform/theme/common/styler';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
export const ASMTRESULTSVIEW_SELECTOR: string = 'asmt-results-view-component';
export const ROW_HEIGHT: number = 25;
@@ -141,7 +142,8 @@ export class AsmtResultsViewComponent extends TabChild implements IAssessmentCom
@Inject(IInstantiationService) private _instantiationService: IInstantiationService,
@Inject(IDashboardService) _dashboardService: IDashboardService,
@Inject(IAdsTelemetryService) private _telemetryService: IAdsTelemetryService,
@Inject(ILogService) protected _logService: ILogService
@Inject(ILogService) protected _logService: ILogService,
@Inject(IContextViewService) private _contextViewService: IContextViewService
) {
super();
let self = this;
@@ -316,7 +318,7 @@ export class AsmtResultsViewComponent extends TabChild implements IAssessmentCom
columnDef.formatter = (row, cell, value, columnDef, dataContext) => this.detailSelectionFormatter(row, cell, value, columnDef, dataContext as ExtendedItem<Slick.SlickData>);
columns.unshift(columnDef);
let filterPlugin = new HeaderFilter<Slick.SlickData>();
let filterPlugin = new HeaderFilter<Slick.SlickData>(this._contextViewService);
this._register(attachButtonStyler(filterPlugin, this._themeService));
this.filterPlugin = filterPlugin;
this.filterPlugin.onFilterApplied.subscribe((e, args) => {