Skip to content

Commit

Permalink
Revert "fix(insights): fix insights display configs in notebooks" (#1…
Browse files Browse the repository at this point in the history
…8491)

Revert "fix(insights): fix insights display configs in notebooks (#18456)"

This reverts commit ccd53c1.
  • Loading branch information
thmsobrmlr authored Nov 8, 2023
1 parent 0b0a29a commit 9fb1545
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 9 additions & 2 deletions frontend/src/scenes/insights/insightDataLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,21 @@ export const insightDataLogic = kea<insightDataLogicType>([

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) => {
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/scenes/notebooks/Nodes/NotebookNodeQuery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const Component = ({ attributes }: NotebookNodeProps<NotebookNodeQueryAttributes
<div
className={clsx('flex flex-1 flex-col', NodeKind.DataTableNode === modifiedQuery.kind && 'overflow-hidden')}
>
<Query query={modifiedQuery} uniqueKey={nodeId} />
<Query query={modifiedQuery} uniqueKey={nodeId} readOnly={true} />
</div>
)
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 9fb1545

Please sign in to comment.