diff --git a/.changeset/odd-books-share.md b/.changeset/odd-books-share.md new file mode 100644 index 0000000000..858a2564ad --- /dev/null +++ b/.changeset/odd-books-share.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': patch +--- + +Preserve default `allowedLocationTypes` when `setAllowedLocationTypes()` of `CatalogLocationsExtensionPoint` is not called. diff --git a/plugins/catalog-backend/src/service/CatalogPlugin.ts b/plugins/catalog-backend/src/service/CatalogPlugin.ts index 2f5fd9103d..269100e586 100644 --- a/plugins/catalog-backend/src/service/CatalogPlugin.ts +++ b/plugins/catalog-backend/src/service/CatalogPlugin.ts @@ -46,7 +46,7 @@ import { ForwardedError } from '@backstage/errors'; class CatalogLocationsExtensionPointImpl implements CatalogLocationsExtensionPoint { - #locationTypes = new Array(); + #locationTypes: string[] | undefined; setAllowedLocationTypes(locationTypes: Array) { this.#locationTypes = locationTypes; @@ -293,9 +293,11 @@ export const catalogPlugin = createBackendPlugin({ builder.addPermissionRules(...permissionExtensions.permissionRules); builder.setFieldFormatValidators(modelExtensions.fieldValidators); - builder.setAllowedLocationTypes( - locationTypeExtensions.allowedLocationTypes, - ); + if (locationTypeExtensions.allowedLocationTypes) { + builder.setAllowedLocationTypes( + locationTypeExtensions.allowedLocationTypes, + ); + } const { processingEngine, router } = await builder.build();