Skip to content

Commit

Permalink
chore(data-warehouse): Added error messages on components other than …
Browse files Browse the repository at this point in the history
…table (#24779)
  • Loading branch information
Gilbert09 authored Sep 4, 2024
1 parent 27438d6 commit a5f1deb
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { AnimationType } from 'lib/animations/animations'
import { Animation } from 'lib/components/Animation/Animation'
import { useCallback, useState } from 'react'
import { DatabaseTableTreeWithItems } from 'scenes/data-warehouse/external/DataWarehouseTables'
import { InsightErrorState } from 'scenes/insights/EmptyStates'
import { HogQLBoldNumber } from 'scenes/insights/views/BoldNumber/BoldNumber'
import { urls } from 'scenes/urls'

Expand Down Expand Up @@ -104,6 +105,8 @@ function InternalDataTableVisualization(props: DataTableVisualizationProps): JSX
sourceFeatures,
response,
responseLoading,
responseError,
queryCancelled,
isChartSettingsPanelOpen,
} = useValues(dataVisualizationLogic)

Expand Down Expand Up @@ -202,7 +205,27 @@ function InternalDataTableVisualization(props: DataTableVisualizationProps): JSX
'pt-[46px]': showEditingUI,
})}
>
{component}
{visualizationType !== ChartDisplayType.ActionsTable && responseError ? (
<div
className={clsx('rounded bg-bg-light relative flex flex-1 flex-col p-2', {
border: showEditingUI,
})}
>
<InsightErrorState
query={props.query}
excludeDetail
title={
queryCancelled
? 'The query was cancelled'
: response && 'error' in response
? (response as any).error
: responseError
}
/>
</div>
) : (
component
)}
</div>
</div>
</div>
Expand Down

0 comments on commit a5f1deb

Please sign in to comment.