diff --git a/frontend/src/lib/components/CommandPalette/commandPaletteLogic.tsx b/frontend/src/lib/components/CommandPalette/commandPaletteLogic.tsx index b6be6e7961e8b..285d1baa5c51d 100644 --- a/frontend/src/lib/components/CommandPalette/commandPaletteLogic.tsx +++ b/frontend/src/lib/components/CommandPalette/commandPaletteLogic.tsx @@ -246,7 +246,7 @@ export const commandPaletteLogic = kea({ display: `View person ${input}`, executor: () => { const { push } = router.actions - push(urls.person(person.distinct_ids[0])) + push(urls.personByDistinctId(person.distinct_ids[0])) }, }, ], diff --git a/frontend/src/lib/components/UniversalSearch/UniversalSearchPopover.tsx b/frontend/src/lib/components/UniversalSearch/UniversalSearchPopover.tsx index f30336b7bb5a2..cbacb2ef845b3 100644 --- a/frontend/src/lib/components/UniversalSearch/UniversalSearchPopover.tsx +++ b/frontend/src/lib/components/UniversalSearch/UniversalSearchPopover.tsx @@ -91,7 +91,7 @@ function redirectOnSelectItems( } else if (groupType === TaxonomicFilterGroupType.Cohorts) { router.actions.push(urls.cohort(value)) } else if (groupType === TaxonomicFilterGroupType.Persons) { - router.actions.push(urls.person(String(value))) + router.actions.push(urls.personByDistinctId(String(value))) } else if (groupType.startsWith(TaxonomicFilterGroupType.GroupNamesPrefix)) { router.actions.push(urls.group((item as Group).group_type_index, String(value))) } else if (groupType === TaxonomicFilterGroupType.Insights) { diff --git a/frontend/src/queries/nodes/DataTable/renderColumn.tsx b/frontend/src/queries/nodes/DataTable/renderColumn.tsx index 62530d88d8ee7..88b749007301e 100644 --- a/frontend/src/queries/nodes/DataTable/renderColumn.tsx +++ b/frontend/src/queries/nodes/DataTable/renderColumn.tsx @@ -205,7 +205,7 @@ export function renderColumn( } else if (key === 'person' && isPersonsNode(query.source)) { const personRecord = record as PersonType return ( - + ) diff --git a/frontend/src/scenes/appScenes.ts b/frontend/src/scenes/appScenes.ts index 6a9a72da9994a..08e3d86ff793a 100644 --- a/frontend/src/scenes/appScenes.ts +++ b/frontend/src/scenes/appScenes.ts @@ -26,7 +26,7 @@ export const appScenes: Record any> = { [Scene.Replay]: () => import('./session-recordings/SessionRecordings'), [Scene.ReplaySingle]: () => import('./session-recordings/detail/SessionRecordingDetail'), [Scene.ReplayPlaylist]: () => import('./session-recordings/playlist/SessionRecordingsPlaylistScene'), - [Scene.Person]: () => import('./persons/Person'), + [Scene.Person]: () => import('./persons/PersonScene'), [Scene.Persons]: () => import('./persons/PersonsScene'), [Scene.Groups]: () => import('./groups/Groups'), [Scene.Group]: () => import('./groups/Group'), diff --git a/frontend/src/scenes/data-management/ingestion-warnings/IngestionWarningsView.tsx b/frontend/src/scenes/data-management/ingestion-warnings/IngestionWarningsView.tsx index ff79be8e258f8..b7c4abb20d8c2 100644 --- a/frontend/src/scenes/data-management/ingestion-warnings/IngestionWarningsView.tsx +++ b/frontend/src/scenes/data-management/ingestion-warnings/IngestionWarningsView.tsx @@ -36,9 +36,14 @@ const WARNING_TYPE_RENDERER = { return ( <> Refused to merge already identified person{' '} - {details.sourcePersonDistinctId} into{' '} - {details.targetPersonDistinctId} via an - $identify or $create_alias call (event uuid: {details.eventUuid}). + + {details.sourcePersonDistinctId} + {' '} + into{' '} + + {details.targetPersonDistinctId} + {' '} + via an $identify or $create_alias call (event uuid: {details.eventUuid}). ) }, @@ -51,9 +56,9 @@ const WARNING_TYPE_RENDERER = { return ( <> Refused to merge an illegal distinct_id{' '} - {details.illegalDistinctId} with{' '} - {details.otherDistinctId} via an $identify or - $create_alias call (event uuid: {details.eventUuid}). + {details.illegalDistinctId} with{' '} + {details.otherDistinctId} via an + $identify or $create_alias call (event uuid: {details.eventUuid}). ) }, @@ -116,8 +121,8 @@ const WARNING_TYPE_RENDERER = { return ( <> Event ingestion has overflowed capacity for distinct_id{' '} - {details.overflowDistinctId}. Events will - still be processed, but are likely to be delayed longer than usual. + {details.overflowDistinctId}. + Events will still be processed, but are likely to be delayed longer than usual. ) }, diff --git a/frontend/src/scenes/notebooks/Nodes/NotebookNodeBacklink.tsx b/frontend/src/scenes/notebooks/Nodes/NotebookNodeBacklink.tsx index 154600a7e1d3f..fa8a0b818484c 100644 --- a/frontend/src/scenes/notebooks/Nodes/NotebookNodeBacklink.tsx +++ b/frontend/src/scenes/notebooks/Nodes/NotebookNodeBacklink.tsx @@ -68,7 +68,7 @@ function backlinkHref(id: string, type: TaxonomicFilterGroupType): string { } else if (type === TaxonomicFilterGroupType.Cohorts) { return urls.cohort(id) } else if (type === TaxonomicFilterGroupType.Persons) { - return urls.person(id) + return urls.personByDistinctId(id) } else if (type === TaxonomicFilterGroupType.Insights) { return urls.insightView(id as InsightModel['short_id']) } else if (type === TaxonomicFilterGroupType.FeatureFlags) { diff --git a/frontend/src/scenes/notebooks/Nodes/NotebookNodePerson.tsx b/frontend/src/scenes/notebooks/Nodes/NotebookNodePerson.tsx index a1f22aa53a15a..ba9270a42d3f6 100644 --- a/frontend/src/scenes/notebooks/Nodes/NotebookNodePerson.tsx +++ b/frontend/src/scenes/notebooks/Nodes/NotebookNodePerson.tsx @@ -94,13 +94,13 @@ export const NotebookNodePerson = createPostHogWidgetNode urls.person(attrs.id), + href: (attrs) => urls.personByDistinctId(attrs.id), resizeable: true, attributes: { id: {}, }, pasteOptions: { - find: urls.person('(.+)', false), + find: urls.personByDistinctId('(.+)', false), getAttributes: async (match) => { return { id: match[1] } }, diff --git a/frontend/src/scenes/persons/PersonPreview.tsx b/frontend/src/scenes/persons/PersonPreview.tsx index db68be06e921f..7b9e61fe377aa 100644 --- a/frontend/src/scenes/persons/PersonPreview.tsx +++ b/frontend/src/scenes/persons/PersonPreview.tsx @@ -32,7 +32,7 @@ export function PersonPreview(props: PersonPreviewProps): JSX.Element | null { } const display = asDisplay(person) - const url = urls.person(person?.distinct_ids[0]) + const url = urls.personByDistinctId(person?.distinct_ids[0]) return (
@@ -51,7 +51,11 @@ export function PersonPreview(props: PersonPreviewProps): JSX.Element | null { onNotebookOpened={() => props.onClose?.()} size="small" /> - } to={urls.person(person?.distinct_ids[0])} /> + } + to={urls.personByDistinctId(person?.distinct_ids[0])} + />
diff --git a/frontend/src/scenes/persons/Person.tsx b/frontend/src/scenes/persons/PersonScene.tsx similarity index 98% rename from frontend/src/scenes/persons/Person.tsx rename to frontend/src/scenes/persons/PersonScene.tsx index 73c14145d77a0..e6c7a1036bc05 100644 --- a/frontend/src/scenes/persons/Person.tsx +++ b/frontend/src/scenes/persons/PersonScene.tsx @@ -36,7 +36,7 @@ import { PersonDashboard } from './PersonDashboard' import { NotebookSelectButton } from 'scenes/notebooks/NotebookSelectButton/NotebookSelectButton' export const scene: SceneExport = { - component: Person, + component: PersonScene, logic: personsLogic, paramsToProps: ({ params: { _: rawUrlId } }): (typeof personsLogic)['props'] => ({ syncWithUrl: true, @@ -106,7 +106,7 @@ function PersonCaption({ person }: { person: PersonType }): JSX.Element { ) } -export function Person(): JSX.Element | null { +export function PersonScene(): JSX.Element | null { const { showCustomerSuccessDashboards, person, @@ -127,7 +127,7 @@ export function Person(): JSX.Element | null { return personLoading ? : } - const url = urls.person(urlId || person.distinct_ids[0] || String(person.id)) + const url = urls.personByDistinctId(urlId || person.distinct_ids[0] || String(person.id)) return ( <> diff --git a/frontend/src/scenes/persons/activityDescriptions.tsx b/frontend/src/scenes/persons/activityDescriptions.tsx index f6e13f0d0d921..f11568827c9dd 100644 --- a/frontend/src/scenes/persons/activityDescriptions.tsx +++ b/frontend/src/scenes/persons/activityDescriptions.tsx @@ -68,7 +68,7 @@ export function personActivityDescriber(logItem: ActivityLogItem): HumanizedChan } listParts={distinctIds.map((di) => ( - {di} + {di} ))} /> diff --git a/frontend/src/scenes/persons/person-utils.test.ts b/frontend/src/scenes/persons/person-utils.test.ts index c4cb7777b9572..2baca39945f4b 100644 --- a/frontend/src/scenes/persons/person-utils.test.ts +++ b/frontend/src/scenes/persons/person-utils.test.ts @@ -6,10 +6,10 @@ import { asLink, asDisplay } from './person-utils' describe('the person header', () => { describe('linking to a person', () => { const personLinksTestCases = [ - { distinctIds: ['a uuid'], expectedLink: urls.person('a uuid'), name: 'with one id' }, + { distinctIds: ['a uuid'], expectedLink: urls.personByDistinctId('a uuid'), name: 'with one id' }, { distinctIds: ['the first uuid', 'a uuid'], - expectedLink: urls.person('the first uuid'), + expectedLink: urls.personByDistinctId('the first uuid'), name: 'with more than one id', }, { @@ -19,7 +19,7 @@ describe('the person header', () => { }, { distinctIds: ['a+dicey/@!'], - expectedLink: urls.person('a+dicey/@!'), + expectedLink: urls.personByDistinctId('a+dicey/@!'), name: 'with no ids', }, ] diff --git a/frontend/src/scenes/persons/person-utils.ts b/frontend/src/scenes/persons/person-utils.ts index c1f9dc63b11d9..35928473b08be 100644 --- a/frontend/src/scenes/persons/person-utils.ts +++ b/frontend/src/scenes/persons/person-utils.ts @@ -60,7 +60,7 @@ export function asDisplay(person: PersonPropType | null | undefined, maxLength?: export const asLink = (person?: PersonPropType | null): string | undefined => person?.distinct_id - ? urls.person(person.distinct_id) + ? urls.personByDistinctId(person.distinct_id) : person?.distinct_ids?.length - ? urls.person(person.distinct_ids[0]) + ? urls.personByDistinctId(person.distinct_ids[0]) : undefined diff --git a/frontend/src/scenes/project-homepage/NewlySeenPersons.tsx b/frontend/src/scenes/project-homepage/NewlySeenPersons.tsx index 7b68fc572dc75..0aea88331c5e3 100644 --- a/frontend/src/scenes/project-homepage/NewlySeenPersons.tsx +++ b/frontend/src/scenes/project-homepage/NewlySeenPersons.tsx @@ -17,7 +17,7 @@ function PersonRow({ person }: { person: PersonType }): JSX.Element { return ( } diff --git a/frontend/src/scenes/retention/RetentionModal.tsx b/frontend/src/scenes/retention/RetentionModal.tsx index c53514f1444e3..b47409b554953 100644 --- a/frontend/src/scenes/retention/RetentionModal.tsx +++ b/frontend/src/scenes/retention/RetentionModal.tsx @@ -110,7 +110,9 @@ export function RetentionModal(): JSX.Element | null { ) : ( {asDisplay(personAppearances.person)} diff --git a/frontend/src/scenes/scenes.ts b/frontend/src/scenes/scenes.ts index fc68124512e44..de3cf70b00df7 100644 --- a/frontend/src/scenes/scenes.ts +++ b/frontend/src/scenes/scenes.ts @@ -415,7 +415,7 @@ export const routes: Record = { }, {} as Record), [urls.replaySingle(':id')]: Scene.ReplaySingle, [urls.replayPlaylist(':id')]: Scene.ReplayPlaylist, - [urls.person('*', false)]: Scene.Person, + [urls.personByDistinctId('*', false)]: Scene.Person, [urls.persons()]: Scene.Persons, [urls.groups(':groupTypeIndex')]: Scene.Groups, [urls.group(':groupTypeIndex', ':groupKey', false)]: Scene.Group, diff --git a/frontend/src/scenes/urls.ts b/frontend/src/scenes/urls.ts index 789e0d4340978..1625a1cebc715 100644 --- a/frontend/src/scenes/urls.ts +++ b/frontend/src/scenes/urls.ts @@ -88,7 +88,7 @@ export const urls = { combineUrl(`/replay/playlists/${id}`, filters ? { filters } : {}).url, replaySingle: (id: string, filters?: Partial): string => combineUrl(`/replay/${id}`, filters ? { filters } : {}).url, - person: (id: string, encode: boolean = true): string => + personByDistinctId: (id: string, encode: boolean = true): string => encode ? `/person/${encodeURIComponent(id)}` : `/person/${id}`, persons: (): string => '/persons', groups: (groupTypeIndex: string | number): string => `/groups/${groupTypeIndex}`,