diff --git a/libs/shared/lib/schema/panel/Schema.tsx b/libs/shared/lib/schema/panel/Schema.tsx index 96e48a22a525ecd1bc6f285b1a26645ad200c0dc..e59d1aabd26610cc728c180060ff8363914474f5 100644 --- a/libs/shared/lib/schema/panel/Schema.tsx +++ b/libs/shared/lib/schema/panel/Schema.tsx @@ -104,14 +104,14 @@ export const Schema = (props: Props) => { nodesWithRef = schemaFlow.nodes.map((node) => { return { ...node, - data: { ...node.data, reactFlowRef, tooltipClose: false, nodeCount: 'NoDefined' }, + data: { ...node.data, reactFlowRef, tooltipClose: false }, }; }); edgesWithRef = schemaFlow.edges.map((edge) => { return { ...edge, - data: { ...edge.data, reactFlowRef, tooltipClose: false, nodeCount: 'NoDefined' }, + data: { ...edge.data, reactFlowRef, tooltipClose: false }, }; }); @@ -168,8 +168,8 @@ export const Schema = (props: Props) => { nds.map((node) => { const { id, type, data } = node; - const nodeCount = type === 'entity' ? nodeStatsMap[id]?.count ?? 'noDefined' : 'noDefined'; - + const nodeCount = nodeStatsMap[id]?.count; + return { ...node, data: { @@ -187,7 +187,7 @@ export const Schema = (props: Props) => { edg.map((edge) => { const { id, type, data } = edge; - const nodeCount = type === 'entity' ? edgeStatsMap[id]?.count ?? 'noDefined' : 'noDefined'; + const nodeCount = edgeStatsMap[id]?.count; return { ...edge, diff --git a/libs/shared/lib/schema/pills/nodes/SchemaPopUp/SchemaPopUp.tsx b/libs/shared/lib/schema/pills/nodes/SchemaPopUp/SchemaPopUp.tsx index 3626a05e3c14bb8a78c1a29873eb511dc4eeb2f7..91865cf5760448d7e471a3cbe6299764144ecb45 100644 --- a/libs/shared/lib/schema/pills/nodes/SchemaPopUp/SchemaPopUp.tsx +++ b/libs/shared/lib/schema/pills/nodes/SchemaPopUp/SchemaPopUp.tsx @@ -9,14 +9,14 @@ const formatNumber = (number: number) => { export type SchemaPopUpProps = { data: Record<string, any>; connections?: { to: string; from: string }; - numberOfElements: any; + numberOfElements?: number; }; export const SchemaPopUp: React.FC<SchemaPopUpProps> = ({ data, numberOfElements, connections }) => { return ( <> <div className=""> - {numberOfElements && ( + {numberOfElements != null && numberOfElements != 0 && ( <div className="border-b border-sec-200"> <div className="flex flex-row gap-1 items-center justify-between px-3 py-1"> <Icon component="icon-[ic--baseline-numbers]" size={24} /> diff --git a/libs/shared/lib/schema/pills/nodes/relation/SchemaRelationPill.tsx b/libs/shared/lib/schema/pills/nodes/relation/SchemaRelationPill.tsx index f292c766bcdc0b714be1e0b02b2be01878987edd..f5ca399d1c857201264105e9a711bf53415b3d2b 100644 --- a/libs/shared/lib/schema/pills/nodes/relation/SchemaRelationPill.tsx +++ b/libs/shared/lib/schema/pills/nodes/relation/SchemaRelationPill.tsx @@ -92,7 +92,6 @@ export const SchemaRelationPill = React.memo(({ id, selected, data, ...props }: ) : {} } - numberOfElements={'NoDefined'} connections={{ from: data.from, to: data.to }} /> </VisualizationTooltip>