diff --git a/src/sql/workbench/contrib/dashboard/browser/widgets/explorer/explorerTable.ts b/src/sql/workbench/contrib/dashboard/browser/widgets/explorer/explorerTable.ts index dce526d9e2..43c3c40161 100644 --- a/src/sql/workbench/contrib/dashboard/browser/widgets/explorer/explorerTable.ts +++ b/src/sql/workbench/contrib/dashboard/browser/widgets/explorer/explorerTable.ts @@ -46,7 +46,7 @@ export class ExplorerTable extends Disposable { private _actionsColumn: ButtonColumn; private _filterStr: string; private _explorerView: ExplorerView; - private _displayProperties: ObjectListViewProperty[]; + private _propertiesToDisplay: ObjectListViewProperty[]; constructor(private parentElement: HTMLElement, private readonly router: Router, @@ -61,8 +61,8 @@ export class ExplorerTable extends Disposable { super(); this._explorerView = new ExplorerView(this.context); const connectionInfo = this.bootStrapService.connectionManagementService.connectionInfo; - this._displayProperties = this._explorerView.getPropertyList(getFlavor(connectionInfo.serverInfo, this.logService, connectionInfo.providerId)); - const explorerFilter = new ExplorerFilter(this.context, this._displayProperties.map(p => p.value)); + this._propertiesToDisplay = this._explorerView.getPropertyList(getFlavor(connectionInfo.serverInfo, this.logService, connectionInfo.providerId)); + const explorerFilter = new ExplorerFilter(this.context, this.propertiesToFilter); this._view = new TableDataView(undefined, undefined, undefined, (data: Slick.SlickData[]): Slick.SlickData[] => { return explorerFilter.filter(this._filterStr, data); }); @@ -180,13 +180,13 @@ export class ExplorerTable extends Disposable { private get columnDefinitions(): Slick.Column[] { const totalWidth = DOM.getContentWidth(this.parentElement); let totalColumnWidthWeight: number = 0; - this._displayProperties.forEach(p => { + this._propertiesToDisplay.forEach(p => { if (p.widthWeight) { totalColumnWidthWeight += p.widthWeight; } }); - const columns: Slick.Column[] = this._displayProperties.map(property => { + const columns: Slick.Column[] = this._propertiesToDisplay.map(property => { const columnWidth = property.widthWeight ? totalWidth * (property.widthWeight / totalColumnWidthWeight) : undefined; if (property.value === NameProperty) { const nameColumn = new TextWithIconColumn({ @@ -209,5 +209,14 @@ export class ExplorerTable extends Disposable { columns.push(this._actionsColumn.definition); return columns; } + + private get propertiesToFilter(): string[] { + const properties = this._propertiesToDisplay.map(p => p.value); + if (this.context === 'database') { + // for objects in databases, we also support filter by full name: schema.objectName even though the full name is not being displayed. + properties.push('fullName'); + } + return properties; + } } diff --git a/src/sql/workbench/contrib/dashboard/browser/widgets/explorer/objectMetadataWrapper.ts b/src/sql/workbench/contrib/dashboard/browser/widgets/explorer/objectMetadataWrapper.ts index fcc04b6cd3..5867f2a8cb 100644 --- a/src/sql/workbench/contrib/dashboard/browser/widgets/explorer/objectMetadataWrapper.ts +++ b/src/sql/workbench/contrib/dashboard/browser/widgets/explorer/objectMetadataWrapper.ts @@ -13,6 +13,10 @@ export class ObjectMetadataWrapper implements ObjectMetadata { public name: string; public schema: string; + public get fullName(): string { + return `${this.schema}.${this.name}`; + } + constructor(from?: ObjectMetadata) { if (from) { this.metadataType = from.metadataType; @@ -65,4 +69,4 @@ export class ObjectMetadataWrapper implements ObjectMetadata { } } } -} \ No newline at end of file +}