mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 14:06:12 +08:00
feat: sorting is updated (#1095)
This commit is contained in:
parent
f5009abca6
commit
ebf9316714
@ -71,7 +71,7 @@ function ListAlert({ allAlertRules, refetch }: ListAlertProps): JSX.Element {
|
||||
title: 'Alert Name',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
sorter: (a, b): number => a.name.length - b.name.length,
|
||||
sorter: (a, b): number => a.name.charCodeAt(0) - b.name.charCodeAt(0),
|
||||
},
|
||||
{
|
||||
title: 'Severity',
|
||||
@ -92,14 +92,6 @@ function ListAlert({ allAlertRules, refetch }: ListAlertProps): JSX.Element {
|
||||
dataIndex: 'labels',
|
||||
key: 'tags',
|
||||
align: 'center',
|
||||
sorter: (a, b): number => {
|
||||
const alength = Object.keys(a.labels).filter((e) => e !== 'severity')
|
||||
.length;
|
||||
const blength = Object.keys(b.labels).filter((e) => e !== 'severity')
|
||||
.length;
|
||||
|
||||
return blength - alength;
|
||||
},
|
||||
render: (value): JSX.Element => {
|
||||
const objectKeys = Object.keys(value);
|
||||
const withOutSeverityKeys = objectKeys.filter((e) => e !== 'severity');
|
||||
|
@ -31,7 +31,8 @@ function NoFilterTable({
|
||||
dataIndex: 'labels',
|
||||
key: 'alertName',
|
||||
sorter: (a, b): number =>
|
||||
(a.labels?.alertname?.length || 0) - (b.labels?.alertname?.length || 0),
|
||||
(a.labels?.alertname?.charCodeAt(0) || 0) -
|
||||
(b.labels?.alertname?.charCodeAt(0) || 0),
|
||||
render: (data): JSX.Element => {
|
||||
const name = data?.alertname || '';
|
||||
return <Typography>{name}</Typography>;
|
||||
|
Loading…
x
Reference in New Issue
Block a user