File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
frontend/src/scenes/notebooks Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import { urls } from 'scenes/urls'
1919
2020import { FilterType , RecordingUniversalFilters , ReplayTabs } from '~/types'
2121
22+ import { notebookLogic } from '../Notebook/notebookLogic'
2223import { NotebookNodeAttributeProperties , NotebookNodeProps , NotebookNodeType } from '../types'
2324import { notebookNodeLogic } from './notebookNodeLogic'
2425
@@ -28,11 +29,13 @@ const Component = ({
2829} : NotebookNodeProps < NotebookNodePlaylistAttributes > ) : JSX . Element => {
2930 const { pinned, nodeId, universalFilters } = attributes
3031 const playerKey = `notebook-${ nodeId } `
32+ const { personUUIDFromCanvasOverride } = useValues ( notebookLogic )
3133
3234 const recordingPlaylistLogicProps : SessionRecordingPlaylistLogicProps = useMemo (
3335 ( ) => ( {
3436 logicKey : playerKey ,
3537 filters : universalFilters ,
38+ ...( personUUIDFromCanvasOverride ? { personUUID : personUUIDFromCanvasOverride } : { } ) ,
3639 updateSearchParams : false ,
3740 autoPlay : false ,
3841 onFiltersChange : ( newFilters ) => updateAttributes ( { universalFilters : newFilters } ) ,
Original file line number Diff line number Diff line change @@ -503,6 +503,17 @@ export const notebookLogic = kea<notebookLogicType>([
503503 return insightNodes ?. map ( ( node ) => node ?. attrs ?. query ?. shortId )
504504 } ,
505505 ] ,
506+
507+ personUUIDFromCanvasOverride : [
508+ ( ) => [ ( _ , props ) => props ] ,
509+ ( props : NotebookLogicProps ) : string | null => {
510+ if ( ! props . canvasFiltersOverride || props . canvasFiltersOverride . length === 0 ) {
511+ return null
512+ }
513+ return props . canvasFiltersOverride . find ( ( filter : AnyPropertyFilter ) => filter . key === 'person_id' )
514+ ?. value as string
515+ } ,
516+ ] ,
506517 } ) ,
507518 listeners ( ( { values, actions, cache } ) => ( {
508519 insertAfterLastNode : async ( { content } ) => {
You can’t perform that action at this time.
0 commit comments