From f487f088bd899ae6940653964c5858705ab3b1ab Mon Sep 17 00:00:00 2001 From: SagarRajput-7 <162284829+SagarRajput-7@users.noreply.github.com> Date: Wed, 28 May 2025 21:24:26 +0530 Subject: [PATCH] Revert "feat: improved the alert rules list search functionality" (#8085) * Revert "feat: improved the alert rules list search functionality (#8075)" This reverts commit bec52c3d3e3b95dc8ca72bda5c237b3e7b2d02dc. * feat: added search capability for labels * feat: added test cases --- .../container/ListAlertRules/ListAlert.tsx | 60 +------ .../ListAlertRules/__test__/utils.test.ts | 131 ++++++++++++++ .../src/container/ListAlertRules/styles.ts | 18 -- .../container/ListAlertRules/utils.test.ts | 162 ------------------ .../src/container/ListAlertRules/utils.ts | 111 ++---------- 5 files changed, 154 insertions(+), 328 deletions(-) create mode 100644 frontend/src/container/ListAlertRules/__test__/utils.test.ts delete mode 100644 frontend/src/container/ListAlertRules/utils.test.ts diff --git a/frontend/src/container/ListAlertRules/ListAlert.tsx b/frontend/src/container/ListAlertRules/ListAlert.tsx index 07db958916..0ad805ede8 100644 --- a/frontend/src/container/ListAlertRules/ListAlert.tsx +++ b/frontend/src/container/ListAlertRules/ListAlert.tsx @@ -1,6 +1,6 @@ /* eslint-disable react/display-name */ -import { InfoCircleOutlined, PlusOutlined } from '@ant-design/icons'; -import { Flex, Input, Tooltip, Typography } from 'antd'; +import { PlusOutlined } from '@ant-design/icons'; +import { Flex, Input, Typography } from 'antd'; import type { ColumnsType } from 'antd/es/table/interface'; import saveAlertApi from 'api/alerts/save'; import logEvent from 'api/common/logEvent'; @@ -175,41 +175,6 @@ function ListAlert({ allAlertRules, refetch }: ListAlertProps): JSX.Element { setData(filteredData); }); - const searchTooltipContent = ( -
-
Search Options:
-
- • Plain text: Search across all fields -
-
- • Key:value pairs: Specific field matching -
-
- • Multiple terms: All terms must match (AND logic) -
-
- • Status mapping: Use "ok" for inactive alerts -
-
Examples:
-
- • cpu warning - Find alerts with both "cpu" and - "warning" -
-
- • status:ok - Find alerts with OK status -
-
- • severity:critical - Find critical alerts -
-
- • cluster:prod - Find alerts with cluster=prod label -
-
- • status:ok cpu - Find OK alerts containing "cpu" -
-
- ); - const dynamicColumns: ColumnsType = [ { title: 'Created At', @@ -379,22 +344,11 @@ function ListAlert({ allAlertRules, refetch }: ListAlertProps): JSX.Element { return ( <> -
- - - - -
- - } - /> -
- + {addNewAlert && (