fix: rollback unnecessary changes
Signed-off-by: Julien <julien.hery@ext.adeo.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 }),
|
||||
|
||||
Reference in New Issue
Block a user