diff --git a/.changeset/sixty-sheep-drive.md b/.changeset/sixty-sheep-drive.md index 0b96248c93..2e947b30f9 100644 --- a/.changeset/sixty-sheep-drive.md +++ b/.changeset/sixty-sheep-drive.md @@ -1,7 +1,5 @@ --- '@backstage/plugin-catalog-backend': patch -'@backstage/plugin-catalog-react': patch -'@backstage/plugin-catalog': patch --- Fixed bug when searching an entity by `spec.profile.displayName` in the catalog on the frontend. Text filter fields were not applied correctly to the database query resulting in empty results. diff --git a/plugins/catalog-react/src/filters.test.ts b/plugins/catalog-react/src/filters.test.ts index 332f4c22c1..8ddac7e53b 100644 --- a/plugins/catalog-react/src/filters.test.ts +++ b/plugins/catalog-react/src/filters.test.ts @@ -41,18 +41,6 @@ const entities: Entity[] = [ tags: ['gRPC', 'java'], }, }, - { - apiVersion: '1', - kind: 'User', - metadata: { - name: 'user', - }, - spec: { - profile: { - displayName: 'John Doe', - }, - }, - }, ]; const templates: TemplateEntityV1beta3[] = [ @@ -91,13 +79,6 @@ describe('EntityTextFilter', () => { expect(filter.filterEntity(entities[1])).toBeFalsy(); }); - it('should search displayName', () => { - const filter = new EntityTextFilter('John D'); - expect(filter.filterEntity(entities[0])).toBeFalsy(); - expect(filter.filterEntity(entities[1])).toBeFalsy(); - expect(filter.filterEntity(entities[2])).toBeTruthy(); - }); - it('should search template title', () => { const filter = new EntityTextFilter('spring'); expect(filter.filterEntity(templates[0])).toBeFalsy(); diff --git a/plugins/catalog-react/src/filters.ts b/plugins/catalog-react/src/filters.ts index 6c68dad9aa..08be27a561 100644 --- a/plugins/catalog-react/src/filters.ts +++ b/plugins/catalog-react/src/filters.ts @@ -94,7 +94,6 @@ export class EntityTextFilter implements EntityFilter { const partialMatch = this.toUpperArray([ entity.metadata.name, entity.metadata.title, - (entity.spec?.profile as { displayName?: string })?.displayName, ]); for (const word of words) { diff --git a/plugins/catalog/report.api.md b/plugins/catalog/report.api.md index fafdc6c9fa..ffb46afc6e 100644 --- a/plugins/catalog/report.api.md +++ b/plugins/catalog/report.api.md @@ -181,13 +181,6 @@ export const CatalogTable: { } | undefined, ): TableColumn; - createDisplayNameColumn( - options?: - | { - hidden?: boolean | undefined; - } - | undefined, - ): TableColumn; createLabelColumn( key: string, options?: diff --git a/plugins/catalog/src/components/CatalogTable/columns.tsx b/plugins/catalog/src/components/CatalogTable/columns.tsx index fc804fc22f..d5362badda 100644 --- a/plugins/catalog/src/components/CatalogTable/columns.tsx +++ b/plugins/catalog/src/components/CatalogTable/columns.tsx @@ -180,16 +180,6 @@ export const columnFactories = Object.freeze({ searchable: true, }; }, - createDisplayNameColumn(options?: { - hidden?: boolean; - }): TableColumn { - return { - title: 'Display Name', - field: 'entity.spec.profile.displayName', - hidden: options?.hidden, - searchable: true, - }; - }, createLabelColumn( key: string, options?: { title?: string; defaultValue?: string }, diff --git a/plugins/catalog/src/components/CatalogTable/defaultCatalogTableColumnsFunc.tsx b/plugins/catalog/src/components/CatalogTable/defaultCatalogTableColumnsFunc.tsx index f5f41c1e32..54dd701770 100644 --- a/plugins/catalog/src/components/CatalogTable/defaultCatalogTableColumnsFunc.tsx +++ b/plugins/catalog/src/components/CatalogTable/defaultCatalogTableColumnsFunc.tsx @@ -46,19 +46,11 @@ export const defaultCatalogTableColumnsFunc: CatalogTableColumnsFunc = ({ ]; switch (filters.kind?.value) { case 'user': - return [ - columnFactories.createDisplayNameColumn({ hidden: true }), - ...descriptionTagColumns, - ]; + return [...descriptionTagColumns]; case 'domain': case 'system': return [columnFactories.createOwnerColumn(), ...descriptionTagColumns]; case 'group': - return [ - columnFactories.createDisplayNameColumn({ hidden: true }), - columnFactories.createSpecTypeColumn({ hidden: !showTypeColumn }), - ...descriptionTagColumns, - ]; case 'template': return [ columnFactories.createSpecTypeColumn({ hidden: !showTypeColumn }),