diff --git a/.changeset/metrics-charts-mv-badges-click-ui.md b/.changeset/metrics-charts-mv-badges-click-ui.md new file mode 100644 index 0000000000..4cdff1c60f --- /dev/null +++ b/.changeset/metrics-charts-mv-badges-click-ui.md @@ -0,0 +1,7 @@ +--- +'@hyperdx/app': patch +--- + +feat: use the click-ui `Badge` in the metric explorer, the chart series and +formula editors, the tile alert editor, the materialized view indicator and +modal, and the span kind in the row side panel. diff --git a/packages/app/src/components/DBEditTimeChartForm/ChartFormulaEditor.tsx b/packages/app/src/components/DBEditTimeChartForm/ChartFormulaEditor.tsx index b57d85b9a9..1387092fef 100644 --- a/packages/app/src/components/DBEditTimeChartForm/ChartFormulaEditor.tsx +++ b/packages/app/src/components/DBEditTimeChartForm/ChartFormulaEditor.tsx @@ -5,8 +5,9 @@ import { UseFormSetValue, useWatch, } from 'react-hook-form'; +import { Badge } from '@clickhouse/click-ui'; import { validateFormula } from '@hyperdx/common-utils/dist/core/formula'; -import { Badge, TextInput } from '@mantine/core'; +import { TextInput } from '@mantine/core'; import { useDisclosure } from '@mantine/hooks'; import { ChartSeriesControls } from '@/components/ChartEditor/ChartSeriesControls'; @@ -81,11 +82,7 @@ export function ChartFormulaEditor({ onSubmit={onSubmit} onRemove={onRemoveFormula} onOpenNumberFormat={openNumberFormat} - leadingSection={ - - Formula - - } + leadingSection={} /> - {indexToSeriesRef(index) ?? index + 1} - + /> ) : undefined } diff --git a/packages/app/src/components/DBEditTimeChartForm/TileAlertEditor.tsx b/packages/app/src/components/DBEditTimeChartForm/TileAlertEditor.tsx index b93f674a34..5b3c225464 100644 --- a/packages/app/src/components/DBEditTimeChartForm/TileAlertEditor.tsx +++ b/packages/app/src/components/DBEditTimeChartForm/TileAlertEditor.tsx @@ -4,6 +4,7 @@ import { UseFormSetValue, useWatch, } from 'react-hook-form'; +import { Badge } from '@clickhouse/click-ui'; import { formatTileAlertDisplayName } from '@hyperdx/common-utils/dist/alerts'; import { AlertThresholdType, @@ -12,7 +13,6 @@ import { import { ActionIcon, Alert, - Badge, Box, Group, NativeSelect, @@ -134,20 +134,21 @@ export function TileAlertEditor({ {error && ( - Invalid Query - + size="sm" + text="Invalid query" + state="danger" + style={{ marginLeft: 'var(--mantine-spacing-xs)' }} + /> )} {warning && ( - - Warning - + )} diff --git a/packages/app/src/components/DBRowSidePanel.tsx b/packages/app/src/components/DBRowSidePanel.tsx index 5fa0c2e465..cf0650612d 100644 --- a/packages/app/src/components/DBRowSidePanel.tsx +++ b/packages/app/src/components/DBRowSidePanel.tsx @@ -12,6 +12,7 @@ import { isString } from 'lodash'; import { ErrorBoundary, FallbackProps } from 'react-error-boundary'; import { useHotkeys } from 'react-hotkeys-hook'; import SqlString from 'sqlstring'; +import { Badge } from '@clickhouse/click-ui'; import { isLogSource, isTraceSource, @@ -23,7 +24,6 @@ import { import { BuilderChartConfigWithDateRange } from '@hyperdx/common-utils/dist/types'; import { ActionIcon, - Badge, Box, Button, CopyButton, @@ -978,9 +978,7 @@ export const DBRowSidePanelInner = ({ )} {sourceIsTrace && spanKindLabel && ( - - {spanKindLabel} - + )} {(sourceIsTrace ? traceId : showLogTraceActions) && ( <> diff --git a/packages/app/src/components/MaterializedViews/MVOptimizationIndicator.tsx b/packages/app/src/components/MaterializedViews/MVOptimizationIndicator.tsx index 47b6662388..e31bb2d2fb 100644 --- a/packages/app/src/components/MaterializedViews/MVOptimizationIndicator.tsx +++ b/packages/app/src/components/MaterializedViews/MVOptimizationIndicator.tsx @@ -1,10 +1,11 @@ import { useState } from 'react'; +import { Badge } from '@clickhouse/click-ui'; import { BuilderChartConfigWithOptDateRange, SourceKind, TSource, } from '@hyperdx/common-utils/dist/types'; -import { ActionIcon, Badge, Tooltip } from '@mantine/core'; +import { ActionIcon, Tooltip } from '@mantine/core'; import { IconBolt, IconBoltOff } from '@tabler/icons-react'; import { useMVOptimizationExplanation } from '@/hooks/useMVOptimizationExplanation'; @@ -22,10 +23,10 @@ function MVOptimizationIcon({ onClick: () => void; }) { return isInWarningState ? ( - + @@ -55,14 +56,13 @@ function MVOptimizationBadge({ }) { return ( - {isInWarningState ? 'Not Accelerated' : 'Accelerated'} - + /> ); } diff --git a/packages/app/src/components/MaterializedViews/MVOptimizationModal.tsx b/packages/app/src/components/MaterializedViews/MVOptimizationModal.tsx index b998ecad97..08457f1bfa 100644 --- a/packages/app/src/components/MaterializedViews/MVOptimizationModal.tsx +++ b/packages/app/src/components/MaterializedViews/MVOptimizationModal.tsx @@ -1,21 +1,11 @@ import { useMemo } from 'react'; +import { Badge } from '@clickhouse/click-ui'; import { MVOptimizationExplanation } from '@hyperdx/common-utils/dist/core/materializedViews'; import { MaterializedViewConfiguration } from '@hyperdx/common-utils/dist/types'; -import { - Accordion, - Alert, - Badge, - Group, - Modal, - Text, - Tooltip, -} from '@mantine/core'; +import { Accordion, Alert, Group, Modal, Text, Tooltip } from '@mantine/core'; import MVConfigSummary from './MVConfigSummary'; -const WARNING_COLOR = 'var(--color-bg-warning)'; -const SUCCESS_COLOR = 'var(--color-bg-success)'; - function mvConfigToKey(config: MaterializedViewConfiguration) { return `mv-${config.databaseName}-${config.tableName}`; } @@ -75,35 +65,38 @@ export default function MVOptimizationModal({ {isBeingUsedByOptimizedConfig ? ( - Active - + /> ) : hasErrors ? ( - Incompatible - + /> ) : explanation ? ( - Skipped - + /> ) : null} diff --git a/packages/app/src/components/MetricAttributeHelperPanel.tsx b/packages/app/src/components/MetricAttributeHelperPanel.tsx index 4923130681..08b982447e 100644 --- a/packages/app/src/components/MetricAttributeHelperPanel.tsx +++ b/packages/app/src/components/MetricAttributeHelperPanel.tsx @@ -1,7 +1,7 @@ import { useCallback, useMemo, useState } from 'react'; +import { Badge } from '@clickhouse/click-ui'; import { TMetricSource } from '@hyperdx/common-utils/dist/types'; import { - Badge, Box, Button, Collapse, @@ -237,9 +237,11 @@ export function AttributeValueList({ {attribute.name} - - {CATEGORY_LABELS[attribute.category]} - + {onAddToGroupBy && ( @@ -366,9 +368,7 @@ export function AttributeList({ {CATEGORY_LABELS[category]} - - {attrs.length} - + {attrs.map(attr => ( @@ -447,22 +447,28 @@ export function MetricAttributeHelperPanel({ Unit: - - {formatUnitDisplay(metricMetadata.unit)} - + )} {!!metricType && ( - - {metricKindLabel(metricType)} - + )} {attributeKeys.length > 0 && ( - - {attributeKeys.length} attributes - + )} {metricName} - - {METRIC_KIND_LABELS[metricType]} - + @@ -159,9 +162,7 @@ function MetricDetail({ Tags {attributeKeys.length > 0 && ( - - {attributeKeys.length} - + )}