fix remaining type issues
This commit is contained in:
1 parent
9583332852
commit
ce568424a3
13 files changed
+108
-40
No files matched your search
@@ -17,7 +17,7 @@ import { BaseBox } from "@/components/design-elements";
|
||||
import { useAppSelector } from "@/hooks/AppHooks";
|
||||
import { formatDateWithTz, tooltipDateFormatLookup } from "@/utils/TimeUtils";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import type { GroupedCheck } from "@/types/check";
|
||||
import type { AggregateCheck } from "@/types/check";
|
||||
export const BarDockerCount = ({
|
||||
data,
|
||||
dataKey,
|
||||
@@ -25,7 +25,7 @@ export const BarDockerCount = ({
|
||||
title,
|
||||
emptyText,
|
||||
}: {
|
||||
data: GroupedCheck[];
|
||||
data: AggregateCheck[];
|
||||
dataKey: string;
|
||||
range: string;
|
||||
title: string;
|
||||
@@ -89,7 +89,7 @@ export const BarDockerCount = ({
|
||||
vertical={false}
|
||||
/>
|
||||
<XAxis
|
||||
dataKey={"_id"}
|
||||
dataKey={"bucketDate"}
|
||||
tick={(props) => <XTick {...props} range={range} />}
|
||||
/>
|
||||
<YAxis
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
tooltipDateFormatLookup,
|
||||
} from "@/utils/TimeUtils";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import type { GroupedCheck } from "@/types/check";
|
||||
import type { AggregateCheck } from "@/types/check";
|
||||
import { useAppSelector } from "@/hooks/AppHooks";
|
||||
|
||||
type XTickProps = {
|
||||
@@ -33,7 +33,6 @@ export const XTick = ({ x, y, payload, range }: XTickProps) => {
|
||||
const format = tickDateFormatLookup(range);
|
||||
const theme = useTheme();
|
||||
const uiTimezone = useAppSelector((state: any) => state.ui.timezone);
|
||||
console.log(payload);
|
||||
return (
|
||||
<Text
|
||||
x={x}
|
||||
@@ -85,7 +84,7 @@ export const ChartResponseTime = ({
|
||||
checks,
|
||||
range,
|
||||
}: {
|
||||
checks: GroupedCheck[];
|
||||
checks: AggregateCheck[];
|
||||
range: string;
|
||||
}) => {
|
||||
const theme = useTheme();
|
||||
|
||||
@@ -87,7 +87,7 @@ export const HistogramDockerPercentage = ({
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<XAxis
|
||||
dataKey={"_id"}
|
||||
dataKey={"bucketDate"}
|
||||
axisLine={false}
|
||||
tickLine={false}
|
||||
tick={(props) => <XTick {...props} range={range} />}
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Fragment, useId } from "react";
|
||||
import { XTick } from "./ChartResponseTime";
|
||||
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import type { GroupedCheck } from "@/types/check";
|
||||
import type { AggregateCheck } from "@/types/check";
|
||||
|
||||
const AREA_COLORS = [
|
||||
// Blues
|
||||
@@ -104,7 +104,7 @@ export const HistogramInfrastructure = ({
|
||||
title: string;
|
||||
type: string;
|
||||
idx: number | null;
|
||||
checks: GroupedCheck[];
|
||||
checks: AggregateCheck[];
|
||||
xKey: string;
|
||||
yDomain?: number[];
|
||||
dataKeys: string[];
|
||||
@@ -118,7 +118,7 @@ export const HistogramInfrastructure = ({
|
||||
const theme = useTheme();
|
||||
const uniqueId = useId();
|
||||
|
||||
let avgTemps: { bucketDate: Date; avg_temp: number | null }[] = [];
|
||||
let avgTemps: { bucketDate: string; avg_temp: number | null }[] = [];
|
||||
let tempYDomain: number[] = [];
|
||||
if (type === "temp") {
|
||||
avgTemps = checks.map((check) => {
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
import { HistogramPageSpeedScoresTooltip } from "./HistogramPageSpeedScoresTooltip";
|
||||
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import type { GroupedCheck } from "@/types/check";
|
||||
import type { AggregateCheck } from "@/types/check";
|
||||
import type { Palette } from "@mui/material/styles";
|
||||
type PaletteColorKey = Extract<
|
||||
keyof Palette,
|
||||
@@ -52,7 +52,7 @@ export const HistogramPageSpeedScores = ({
|
||||
checks,
|
||||
range,
|
||||
}: {
|
||||
checks: GroupedCheck[];
|
||||
checks: AggregateCheck[];
|
||||
range: string;
|
||||
}) => {
|
||||
const theme = useTheme();
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
} from "recharts";
|
||||
import { TrendingUp, AlertTriangle } from "lucide-react";
|
||||
|
||||
import type { GroupedCheck } from "@/types/check";
|
||||
import type { AggregateCheck } from "@/types/check";
|
||||
import type { MonitorStatus } from "@/types/monitor";
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -26,8 +26,8 @@ const XLabel = ({
|
||||
p2,
|
||||
range,
|
||||
}: {
|
||||
p1: GroupedCheck;
|
||||
p2: GroupedCheck;
|
||||
p1: AggregateCheck;
|
||||
p2: AggregateCheck;
|
||||
range: string;
|
||||
}) => {
|
||||
const theme = useTheme();
|
||||
@@ -65,7 +65,7 @@ export const HistogramStatus = ({
|
||||
range,
|
||||
title,
|
||||
}: {
|
||||
checks: GroupedCheck[];
|
||||
checks: AggregateCheck[];
|
||||
status: MonitorStatus;
|
||||
range: string;
|
||||
title: string;
|
||||
@@ -84,7 +84,7 @@ export const HistogramStatus = ({
|
||||
const CustomTooltip = ({ active, payload }: any) => {
|
||||
const uiTimezone = useAppSelector((state: any) => state.ui.timezone);
|
||||
if (!active || !payload?.length) return null;
|
||||
const d = payload[0]?.payload as GroupedCheck & {
|
||||
const d = payload[0]?.payload as AggregateCheck & {
|
||||
avgResponseTime?: number;
|
||||
};
|
||||
const avg = d?.avgResponseTime ?? 0;
|
||||
@@ -133,7 +133,7 @@ export const HistogramStatus = ({
|
||||
}
|
||||
|
||||
const totalChecks = normalChecks.reduce((count, check) => {
|
||||
return count + check.count;
|
||||
return count + (check.count ?? 0);
|
||||
}, 0);
|
||||
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user