Update the 'create-app' template to use the new constructor for DefaultCatalogCollator
Signed-off-by: Roy Jacobs <roy.jacobs@gmail.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
---
|
||||
'@backstage/create-app': patch
|
||||
---
|
||||
|
||||
Updated the search configuration class to use the static `fromConfig`-based constructor for the `DefaultCatalogCollator`.
|
||||
|
||||
To apply this change to an existing app, replace the following line in `search.ts`:
|
||||
|
||||
```diff
|
||||
-collator: new DefaultCatalogCollator({ discovery })
|
||||
+collator: DefaultCatalogCollator.fromConfig(config, { discovery })
|
||||
```
|
||||
|
||||
The `config` parameter was not needed before, so make sure you also add that in the signature of `createPlugin`
|
||||
in `search.ts`:
|
||||
|
||||
```diff
|
||||
export default async function createPlugin({
|
||||
logger,
|
||||
discovery,
|
||||
+ config,
|
||||
}: PluginEnvironment) {
|
||||
```
|
||||
@@ -10,6 +10,7 @@ import { DefaultCatalogCollator } from '@backstage/plugin-catalog-backend';
|
||||
export default async function createPlugin({
|
||||
logger,
|
||||
discovery,
|
||||
config,
|
||||
}: PluginEnvironment) {
|
||||
// Initialize a connection to a search engine.
|
||||
const searchEngine = new LunrSearchEngine({ logger });
|
||||
@@ -19,7 +20,7 @@ export default async function createPlugin({
|
||||
// particular collator gathers entities from the software catalog.
|
||||
indexBuilder.addCollator({
|
||||
defaultRefreshIntervalSeconds: 600,
|
||||
collator: new DefaultCatalogCollator({ discovery }),
|
||||
collator: DefaultCatalogCollator.fromConfig(config, { discovery }),
|
||||
});
|
||||
|
||||
// The scheduler controls when documents are gathered from collators and sent
|
||||
|
||||
Reference in New Issue
Block a user