Skip to content

Commit

Permalink
Enhance IncidentView component with HeaderAlert for date display and …
Browse files Browse the repository at this point in the history
…improve metrics card layout
  • Loading branch information
simlarsen committed Dec 16, 2024
1 parent 4dd6b5f commit 56f79a9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Dashboard/src/Pages/Incidents/View/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ import TraceTable from "../../../Components/Traces/TraceTable";
import { TelemetryQuery } from "Common/Types/Telemetry/TelemetryQuery";
import MetricView from "../../../Components/Metrics/MetricView";
import MetricViewData from "Common/Types/Metrics/MetricViewData";
import IconProp from "Common/Types/Icon/IconProp";
import HeaderAlert, { HeaderAlertType } from "Common/UI/Components/HeaderAlert/HeaderAlert";
import ColorSwatch from "Common/Types/ColorSwatch";

const IncidentView: FunctionComponent<
PageComponentProps
Expand Down Expand Up @@ -716,7 +719,16 @@ const IncidentView: FunctionComponent<
{telemetryQuery &&
telemetryQuery.telemetryType === TelemetryType.Metric &&
telemetryQuery.metricViewData && (
<Card title={"Metrics"} description={"Metrics for this incident."}>
<Card title={"Metrics"} description={"Metrics for this incident."} rightElement={telemetryQuery.metricViewData.startAndEndDate ? <HeaderAlert
icon={IconProp.Clock}
onClick={() => {
// do nothing!
}}
title={OneUptimeDate.getInBetweenDatesAsFormattedString(telemetryQuery.metricViewData.startAndEndDate)}
alertType={HeaderAlertType.INFO}
colorSwatch={ColorSwatch.Blue}
/> : <></>
}>
<MetricView
data={telemetryQuery.metricViewData}
hideQueryElements={true}
Expand Down

0 comments on commit 56f79a9

Please sign in to comment.