diff --git a/src/components/Executions/ExecutionDetails/ExecutionDetails.tsx b/src/components/Executions/ExecutionDetails/ExecutionDetails.tsx index 9d2260668..f3d02aa94 100644 --- a/src/components/Executions/ExecutionDetails/ExecutionDetails.tsx +++ b/src/components/Executions/ExecutionDetails/ExecutionDetails.tsx @@ -5,6 +5,7 @@ import * as classnames from 'classnames'; import { LargeLoadingSpinner } from 'components/common/LoadingSpinner'; import { WaitForQuery } from 'components/common/WaitForQuery'; import { withRouteParams } from 'components/common/withRouteParams'; +import { DataError } from 'components/Errors/DataError'; import { Execution } from 'models/Execution/types'; import * as React from 'react'; import { ExecutionContext } from '../contexts'; @@ -97,6 +98,7 @@ export const ExecutionDetailsContainer: React.FC = ({ return ( diff --git a/src/components/Executions/ExecutionDetails/ExecutionNodeViews.tsx b/src/components/Executions/ExecutionDetails/ExecutionNodeViews.tsx index 4276a85ad..bb1c8e91c 100644 --- a/src/components/Executions/ExecutionDetails/ExecutionNodeViews.tsx +++ b/src/components/Executions/ExecutionDetails/ExecutionNodeViews.tsx @@ -1,6 +1,7 @@ import { Tab, Tabs } from '@material-ui/core'; import { makeStyles, Theme } from '@material-ui/core/styles'; import { WaitForQuery } from 'components/common/WaitForQuery'; +import { DataError } from 'components/Errors/DataError'; import { useTabState } from 'components/hooks/useTabState'; import { secondaryBackgroundColor } from 'components/Theme/constants'; import { Execution, NodeExecution } from 'models/Execution/types'; @@ -80,13 +81,19 @@ export const ExecutionNodeViews: React.FC = ({
- + {renderNodeExecutionsTable} )} {tabState.value === tabs.graph.id && ( - + {renderExecutionWorkflowGraph} )} diff --git a/src/components/Executions/ExecutionDetails/ExecutionWorkflowGraph.tsx b/src/components/Executions/ExecutionDetails/ExecutionWorkflowGraph.tsx index 8621ab152..0347dd845 100644 --- a/src/components/Executions/ExecutionDetails/ExecutionWorkflowGraph.tsx +++ b/src/components/Executions/ExecutionDetails/ExecutionWorkflowGraph.tsx @@ -1,5 +1,6 @@ import { DetailsPanel } from 'components/common/DetailsPanel'; import { WaitForQuery } from 'components/common/WaitForQuery'; +import { DataError } from 'components/Errors/DataError'; import { makeWorkflowQuery } from 'components/Workflow/workflowQueries'; import { WorkflowGraph } from 'components/WorkflowGraph/WorkflowGraph'; import { keyBy } from 'lodash'; @@ -64,7 +65,9 @@ export const ExecutionWorkflowGraph: React.FC = ({ return ( <> - {renderGraph} + + {renderGraph} + return ( diff --git a/src/components/Executions/TaskExecutionDetails/TaskExecutionNodes.tsx b/src/components/Executions/TaskExecutionDetails/TaskExecutionNodes.tsx index dcbcecd3d..fed47cfd8 100644 --- a/src/components/Executions/TaskExecutionDetails/TaskExecutionNodes.tsx +++ b/src/components/Executions/TaskExecutionDetails/TaskExecutionNodes.tsx @@ -1,6 +1,7 @@ import { Tab, Tabs } from '@material-ui/core'; import { makeStyles, Theme } from '@material-ui/core/styles'; import { WaitForQuery } from 'components/common/WaitForQuery'; +import { DataError } from 'components/Errors/DataError'; import { useConditionalQuery } from 'components/hooks/useConditionalQuery'; import { useTabState } from 'components/hooks/useTabState'; import { every } from 'lodash'; @@ -94,7 +95,10 @@ export const TaskExecutionNodes: React.FC = ({
- + {renderNodeExecutionsTable} diff --git a/src/components/common/WaitForQuery.tsx b/src/components/common/WaitForQuery.tsx index 739d95602..2cd0c7fcc 100644 --- a/src/components/common/WaitForQuery.tsx +++ b/src/components/common/WaitForQuery.tsx @@ -1,15 +1,19 @@ import { log } from 'common/log'; -import { DataError } from 'components/Errors/DataError'; import * as React from 'react'; import { QueryObserverResult } from 'react-query'; import { ErrorBoundary } from './ErrorBoundary'; const defaultErrorTitle = 'Failed to fetch data'; +interface ErrorComponentProps { + error?: Error; + retry?(): any; + errorTitle: string; +} interface WaitForQueryProps { children: (data: T) => React.ReactNode; /** Component to use for displaying errors. This will override `errorTitle` */ - errorComponent?: React.ComponentType<{ error?: Error; retry?(): any }>; + errorComponent?: React.ComponentType; /** The string to display as the header of the error content */ errorTitle?: string; /** Component to show while loading. If not provided, nothing will be rendered @@ -60,14 +64,12 @@ export const WaitForQuery = ({ case 'error': { const error = query.error || new Error('Unknown failure'); return ErrorComponent ? ( - - ) : ( - - ); + ) : null; } default: log.error(`Unexpected query status value: ${status}`);