Update plugin example for composability

Signed-off-by: Adam Harvey <adaharve@cisco.com>
Signed-off-by: Brett Wright <wright.brett@gmail.com>
This commit is contained in:
Adam Harvey
2021-04-14 14:42:50 -04:00
committed by Brett Wright
parent adb7f1c063
commit 89ecdf526a
@@ -34,23 +34,25 @@ CircleCI is a frontend UI plugin, it goes in `app` rather than `backend`.
export { plugin as Circleci } from '@backstage/plugin-circleci';
```
3. Register the plugin router:
3. Register the plugin in the entity pages:
```jsx
// packages/app/src/components/catalog/EntityPage.tsx
import { Router as CircleCIRouter } from '@backstage/plugin-circleci';
import {
EntityCircleCIContent,
isCircleCIAvailable,
} from '@backstage/plugin-circleci';
// Then somewhere inside <EntityPageLayout>
<EntityPageLayout.Content
path="/ci-cd/*"
title="CI/CD"
element={<CircleCIRouter />}
/>;
<EntitySwitch.Case if={isCircleCIAvailable}>
<EntityCircleCIContent />
</EntitySwitch.Case>;
```
Note that stand-alone plugins that are not "attached" to the Software Catalog
would be added outside the `EntityPage`.
This is just one example, but each Backstage instance may integrate content or
cards to suit their needs on different pages, tabs, etc. Note that stand-alone
plugins that are not "attached" to the Software Catalog would be added outside
the `EntityPage`.
4. [Optional] Add proxy config: