Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error in recordings table #6598

Merged
merged 3 commits into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/src/scenes/events/EventsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ export function EventsTable({ fixedFilters, filtersEnabled = true, pageKey }: Ev
}
return showLinkToPerson && event.person?.distinct_ids?.length ? (
<Link to={`/person/${encodeURIComponent(event.person.distinct_ids[0])}`}>
<PersonHeader person={event.person} />
<PersonHeader withIcon person={event.person} />
</Link>
) : (
<PersonHeader person={event.person} />
<PersonHeader withIcon person={event.person} />
)
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function EventsTableSnippet(): JSX.Element {
title: 'Person',
key: 'person',
render: function renderPerson({ person }: { person: PersonType }) {
return person ? <PersonHeader person={person} /> : { props: { colSpan: 0 } }
return person ? <PersonHeader withIcon person={person} /> : { props: { colSpan: 0 } }
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/persons/Person.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export function Person(): JSX.Element {
<Card className="card-elevated person-detail" data-test-person-details>
{person && (
<>
<PersonHeader person={person} />
<PersonHeader withIcon person={person} />
<div className="item-group">
<label>IDs</label>
<div style={{ display: 'flex' }}>
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/scenes/persons/PersonHeader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
color: $purple_700;
}
}

&:hover {
text-decoration: underline;
}
}
2 changes: 1 addition & 1 deletion frontend/src/scenes/persons/PersonsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function PersonsTable({
key: 'identification',
span: 6,
render: function Render(person: PersonType) {
return <PersonHeader person={person} />
return <PersonHeader withIcon person={person} />
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function SessionRecordingsTable({ personUUID, isPersonPage = false }: Ses
title: 'Person',
key: 'person',
render: function RenderPersonLink(sessionRecording: SessionRecordingType) {
return <PersonHeader person={sessionRecording.person} />
return <PersonHeader withIcon person={sessionRecording.person} />
},
ellipsis: true,
span: 3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export const sessionRecordingsTableLogic = kea<sessionRecordingsTableLogicType<P
}
},

urlToAction: ({ actions, values }) => {
urlToAction: ({ actions, values, props }) => {
const urlToAction = (_: any, params: Params): void => {
const nulledSessionRecordingId = params.sessionRecordingId ?? null
if (nulledSessionRecordingId !== values.sessionRecordingId) {
Expand Down Expand Up @@ -268,10 +268,9 @@ export const sessionRecordingsTableLogic = kea<sessionRecordingsTableLogicType<P
}
}
}

const urlPattern = props.personUUID ? '/person/*' : '/recordings'
return {
'/recordings': urlToAction,
'/person/*': urlToAction,
[urlPattern]: urlToAction,
}
},
})