add severity column

This commit is contained in:
Simon Larsen
2023-03-02 15:12:37 +00:00
parent 10fbf789b2
commit fd533c778e

View File

@@ -211,6 +211,50 @@ const MonitorIncidents: FunctionComponent<PageComponentProps> = (
return <></>;
},
},
{
field: {
incidentSeverity: {
name: true,
color: true,
},
},
isFilterable: true,
filterEntityType: IncidentSeverity,
filterQuery: {
projectId:
DashboardNavigation.getProjectId()?.toString(),
},
filterDropdownField: {
label: 'name',
value: '_id',
},
title: 'Severity',
type: FieldType.Entity,
getElement: (item: JSONObject): ReactElement => {
if (item['incidentSeverity']) {
return (
<Pill
color={
(
item[
'incidentSeverity'
] as JSONObject
)['color'] as Color
}
text={
(
item[
'incidentSeverity'
] as JSONObject
)['name'] as string
}
/>
);
}
return <></>;
},
},
{
field: {
monitors: {