Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

chore: consistent styling in edit alert v2 (#9645)

Amlan Kumar Nandyfd839ff1dbbd
diff --git a/frontend/src/pages/AlertDetails/AlertDetails.styles.scss b/frontend/src/pages/AlertDetails/AlertDetails.styles.scss
index 22ed56d6e1..8a49413fff 100644
--- a/frontend/src/pages/AlertDetails/AlertDetails.styles.scss
+++ b/frontend/src/pages/AlertDetails/AlertDetails.styles.scss
@@ -135,6 +135,62 @@
}
}
+.alert-details-v2 {
+ .alert-details__breadcrumb {
+ padding-left: 32px;
+ .breadcrumb-item {
+ font-size: 13px;
+ }
+ }
+
+ .alert-info {
+ margin-right: 16px;
+
+ .alert-info__action-buttons {
+ .alert-action-buttons {
+ .ant-btn {
+ font-size: 13px;
+ }
+ }
+ }
+ }
+
+ .divider {
+ display: none;
+ }
+
+ .tabs-and-filters {
+ .ant-tabs {
+ .ant-tabs-nav {
+ margin: 0 8px;
+ }
+
+ .ant-tabs-tab {
+ .ant-tabs-tab-btn {
+ border-radius: 2px;
+ border: 1px solid var(--bg-slate-400);
+ background: var(--bg-ink-400);
+ font-size: 13px;
+
+ &[aria-selected='true'] {
+ background: var(--bg-ink-500);
+ }
+ }
+ }
+
+ .ant-tabs-content-holder {
+ .ant-tabs-content {
+ .ant-tabs-tabpane {
+ .alert-history {
+ margin: 0 16px;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
.lightMode {
.alert-details {
&-tabs {
diff --git a/frontend/src/pages/AlertDetails/AlertDetails.tsx b/frontend/src/pages/AlertDetails/AlertDetails.tsx
index cebf97248f..11a1b04790 100644
--- a/frontend/src/pages/AlertDetails/AlertDetails.tsx
+++ b/frontend/src/pages/AlertDetails/AlertDetails.tsx
@@ -2,6 +2,7 @@ import './AlertDetails.styles.scss';
import { Breadcrumb, Button, Divider, Empty } from 'antd';
import logEvent from 'api/common/logEvent';
+import classNames from 'classnames';
import { Filters } from 'components/AlertDetailsFilters/Filters';
import RouteTab from 'components/RouteTab';
import Spinner from 'components/Spinner';
@@ -13,7 +14,10 @@ import { useEffect, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useLocation } from 'react-router-dom';
import { AlertTypes } from 'types/api/alerts/alertTypes';
-import { PostableAlertRuleV2 } from 'types/api/alerts/alertTypesV2';
+import {
+ NEW_ALERT_SCHEMA_VERSION,
+ PostableAlertRuleV2,
+} from 'types/api/alerts/alertTypesV2';
import AlertHeader from './AlertHeader/AlertHeader';
import { useGetAlertRuleDetails, useRouteTabUtils } from './hooks';
@@ -117,6 +121,8 @@ function AlertDetails(): JSX.Element {
}
};
+ const isV2Alert = alertRuleDetails?.schemaVersion === NEW_ALERT_SCHEMA_VERSION;
+
// Show spinner until we have alert data loaded
if (isLoading && !alertRuleDetails) {
return <Spinner />;
@@ -129,7 +135,9 @@ function AlertDetails(): JSX.Element {
initialAlertType={alertRuleDetails?.alertType as AlertTypes}
initialAlertState={initialAlertState}
>
- <div className="alert-details">
+ <div
+ className={classNames('alert-details', { 'alert-details-v2': isV2Alert })}
+ >
<Breadcrumb
className="alert-details__breadcrumb"
items={[
diff --git a/frontend/src/pages/AlertDetails/AlertHeader/ActionButtons/ActionButtons.tsx b/frontend/src/pages/AlertDetails/AlertHeader/ActionButtons/ActionButtons.tsx
index 8319e6c6b6..e1c8a1417f 100644
--- a/frontend/src/pages/AlertDetails/AlertHeader/ActionButtons/ActionButtons.tsx
+++ b/frontend/src/pages/AlertDetails/AlertHeader/ActionButtons/ActionButtons.tsx
@@ -25,6 +25,11 @@ const menuItemStyle: CSSProperties = {
letterSpacing: '0.14px',
};
+const menuItemStyleV2: CSSProperties = {
+ fontSize: '13px',
+ letterSpacing: '0.13px',
+};
+
function AlertActionButtons({
ruleId,
alertDetails,
@@ -63,6 +68,8 @@ function AlertActionButtons({
const isV2Alert = alertDetails.schemaVersion === NEW_ALERT_SCHEMA_VERSION;
+ const finalMenuItemStyle = isV2Alert ? menuItemStyleV2 : menuItemStyle;
+
const menuItems: MenuProps['items'] = [
...(!isV2Alert
? [
@@ -71,7 +78,7 @@ function AlertActionButtons({
label: 'Rename',
icon: <PenLine size={16} color={Color.BG_VANILLA_400} />,
onClick: handleRename,
- style: menuItemStyle,
+ style: finalMenuItemStyle,
},
]
: []),
@@ -80,7 +87,7 @@ function AlertActionButtons({
label: 'Duplicate',
icon: <Copy size={16} color={Color.BG_VANILLA_400} />,
onClick: handleAlertDuplicate,
- style: menuItemStyle,
+ style: finalMenuItemStyle,
},
{
key: 'delete-rule',
@@ -88,7 +95,7 @@ function AlertActionButtons({
icon: <Trash2 size={16} color={Color.BG_CHERRY_400} />,
onClick: handleAlertDelete,
style: {
- ...menuItemStyle,
+ ...finalMenuItemStyle,
color: Color.BG_CHERRY_400,
},
},