fix: rollback unnecessary changes

Signed-off-by: Julien <julien.hery@ext.adeo.com>
This commit is contained in:
Julien
2024-11-18 10:48:14 +01:00
parent 937703bca2
commit d8ab481a28
6 changed files with 1 additions and 48 deletions
-2
View File
@@ -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.
-19
View File
@@ -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();
-1
View File
@@ -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) {
-7
View File
@@ -181,13 +181,6 @@ export const CatalogTable: {
}
| undefined,
): TableColumn<CatalogTableRow>;
createDisplayNameColumn(
options?:
| {
hidden?: boolean | undefined;
}
| undefined,
): TableColumn<CatalogTableRow>;
createLabelColumn(
key: string,
options?:
@@ -180,16 +180,6 @@ export const columnFactories = Object.freeze({
searchable: true,
};
},
createDisplayNameColumn(options?: {
hidden?: boolean;
}): TableColumn<CatalogTableRow> {
return {
title: 'Display Name',
field: 'entity.spec.profile.displayName',
hidden: options?.hidden,
searchable: true,
};
},
createLabelColumn(
key: string,
options?: { title?: string; defaultValue?: string },
@@ -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 }),