Skip to content

Commit

Permalink
empty state
Browse files Browse the repository at this point in the history
  • Loading branch information
EDsCODE committed Dec 12, 2024
1 parent e686c2e commit 05ce85a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 5 additions & 0 deletions frontend/src/queries/nodes/DataNode/dataNodeLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
DashboardFilter,
ErrorTrackingQuery,
ErrorTrackingQueryResponse,
HogQLQuery,
HogQLVariable,
QueryStatus,
} from '~/queries/schema'
Expand Down Expand Up @@ -174,6 +175,10 @@ export const dataNodeLogic = kea<dataNodeLogicType>([
const query = overrideQuery ?? props.query
const refresh = props.alwaysRefresh || refreshArg

if (query.kind === NodeKind.HogQLQuery && !(query as HogQLQuery).query) {
return null
}

if (props.doNotLoad) {
return props.cachedResults
}
Expand Down
10 changes: 3 additions & 7 deletions frontend/src/scenes/data-warehouse/editor/QueryWindow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Monaco } from '@monaco-editor/react'
import { Spinner } from '@posthog/lemon-ui'
import { BindLogic, useActions, useValues } from 'kea'
import { router } from 'kea-router'
import type { editor as importedEditor } from 'monaco-editor'
Expand Down Expand Up @@ -87,16 +86,13 @@ export function QueryWindow(): JSX.Element {
)
}

function InternalQueryWindow(): JSX.Element {
function InternalQueryWindow(): JSX.Element | null {
const { cacheLoading, sourceQuery, queryInput } = useValues(multitabEditorLogic)
const { setSourceQuery } = useActions(multitabEditorLogic)

// NOTE: hacky way to avoid flicker loading
if (cacheLoading) {
return (
<div className="flex-1 flex justify-center items-center">
<Spinner className="text-3xl" />
</div>
)
return null
}

const dataVisualizationLogicProps: DataVisualizationLogicProps = {
Expand Down

0 comments on commit 05ce85a

Please sign in to comment.