core-compat-api: forward routes to converted plugins

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-01-19 11:19:43 +01:00
parent 7155c30a88
commit 2f2a1d2ad2
2 changed files with 11 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-compat-api': patch
---
Plugins converted by `convertLegacyApp` now have their `routes` and `externalRoutes` included as well, allowing the to be used to bind external routes in configuration.
@@ -32,7 +32,10 @@ import {
} from '@backstage/frontend-plugin-api';
import React, { Children, ReactNode, isValidElement } from 'react';
import { Route, Routes } from 'react-router-dom';
import { convertLegacyRouteRef } from './convertLegacyRouteRef';
import {
convertLegacyRouteRef,
convertLegacyRouteRefs,
} from './convertLegacyRouteRef';
import { compatWrapper } from './compatWrapper';
/*
@@ -244,6 +247,8 @@ export function collectLegacyRoutes(
createApiExtension({ factory }),
),
],
routes: convertLegacyRouteRefs(plugin.routes ?? {}),
externalRoutes: convertLegacyRouteRefs(plugin.externalRoutes ?? {}),
}),
);
}