Skip to content

Commit

Permalink
Merge pull request #368 from PagerDuty/pd_cef_fields
Browse files Browse the repository at this point in the history
  • Loading branch information
gsreynolds authored Dec 5, 2023
2 parents 80439b9 + 8967906 commit 62b3ff2
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/config/column-generator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,32 @@ export const defaultAlertsColumns = () => [
minWidth: 100,
renderer: renderPlainTextAlertCell,
}),
incidentColumn({
id: 'client',
header: 'Client',
columnType: 'alert',
accessor: (incident) => incident.alerts?.[0]?.body?.cef_details?.client || '',
minWidth: 100,
renderer: ({
value, cell,
}) => {
if (value.length > 0) {
return renderLinkCell({
text: value,
href: cell.row.original.alerts?.[0]?.body?.cef_details?.client_url || cell.row.original.html_url,
});
}
return renderPlainTextAlertCell({ value, cell });
},
}),
incidentColumn({
id: 'creation_time',
header: 'Timestamp',
columnType: 'alert',
accessor: (incident) => incident.alerts?.[0]?.body?.cef_details?.creation_time || '',
minWidth: 100,
renderer: renderPlainTextAlertCell,
}),
];

export const customAlertColumnForSavedColumn = (savedColumn) => {
Expand Down

0 comments on commit 62b3ff2

Please sign in to comment.