diff --git a/dashboard/components/empty-state/EmptyState.tsx b/dashboard/components/empty-state/EmptyState.tsx index cd7883b32..74b65aabb 100644 --- a/dashboard/components/empty-state/EmptyState.tsx +++ b/dashboard/components/empty-state/EmptyState.tsx @@ -21,7 +21,8 @@ type Poses = | 'shirt' | 'whiteboard' | 'thinking' - | 'working'; + | 'working' + | 'tablet'; export type EmptyStateProps = { title: string; diff --git a/dashboard/components/explorer/DependencyGraph.tsx b/dashboard/components/explorer/DependencyGraph.tsx index 4c98ab025..14e33ed6b 100644 --- a/dashboard/components/explorer/DependencyGraph.tsx +++ b/dashboard/components/explorer/DependencyGraph.tsx @@ -1,5 +1,5 @@ /* eslint-disable react-hooks/exhaustive-deps */ -import React, { useState, memo } from 'react'; +import React, { useState, memo, useEffect } from 'react'; import CytoscapeComponent from 'react-cytoscapejs'; import Cytoscape, { EventObject } from 'cytoscape'; import popper from 'cytoscape-popper'; @@ -12,6 +12,8 @@ import nodeHtmlLabel, { // @ts-ignore import COSEBilkent from 'cytoscape-cose-bilkent'; +import EmptyState from '@components/empty-state/EmptyState'; + import Tooltip from '@components/tooltip/Tooltip'; import WarningIcon from '@components/icons/WarningIcon'; import { ReactFlowData } from './hooks/useDependencyGraph'; @@ -36,6 +38,8 @@ Cytoscape.use(popper); const DependencyGraph = ({ data }: DependencyGraphProps) => { const [initDone, setInitDone] = useState(false); + const dataIsEmpty: boolean = data.nodes.length === 0; + // Type technically is Cytoscape.EdgeCollection but that throws an unexpected error const loopAnimation = (eles: any) => { const ani = eles.animation(edgeAnimationConfig[0], edgeAnimationConfig[1]); @@ -122,39 +126,55 @@ const DependencyGraph = ({ data }: DependencyGraphProps) => { return (