Composability updates for Splunk On-Call plugin

Signed-off-by: Tim Hansen <timbonicus@gmail.com>
This commit is contained in:
Tim Hansen
2021-05-17 11:22:42 -06:00
parent 99dddfb610
commit 8aa0b60257
7 changed files with 97 additions and 57 deletions
+13 -16
View File
@@ -25,27 +25,24 @@ cd packages/app
yarn add @backstage/plugin-splunk-on-call
```
Add it to the app in `plugins.ts`:
```ts
export { plugin as SplunkOnCall } from '@backstage/plugin-splunk-on-call';
```
Add it to the `EntityPage.tsx`:
Add it to your `EntityPage`:
```ts
// packages/app/src/components/catalog/EntityPage.tsx
import {
isPluginApplicableToEntity as isSplunkOnCallAvailable,
SplunkOnCallCard,
isSplunkOnCallAvailable,
EntitySplunkOnCallCard,
} from '@backstage/plugin-splunk-on-call';
// ...
{
isSplunkOnCallAvailable(entity) && (
<Grid item md={6}>
<SplunkOnCallCard entity={entity} />
</Grid>
);
}
const overviewContent = (
<Grid container spacing={3} alignItems="stretch">
<EntitySwitch>
<EntitySwitch.Case if={isSplunkOnCallAvailable}>
<Grid item md={6}>
<EntitySplunkOnCallCard />
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
```
## Client configuration