Merge pull request #5037 from azerbe/5033-fix_AnalyzerBackend_in_DefaultApp

5033: (fix) adds locationAnalyzer to default-app template
This commit is contained in:
Fredrik Adelöw
2021-03-24 14:36:07 +01:00
committed by GitHub
2 changed files with 33 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
---
'@backstage/create-app': patch
---
(fix) Adds locationAnalyzer to default-app template
The locationAnalyzer was missing from the default-app template.
This resulted in 404 errors in newly bootstrapped backstage applications,
when adding components without configuration.
To fix this in an existing backstage application, the locationAnalyzer needs
to be carried from the builder to the router in the
`packages/backend/src/plugins/catalog.ts` file.
```diff
const builder = new CatalogBuilder(env);
const {
entitiesCatalog,
locationsCatalog,
higherOrderOperation,
+ locationAnalyzer,
} = await builder.build();
// ...
return await createRouter({
entitiesCatalog,
locationsCatalog,
higherOrderOperation,
+ locationAnalyzer,
logger: env.logger,
});
```
@@ -13,6 +13,7 @@ export default async function createPlugin(env: PluginEnvironment): Promise<Rout
entitiesCatalog,
locationsCatalog,
higherOrderOperation,
locationAnalyzer,
} = await builder.build();
useHotCleanup(
@@ -24,6 +25,7 @@ export default async function createPlugin(env: PluginEnvironment): Promise<Rout
entitiesCatalog,
locationsCatalog,
higherOrderOperation,
locationAnalyzer,
logger: env.logger,
});
}