Skip to content

Commit

Permalink
feat: show recipient in notification send history table
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Dec 19, 2024
1 parent 0616d55 commit 9544346
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ middleware.ts
/blob-report/
/playwright/.cache/
.bin/

.envrc
default.nix
1 change: 1 addition & 0 deletions src/api/types/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export type NotificationSendHistory = {
first_observed: string;
source_event: string;
resource_id: string;
playbook_run_id?: string;
person_id?: string | undefined;
error?: string | undefined;
duration_millis?: number | undefined;
Expand Down
21 changes: 19 additions & 2 deletions src/components/Notifications/NotificationSendHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const notificationSendHistoryColumns: MRT_ColumnDef<NotificationSendHistoryApiRe
{
header: "Age",
accessorKey: "created_at",
size: 100,
size: 40,
Cell: ({ row }) => {
const dateString = row.original.created_at;
const count = row.original.count;
Expand All @@ -32,7 +32,7 @@ const notificationSendHistoryColumns: MRT_ColumnDef<NotificationSendHistoryApiRe
},
{
header: "Resource",
size: 300,
size: 250,
Cell: ({ row }) => {
return (
<div
Expand All @@ -59,6 +59,23 @@ const notificationSendHistoryColumns: MRT_ColumnDef<NotificationSendHistoryApiRe
const sourceEvent = row.original.source_event;
return <span>{sourceEvent}</span>;
}
},
{
header: "Recipient",
size: 200,
Cell: ({ row }) => {
const { playbook_run_id, person_id } = row.original;

const recipient = playbook_run_id
? `playbook/${playbook_run_id}`
: person_id
? `person/${person_id}`
: "";

// TODO: use a proper component.
// show connection recipient but the backend doesn't currently store that.
return <span>{recipient}</span>;
}
}
// {
// header: "Body",
Expand Down

0 comments on commit 9544346

Please sign in to comment.