-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web-analytics): Add a error tracking tile to web analytics (#24273)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
1c58b49
commit 037509e
Showing
13 changed files
with
134 additions
and
10 deletions.
There are no files selected for viewing
Binary file modified
BIN
-13.9 KB
(94%)
frontend/__snapshots__/components-cards-insight-card--query-insight-card--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2 Bytes
(100%)
frontend/__snapshots__/exporter-exporter--user-paths-insight--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+295 Bytes
(100%)
frontend/__snapshots__/scenes-app-errortracking--list-page--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+290 Bytes
(100%)
frontend/__snapshots__/scenes-app-errortracking--list-page--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
frontend/src/scenes/web-analytics/tiles/WebAnalyticsErrorTracking.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import clsx from 'clsx' | ||
import { TZLabel } from 'lib/components/TZLabel' | ||
import { IconOpenInNew } from 'lib/lemon-ui/icons' | ||
import { LemonButton } from 'lib/lemon-ui/LemonButton' | ||
import { LemonTableLink } from 'lib/lemon-ui/LemonTable/LemonTableLink' | ||
import { urls } from 'scenes/urls' | ||
import { ErrorTrackingTile } from 'scenes/web-analytics/webAnalyticsLogic' | ||
|
||
import { QueryFeature } from '~/queries/nodes/DataTable/queryFeatures' | ||
import { Query } from '~/queries/Query/Query' | ||
import { ErrorTrackingGroup } from '~/queries/schema' | ||
import { QueryContext, QueryContextColumnComponent } from '~/queries/types' | ||
|
||
export const CustomGroupTitleColumn: QueryContextColumnComponent = (props) => { | ||
const record = props.record as ErrorTrackingGroup | ||
|
||
return ( | ||
<div className="flex items-start space-x-1.5 group"> | ||
<LemonTableLink | ||
title={record.exception_type || record.fingerprint} | ||
description={ | ||
<div className="space-y-1"> | ||
<div className="line-clamp-1">{record.description}</div> | ||
<div className="space-x-1"> | ||
<TZLabel time={record.last_seen} className="border-dotted border-b" /> | ||
</div> | ||
</div> | ||
} | ||
className="flex-1" | ||
to={urls.errorTrackingGroup(record.fingerprint)} | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
const context: QueryContext = { | ||
extraDataTableQueryFeatures: [QueryFeature.hideLoadNextButton], | ||
showOpenEditorButton: false, | ||
showQueryEditor: false, | ||
columns: { | ||
error: { | ||
width: '50%', | ||
render: CustomGroupTitleColumn, | ||
}, | ||
users: { | ||
align: 'right', | ||
}, | ||
occurrences: { | ||
align: 'right', | ||
}, | ||
}, | ||
} | ||
|
||
export const WebAnalyticsErrorTrackingTile = ({ tile }: { tile: ErrorTrackingTile }): JSX.Element => { | ||
const { layout, query } = tile | ||
const to = urls.errorTracking() | ||
|
||
return ( | ||
<div | ||
className={clsx( | ||
'col-span-1 row-span-1 flex flex-col', | ||
layout.colSpanClassName ?? 'md:col-span-6', | ||
layout.rowSpanClassName ?? 'md:row-span-1', | ||
layout.orderWhenLargeClassName ?? 'xxl:order-12', | ||
layout.className | ||
)} | ||
> | ||
<h2 className="m-0 mb-3">Error tracking</h2> | ||
<div className="border rounded bg-bg-light flex-1 flex flex-col py-2 px-1"> | ||
<Query query={query} embedded={true} context={context} /> | ||
</div> | ||
<div className="flex flex-row-reverse my-2"> | ||
<LemonButton to={to} icon={<IconOpenInNew />} size="small" type="secondary"> | ||
View all | ||
</LemonButton> | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters