From 633019509ac78b80ab2d7fcfc339857eab710d9b Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 3 Mar 2022 11:38:26 +0100 Subject: [PATCH] chore: reworking some more things Signed-off-by: blam --- plugins/catalog-backend/src/search/DefaultCatalogCollator.ts | 1 + .../src/search/DefaultCatalogCollatorFactory.ts | 1 + plugins/catalog-common/api-report.md | 4 +++- plugins/catalog-common/src/search/CatalogEntityDocument.ts | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/catalog-backend/src/search/DefaultCatalogCollator.ts b/plugins/catalog-backend/src/search/DefaultCatalogCollator.ts index a577147082..7700048b14 100644 --- a/plugins/catalog-backend/src/search/DefaultCatalogCollator.ts +++ b/plugins/catalog-backend/src/search/DefaultCatalogCollator.ts @@ -126,6 +126,7 @@ export class DefaultCatalogCollator { }), text: this.getDocumentText(entity), componentType: entity.spec?.type?.toString() || 'other', + type: entity.spec?.type?.toString() || 'other', namespace: entity.metadata.namespace || 'default', kind: entity.kind, lifecycle: (entity.spec?.lifecycle as string) || '', diff --git a/plugins/catalog-backend/src/search/DefaultCatalogCollatorFactory.ts b/plugins/catalog-backend/src/search/DefaultCatalogCollatorFactory.ts index 811ac10210..ca6395b60a 100644 --- a/plugins/catalog-backend/src/search/DefaultCatalogCollatorFactory.ts +++ b/plugins/catalog-backend/src/search/DefaultCatalogCollatorFactory.ts @@ -155,6 +155,7 @@ export class DefaultCatalogCollatorFactory implements DocumentCollatorFactory { }), text: this.getDocumentText(entity), componentType: entity.spec?.type?.toString() || 'other', + type: entity.spec?.type?.toString() || 'other', namespace: entity.metadata.namespace || 'default', kind: entity.kind, lifecycle: (entity.spec?.lifecycle as string) || '', diff --git a/plugins/catalog-common/api-report.md b/plugins/catalog-common/api-report.md index 8ae9571d4c..a73cae9994 100644 --- a/plugins/catalog-common/api-report.md +++ b/plugins/catalog-common/api-report.md @@ -14,7 +14,7 @@ export const catalogEntityDeletePermission: Permission; // @public export interface CatalogEntityDocument extends IndexableDocument { - // (undocumented) + // @deprecated (undocumented) componentType: string; // (undocumented) kind: string; @@ -24,6 +24,8 @@ export interface CatalogEntityDocument extends IndexableDocument { namespace: string; // (undocumented) owner: string; + // (undocumented) + type: string; } // @alpha diff --git a/plugins/catalog-common/src/search/CatalogEntityDocument.ts b/plugins/catalog-common/src/search/CatalogEntityDocument.ts index e48cde431a..005bc79c92 100644 --- a/plugins/catalog-common/src/search/CatalogEntityDocument.ts +++ b/plugins/catalog-common/src/search/CatalogEntityDocument.ts @@ -21,7 +21,9 @@ import { IndexableDocument } from '@backstage/search-common'; * @public */ export interface CatalogEntityDocument extends IndexableDocument { + /** @deprecated use `type` as well, as `componentType` will be removed after a few releases but we dont want to break indexing */ componentType: string; + type: string; namespace: string; kind: string; lifecycle: string;