diff --git a/frontend/src/scenes/insights/insightDataLogic.ts b/frontend/src/scenes/insights/insightDataLogic.ts index 153be0b0b27c3..e2ac23f175ed2 100644 --- a/frontend/src/scenes/insights/insightDataLogic.ts +++ b/frontend/src/scenes/insights/insightDataLogic.ts @@ -84,14 +84,21 @@ export const insightDataLogic = kea([ selectors({ query: [ - (s) => [s.filters, s.insight, s.internalQuery, s.filterTestAccountsDefault], - (filters, insight, internalQuery, filterTestAccountsDefault) => + (s) => [s.propsQuery, s.filters, s.insight, s.internalQuery, s.filterTestAccountsDefault], + (propsQuery, filters, insight, internalQuery, filterTestAccountsDefault) => + propsQuery || internalQuery || insight.query || (filters && filters.insight ? queryFromFilters(filters) : undefined) || queryFromKind(NodeKind.TrendsQuery, filterTestAccountsDefault), ], + propsQuery: [ + () => [(_, props) => props], + // overwrite query from props for standalone InsightVizNode queries + (props: InsightLogicProps) => (props.dashboardItemId?.startsWith('new-AdHoc.') ? props.query : null), + ], + isQueryBasedInsight: [ (s) => [s.query], (query) => { diff --git a/frontend/src/scenes/notebooks/Nodes/NotebookNodeQuery.tsx b/frontend/src/scenes/notebooks/Nodes/NotebookNodeQuery.tsx index 9b262bc694125..e5579e7c4fd42 100644 --- a/frontend/src/scenes/notebooks/Nodes/NotebookNodeQuery.tsx +++ b/frontend/src/scenes/notebooks/Nodes/NotebookNodeQuery.tsx @@ -88,7 +88,7 @@ const Component = ({ attributes }: NotebookNodeProps - + ) } @@ -127,7 +127,6 @@ export const Settings = ({ if (NodeKind.InsightVizNode === modifiedQuery.kind || NodeKind.SavedInsightNode === modifiedQuery.kind) { modifiedQuery.showFilters = true - modifiedQuery.showHeader = true modifiedQuery.showResults = false modifiedQuery.embedded = true }