core-app-api: fix index route gathering

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-10-04 12:27:37 +02:00
parent 169420074c
commit 27e6404aba
3 changed files with 10 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-app-api': patch
---
Fixed a bug where gathered index routes would fail to bind routable extensions. This would typically show up when placing a routable extension in the entity page overview tab.
@@ -301,7 +301,7 @@ describe('discovery', () => {
HELLO
</AggregationComponent>
<Route path="bar" element={<Extension3 />}>
<AggregationComponent path="baz">
<AggregationComponent path="">
<Extension4>
<Extension5 />
</Extension4>
@@ -322,8 +322,8 @@ describe('discovery', () => {
[ref1, 'foo'],
[ref2, 'foo'],
[ref3, 'bar'],
[ref4, 'baz'],
[ref5, 'baz'],
[ref4, ''],
[ref5, ''],
]);
expect(sortedEntries(routing.parents)).toEqual([
[ref1, undefined],
@@ -337,7 +337,7 @@ describe('discovery', () => {
routeObj(
'bar',
[ref3],
[routeObj('baz', [ref4, ref5], [], 'gathered')],
[routeObj('', [ref4, ref5], [], 'gathered')],
undefined,
plugin,
),
@@ -178,7 +178,7 @@ export const routingV2Collector = createCollector(
}
if (mountPoint) {
if (!ctx?.gatherPath) {
if (ctx?.gatherPath === undefined) {
throw new Error(
`Routable extension "${stringifyNode(
node,