fix(catalog-backend): preserve default allowedLocationTypes
Signed-off-by: Thomas Cardonne <thomas.cardonne@adevinta.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-backend': patch
|
||||
---
|
||||
|
||||
Preserve default `allowedLocationTypes` when `setAllowedLocationTypes()` of `CatalogLocationsExtensionPoint` is not called.
|
||||
@@ -46,7 +46,7 @@ import { ForwardedError } from '@backstage/errors';
|
||||
class CatalogLocationsExtensionPointImpl
|
||||
implements CatalogLocationsExtensionPoint
|
||||
{
|
||||
#locationTypes = new Array<string>();
|
||||
#locationTypes: string[] | undefined;
|
||||
|
||||
setAllowedLocationTypes(locationTypes: Array<string>) {
|
||||
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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user