diff --git a/plugins/catalog-backend/api-report.md b/plugins/catalog-backend/api-report.md index 6c8c9a8f82..6660912dda 100644 --- a/plugins/catalog-backend/api-report.md +++ b/plugins/catalog-backend/api-report.md @@ -32,7 +32,6 @@ import { Router } from 'express'; import { ScmIntegrationRegistry } from '@backstage/integration'; import { ScmIntegrations } from '@backstage/integration'; import { UrlReader } from '@backstage/backend-common'; -import { UserEntity } from '@backstage/catalog-model'; import { Validators } from '@backstage/catalog-model'; // Warning: (ae-missing-release-tag) "AddLocationResult" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) @@ -765,10 +764,6 @@ export class DefaultCatalogCollator implements DocumentCollator { }, ): DefaultCatalogCollator; // (undocumented) - protected getDocumentText(entity: Entity): string; - // (undocumented) - protected isUserEntity(entity: Entity): entity is UserEntity; - // (undocumented) protected locationTemplate: string; // (undocumented) readonly type: string; diff --git a/plugins/catalog-backend/src/search/DefaultCatalogCollator.ts b/plugins/catalog-backend/src/search/DefaultCatalogCollator.ts index 5458b9054a..751ea30832 100644 --- a/plugins/catalog-backend/src/search/DefaultCatalogCollator.ts +++ b/plugins/catalog-backend/src/search/DefaultCatalogCollator.ts @@ -81,16 +81,17 @@ export class DefaultCatalogCollator implements DocumentCollator { return formatted.toLowerCase(); } - protected isUserEntity(entity: Entity): entity is UserEntity { + private isUserEntity(entity: Entity): entity is UserEntity { return entity.kind === 'User'; } - protected getDocumentText(entity: Entity): string { + private getDocumentText(entity: Entity): string { let documentText = entity.metadata.description || ''; if (this.isUserEntity(entity)) { - if (entity.spec?.profile?.displayName && entity.metadata.description) { + if (entity.spec?.profile?.displayName && documentText) { // combine displayName and description - documentText = `${entity.spec?.profile?.displayName} : ${entity.metadata.description}`; + const displayName = entity.spec?.profile?.displayName; + documentText = displayName.concat(' : ', documentText); } else { documentText = entity.spec?.profile?.displayName || documentText; }