Skip to content

Commit d2180d2

Browse files
authored
feat(customers): Filter replay playlist by person UUID in person feed canvas (#42323)
1 parent c0dafbc commit d2180d2

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

frontend/src/scenes/notebooks/Nodes/NotebookNodePlaylist.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { urls } from 'scenes/urls'
1919

2020
import { FilterType, RecordingUniversalFilters, ReplayTabs } from '~/types'
2121

22+
import { notebookLogic } from '../Notebook/notebookLogic'
2223
import { NotebookNodeAttributeProperties, NotebookNodeProps, NotebookNodeType } from '../types'
2324
import { 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 }),

frontend/src/scenes/notebooks/Notebook/notebookLogic.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff 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 }) => {

0 commit comments

Comments
 (0)