From 9fb1545d75cd9150d1b8eb64e686bd5ceb2aa626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Oberm=C3=BCller?= Date: Wed, 8 Nov 2023 16:55:23 +0000 Subject: [PATCH] Revert "fix(insights): fix insights display configs in notebooks" (#18491) Revert "fix(insights): fix insights display configs in notebooks (#18456)" This reverts commit ccd53c1b71419c773f570b9ff60e84a593b765ed. --- frontend/src/scenes/insights/insightDataLogic.ts | 11 +++++++++-- .../src/scenes/notebooks/Nodes/NotebookNodeQuery.tsx | 3 +-- 2 files changed, 10 insertions(+), 4 deletions(-) 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 }