From 2255bfd1c40e155184646d62ebc56673ba8269f4 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 3 Mar 2022 13:37:33 +0100 Subject: [PATCH] Apply suggestions from code review Signed-off-by: Patrik Oldsberg --- .changeset/small-hornets-dress.md | 6 +++++- plugins/catalog-common/src/search/CatalogEntityDocument.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.changeset/small-hornets-dress.md b/.changeset/small-hornets-dress.md index 6d6817977d..2bb73b1ba3 100644 --- a/.changeset/small-hornets-dress.md +++ b/.changeset/small-hornets-dress.md @@ -3,4 +3,8 @@ '@backstage/plugin-catalog-common': patch --- -Moved the `CatalogEntityDocument` to `@backstage/plugin-catalog-common` and deprecated the export from `@backstage/plugin-catalog-backend` +Moved the `CatalogEntityDocument` to `@backstage/plugin-catalog-common` and deprecated the export from `@backstage/plugin-catalog-backend`. + +A new `type` field has also been added to `CatalogEntityDocument` as a replacement for `componentType`, which is now deprecated. Both fields are still present and should be set to the same value in order to avoid issues with indexing. + +Any search customizations need to be updated to use this new `type` field instead, including any custom frontend filters, custom frontend result components, custom search decorators, or non-default Catalog collator implementations. diff --git a/plugins/catalog-common/src/search/CatalogEntityDocument.ts b/plugins/catalog-common/src/search/CatalogEntityDocument.ts index 005bc79c92..834dde2568 100644 --- a/plugins/catalog-common/src/search/CatalogEntityDocument.ts +++ b/plugins/catalog-common/src/search/CatalogEntityDocument.ts @@ -21,7 +21,7 @@ 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 */ + /** @deprecated `componentType` is being renamed to `type`. During the transition both of these fields should be set to the same value, in order to avoid issues with indexing. */ componentType: string; type: string; namespace: string;