fix: sorter is updated for sorting in alerts page (#2818)

This commit is contained in:
Palash Gupta 2023-06-05 12:13:24 +05:30 committed by GitHub
parent c69e2e0d50
commit 9091b9b82c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,9 +100,12 @@ function ListAlert({ allAlertRules, refetch }: ListAlertProps): JSX.Element {
dataIndex: 'alert',
width: 100,
key: 'name',
sorter: (a, b): number =>
(a.alert ? a.alert.charCodeAt(0) : 1000) -
(b.alert ? b.alert.charCodeAt(0) : 1000),
sorter: (alertA, alertB): number => {
if (alertA.alert && alertB.alert) {
return alertA.alert.localeCompare(alertB.alert);
}
return 0;
},
render: (value, record): JSX.Element => (
<Typography.Link onClick={(): void => onEditHandler(record)}>
{value}