feat(plugins/pagerduty): add serviceId to pager duty entity
Signed-off-by: Alec Jacobs <cajacobs5401@gmail.com>
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user