propagate entity spec to EntityNode

Signed-off-by: Long Zhang <long.zhang@electrolux.com>
This commit is contained in:
Long Zhang
2023-07-18 15:37:19 +02:00
parent 2166e52320
commit a5e067c01f
2 changed files with 6 additions and 0 deletions
@@ -15,6 +15,7 @@
*/
import { DependencyGraphTypes } from '@backstage/core-components';
import { JsonObject } from '@backstage/types';
import { MouseEventHandler } from 'react';
/**
@@ -63,6 +64,10 @@ export type EntityNodeData = {
* Namespace of the entity.
*/
namespace: string;
/**
* Optional spec of the entity.
*/
spec?: JsonObject;
/**
* Whether the entity is focused, optional, defaults to false. Focused
* entities are highlighted in the graph.
@@ -75,6 +75,7 @@ export function useEntityRelationNodesAndEdges({
kind: entity.kind,
name: entity.metadata.name,
namespace: entity.metadata.namespace ?? DEFAULT_NAMESPACE,
spec: entity.spec ?? undefined,
focused,
color: focused ? 'secondary' : 'primary',
};