Skip to content

Commit c71d7c0

Browse files
DolevNedolevneshahargl
authored
fix: Adding speaker icon to a noisy alert (#5223)
Signed-off-by: DolevNe <[email protected]> Signed-off-by: Shahar Glazner <[email protected]> Co-authored-by: dolevne <[email protected]> Co-authored-by: Shahar Glazner <[email protected]>
1 parent bcce729 commit c71d7c0

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

keep-ui/app/(keep)/dashboard/widget-types/preset/widget-alerts-table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const WidgetAlertsTable: React.FC<WidgetAlertsTableProps> = ({
6767
renderHeader: () => <div className="min-w-4"></div>,
6868
renderValue: (alert: any) => (
6969
<Icon
70-
icon={getStatusIcon(alert.status)}
70+
icon={getStatusIcon(alert.status, alert.isNoisy)}
7171
size="sm"
7272
color={getStatusColor(alert.status)}
7373
className="!p-0"

keep-ui/shared/lib/status-utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,25 @@ import {
33
CheckCircleIcon,
44
CircleStackIcon,
55
PauseIcon,
6+
SpeakerWaveIcon,
67
} from "@heroicons/react/24/outline";
78
import { IoIosGitPullRequest } from "react-icons/io";
89

910
/**
1011
* Maps an alert/incident status string to the appropriate icon component
1112
*
1213
* @param status - The status string to convert to an icon
14+
* @param isNoisy - Whether the alert is noisy (optional)
1315
* @returns A React icon component based on the status
1416
*
1517
* @example
1618
* const AlertIcon = getStatusIcon("firing");
1719
* // Returns ExclamationCircleIcon
1820
*/
19-
export const getStatusIcon = (status: string) => {
21+
export const getStatusIcon = (status: string, isNoisy?: boolean) => {
2022
switch (status.toLowerCase()) {
2123
case "firing":
22-
return ExclamationCircleIcon;
24+
return isNoisy ? SpeakerWaveIcon : ExclamationCircleIcon;
2325
case "resolved":
2426
return CheckCircleIcon;
2527
case "acknowledged":

keep-ui/widgets/alerts-table/lib/alert-table-utils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ export const useAlertTableCols = (
453453
cell: (context) => (
454454
<div className="flex items-center justify-center">
455455
<Icon
456-
icon={getStatusIcon(context.getValue())}
456+
icon={getStatusIcon(context.getValue(), context.row.original.isNoisy)}
457457
size="sm"
458458
color={getStatusColor(context.getValue())}
459459
className="!p-0 h-32px w-32px"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "keep"
3-
version = "0.46.3"
3+
version = "0.46.4"
44
description = "Alerting. for developers, by developers."
55
authors = ["Keep Alerting LTD"]
66
packages = [{include = "keep"}]

0 commit comments

Comments
 (0)