validation added
Signed-off-by: mufaddal motiwala <mufaddalmm.52@gmail.com>
This commit is contained in:
@@ -22,7 +22,7 @@ import { useEntity } from '@backstage/plugin-catalog-react';
|
||||
import { NEWRELIC_GUID } from './constants';
|
||||
|
||||
export const isNewRelicDashboardAvailable = (entity: Entity) =>
|
||||
Boolean(entity.metadata.annotations?.[NEWRELIC_GUID]);
|
||||
Boolean(entity?.metadata?.annotations?.[NEWRELIC_GUID]);
|
||||
|
||||
type Props = {
|
||||
/** @deprecated The entity is now grabbed from context instead */
|
||||
|
||||
@@ -20,8 +20,8 @@ import { NEWRELIC_GUID } from '../constants';
|
||||
export function useNewRelicDashboardEntity() {
|
||||
const { entity } = useEntity();
|
||||
const integrationKey: string | undefined =
|
||||
entity.metadata.annotations?.[NEWRELIC_GUID];
|
||||
const name: string | undefined = entity.metadata.name;
|
||||
entity?.metadata?.annotations?.[NEWRELIC_GUID];
|
||||
const name: string | undefined = entity?.metadata?.name;
|
||||
|
||||
return { integrationKey, name };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user