diff --git a/frontend/src/lib/components/CommandPalette/commandPaletteLogic.tsx b/frontend/src/lib/components/CommandPalette/commandPaletteLogic.tsx index b6be6e7961e8b..8afea17e7a639 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.personDistinctId(person.distinct_ids[0])) }, }, ], diff --git a/frontend/src/lib/components/UniversalSearch/UniversalSearchPopover.tsx b/frontend/src/lib/components/UniversalSearch/UniversalSearchPopover.tsx index f30336b7bb5a2..6784cf0e30e5b 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.personDistinctId(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..9b43efe3dec96 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..42702b26752e4 100644 --- a/frontend/src/scenes/data-management/ingestion-warnings/IngestionWarningsView.tsx +++ b/frontend/src/scenes/data-management/ingestion-warnings/IngestionWarningsView.tsx @@ -36,9 +36,10 @@ 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 +52,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 +117,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..be439a0a4f184 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.personDistinctId(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..f653730c70e9c 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.personDistinctId(attrs.id), resizeable: true, attributes: { id: {}, }, pasteOptions: { - find: urls.person('(.+)', false), + find: urls.personDistinctId('(.+)', 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..94ce122999243 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.personDistinctId(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.personDistinctId(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..10717c1226ab6 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.personDistinctId(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..f8dd95127a9d9 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..8ef3525afd219 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.personDistinctId('a uuid'), name: 'with one id' }, { distinctIds: ['the first uuid', 'a uuid'], - expectedLink: urls.person('the first uuid'), + expectedLink: urls.personDistinctId('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.personDistinctId('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..74208b4079fa3 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.personDistinctId(person.distinct_id) : person?.distinct_ids?.length - ? urls.person(person.distinct_ids[0]) + ? urls.personDistinctId(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..221d7938549c4 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..621f7da33fcde 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..c4f53aba7d683 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.personDistinctId('*', 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..c743634000c68 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 => + personDistinctId: (id: string, encode: boolean = true): string => encode ? `/person/${encodeURIComponent(id)}` : `/person/${id}`, persons: (): string => '/persons', groups: (groupTypeIndex: string | number): string => `/groups/${groupTypeIndex}`,