Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: notebooks insight bugs #18483

Merged
merged 4 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions frontend/src/scenes/cohorts/CohortEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ export function CohortEdit({ id }: CohortLogicProps): JSX.Element {
type="secondary"
resource={{
type: NotebookNodeType.Cohort,
attrs: {
id,
},
attrs: { id },
}}
/>
)}
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/scenes/insights/InsightPageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,12 @@ export function InsightPageHeader({ insightLogicProps }: { insightLogicProps: In
<NotebookSelectButton
resource={{
type: NotebookNodeType.Query,
attrs: { id: insight.short_id },
attrs: {
query: {
kind: NodeKind.SavedInsightNode,
shortId: insight.short_id,
},
},
}}
type="secondary"
/>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/scenes/notebooks/Nodes/NotebookNodeQuery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const Component = ({ attributes }: NotebookNodeProps<NotebookNodeQueryAttributes
modifiedQuery.full = false
modifiedQuery.showHogQLEditor = false
modifiedQuery.embedded = true
modifiedQuery.showTimings = false
}

if (NodeKind.InsightVizNode === modifiedQuery.kind || NodeKind.SavedInsightNode === modifiedQuery.kind) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { NotebookListItemType, NotebookNodeResource } from '~/types'
import { NotebookListItemType, NotebookNodeResource, NotebookNodeType } from '~/types'

import api from 'lib/api'

Expand Down Expand Up @@ -69,7 +69,17 @@ export const notebookSelectButtonLogic = kea<notebookSelectButtonLogicType>([
}
const response = await api.notebooks.list(
props.resource && typeof props.resource !== 'boolean'
? [{ type: props.resource.type, attrs: { id: props.resource.attrs?.id } }]
? [
{
type: props.resource.type,
attrs: {
id:
props.resource.type === NotebookNodeType.Query
? props.resource.attrs.query.shortId
: props.resource.attrs.id,
},
},
]
: undefined,
undefined,
values.searchQuery ?? undefined
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/scenes/persons/PersonPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ export function PersonPreview(props: PersonPreviewProps): JSX.Element | null {

<NotebookSelectButton
resource={{
attrs: {
id: person?.distinct_ids[0],
},
type: NotebookNodeType.Person,
attrs: { id: person?.distinct_ids[0] },
}}
onNotebookOpened={() => props.onClose?.()}
size="small"
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/scenes/persons/PersonScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,8 @@ export function PersonScene(): JSX.Element | null {
<div className="flex gap-2">
<NotebookSelectButton
resource={{
attrs: {
id: person?.distinct_ids[0],
},
type: NotebookNodeType.Person,
attrs: { id: person?.distinct_ids[0] },
}}
type="secondary"
/>
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/scenes/session-recordings/SessionRecordings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@ export function SessionsRecordings(): JSX.Element {
<>
<NotebookSelectButton
resource={{
attrs: {
filters: filters,
},
type: NotebookNodeType.RecordingPlaylist,
attrs: { filters: filters },
}}
type="secondary"
/>
Expand Down
Loading