feat(plugins/pagerduty): add serviceId to pager duty entity

Signed-off-by: Alec Jacobs <cajacobs5401@gmail.com>
This commit is contained in:
Alec Jacobs
2022-05-25 15:49:45 -07:00
parent 7fdb8eb4fc
commit 0e8fc43492
+9 -4
View File
@@ -16,13 +16,18 @@
import { useEntity } from '@backstage/plugin-catalog-react';
import { PAGERDUTY_INTEGRATION_KEY } from '../components/constants';
import {
PAGERDUTY_INTEGRATION_KEY,
PAGERDUTY_SERVICE_ID,
} from '../components/constants';
export function usePagerdutyEntity() {
const { entity } = useEntity();
const integrationKey =
entity.metadata.annotations?.[PAGERDUTY_INTEGRATION_KEY];
const {
[PAGERDUTY_INTEGRATION_KEY]: integrationKey,
[PAGERDUTY_SERVICE_ID]: serviceId,
} = entity.metadata.annotations || ({} as Record<string, string>);
const name = entity.metadata.name;
return { integrationKey, name };
return { integrationKey, serviceId, name };
}