-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: saved insights settings in notebooks (#17373)
* support insight viz nodes in notebooks
- Loading branch information
Showing
9 changed files
with
141 additions
and
42 deletions.
There are no files selected for viewing
Binary file modified
BIN
+33 Bytes
(100%)
frontend/__snapshots__/scenes-app-surveys--survey-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
frontend/src/scenes/notebooks/Nodes/NotebookNodeQuery.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@import '../../../styles/mixins'; | ||
|
||
// Here we override based on NotebookNode the ph-query styling, so | ||
// as to not change the global styling. We need the extra nesting to ensure we | ||
// are more specific than the other insights css | ||
|
||
.NotebookNode.ph-query { | ||
.insights-graph-container { | ||
.ant-card-body { | ||
padding: 0; | ||
} | ||
|
||
.RetentionContainer { | ||
.LineGraph { | ||
position: relative; | ||
} | ||
} | ||
} | ||
|
||
.funnel-insights-container { | ||
&.non-empty-state { | ||
min-height: initial; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
frontend/src/scenes/notebooks/NotebookCommentButton/notebookCommentButtonLogic.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { actions, events, kea, key, listeners, path, props, reducers, selectors } from 'kea' | ||
import { loaders } from 'kea-loaders' | ||
import { NotebookListItemType, NotebookNodeType } from '~/types' | ||
|
||
import api from 'lib/api' | ||
|
||
import type { notebookCommentButtonLogicType } from './notebookCommentButtonLogicType' | ||
|
||
export interface NotebookCommentButtonProps { | ||
sessionRecordingId: string | ||
startVisible: boolean | ||
} | ||
|
||
export const notebookCommentButtonLogic = kea<notebookCommentButtonLogicType>([ | ||
path((key) => ['scenes', 'session-recordings', 'NotebookCommentButton', 'multiNotebookCommentButtonLogic', key]), | ||
props({} as NotebookCommentButtonProps), | ||
key((props) => props.sessionRecordingId || 'no recording id yet'), | ||
actions({ | ||
setShowPopover: (visible: boolean) => ({ visible }), | ||
setSearchQuery: (query: string) => ({ query }), | ||
loadContainingNotebooks: true, | ||
loadAllNotebooks: true, | ||
}), | ||
reducers(({ props }) => ({ | ||
searchQuery: [ | ||
'', | ||
{ | ||
setSearchQuery: (_, { query }) => query, | ||
}, | ||
], | ||
showPopover: [ | ||
props.startVisible, | ||
{ | ||
setShowPopover: (_, { visible }) => visible, | ||
}, | ||
], | ||
})), | ||
listeners(({ actions }) => ({ | ||
setSearchQuery: () => { | ||
actions.loadAllNotebooks() | ||
actions.loadContainingNotebooks() | ||
}, | ||
})), | ||
loaders(({ props, values }) => ({ | ||
allNotebooks: [ | ||
[] as NotebookListItemType[], | ||
{ | ||
loadAllNotebooks: async (_, breakpoint) => { | ||
breakpoint(100) | ||
const response = await api.notebooks.list(undefined, undefined, values.searchQuery ?? undefined) | ||
// TODO for simplicity we'll assume the results will fit into one page | ||
return response.results | ||
}, | ||
}, | ||
], | ||
containingNotebooks: [ | ||
[] as NotebookListItemType[], | ||
{ | ||
loadContainingNotebooks: async (_, breakpoint) => { | ||
breakpoint(100) | ||
const response = await api.notebooks.list( | ||
[{ type: NotebookNodeType.Recording, attrs: { id: props.sessionRecordingId } }], | ||
undefined, | ||
values.searchQuery ?? undefined | ||
) | ||
// TODO for simplicity we'll assume the results will fit into one page | ||
return response.results | ||
}, | ||
}, | ||
], | ||
})), | ||
events(({ actions }) => ({ | ||
afterMount: () => { | ||
actions.loadAllNotebooks() | ||
actions.loadContainingNotebooks() | ||
}, | ||
})), | ||
selectors(() => ({ | ||
notebooksLoading: [ | ||
(s) => [s.allNotebooksLoading, s.containingNotebooksLoading], | ||
(allNotebooksLoading, containingNotebooksLoading) => allNotebooksLoading || containingNotebooksLoading, | ||
], | ||
})), | ||
]) |
Binary file modified
BIN
-11.7 KB
(64%)
...-snapshots/Navigation-App-Page-With-Side-Bar-Hidden-Mobile-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.