fix: resolve failing CI checks

This commit is contained in:
nikhil2004 committed 2026-09-22 04:42:32 +05:30
1 parent de4c528d55
commit 55184724d0
6 files changed
+39 -13

No files matched your search

@@ -27,7 +27,13 @@ interface IncidentModalProps {
onClose: () => void; onClose: () => void;
} }
export const IncidentModal = ({ url, monitorId, date, timezone, onClose }: IncidentModalProps) => { export const IncidentModal = ({
url,
monitorId,
date,
timezone,
onClose,
}: IncidentModalProps) => {
const theme = useTheme(); const theme = useTheme();
const { t } = useTranslation(); const { t } = useTranslation();
const open = Boolean(monitorId && date); const open = Boolean(monitorId && date);
@@ -2,6 +2,7 @@ import Tooltip from "@mui/material/Tooltip";
import Box from "@mui/material/Box"; import Box from "@mui/material/Box";
import type { SxProps, Theme } from "@mui/material/styles"; import type { SxProps, Theme } from "@mui/material/styles";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { mergeSx } from "@/Pages/StatusPage/Status/themes/shared/sx";
import type { import type {
ChartCell, ChartCell,
@@ -20,7 +21,7 @@ export const ThemedHeatmap = ({ cells, containerSx, cellSx, onCellClick }: Props
return ( return (
<Box <Box
sx={[containerSx, { gridTemplateColumns: `repeat(${cells.length}, 1fr)` }]} sx={mergeSx(containerSx, { gridTemplateColumns: `repeat(${cells.length}, 1fr)` })}
role="img" role="img"
aria-label={t("pages.statusPages.monitorsList.chart.heatmapAria")} aria-label={t("pages.statusPages.monitorsList.chart.heatmapAria")}
> >
@@ -29,10 +30,10 @@ export const ThemedHeatmap = ({ cells, containerSx, cellSx, onCellClick }: Props
return ( return (
<Box <Box
key={cell.key} key={cell.key}
sx={[ sx={mergeSx(
cellSx("empty"), cellSx("empty"),
!!cell.date && !!onCellClick ? { cursor: "pointer" } : undefined !!cell.date && !!onCellClick ? { cursor: "pointer" } : undefined
]} )}
onClick={() => { onClick={() => {
if (cell.date && onCellClick) { if (cell.date && onCellClick) {
onCellClick(cell.date); onCellClick(cell.date);
@@ -49,10 +50,10 @@ export const ThemedHeatmap = ({ cells, containerSx, cellSx, onCellClick }: Props
placement="top" placement="top"
> >
<Box <Box
sx={[ sx={mergeSx(
cellSx(cell.heatKind, cell.severity), cellSx(cell.heatKind, cell.severity),
!!cell.date && !!onCellClick ? { cursor: "pointer" } : undefined !!cell.date && !!onCellClick ? { cursor: "pointer" } : undefined
]} )}
aria-label={cell.ariaLabel} aria-label={cell.ariaLabel}
onClick={() => { onClick={() => {
if (cell.date && onCellClick) { if (cell.date && onCellClick) {
@@ -5,6 +5,7 @@ import Stack from "@mui/material/Stack";
import type { SxProps, Theme } from "@mui/material/styles"; import type { SxProps, Theme } from "@mui/material/styles";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { formatMs } from "@/Utils/TimeUtils"; import { formatMs } from "@/Utils/TimeUtils";
import { mergeSx } from "@/Pages/StatusPage/Status/themes/shared/sx";
import type { import type {
BarKind, BarKind,
@@ -42,17 +43,17 @@ export const ThemedHistogram = ({
return ( return (
<Stack gap={statsGap}> <Stack gap={statsGap}>
<Box <Box
sx={[containerSx, { gridTemplateColumns: `repeat(${cells.length}, 1fr)` }]} sx={mergeSx(containerSx, { gridTemplateColumns: `repeat(${cells.length}, 1fr)` })}
> >
{cells.map((cell) => { {cells.map((cell) => {
if (cell.barKind === "empty") { if (cell.barKind === "empty") {
return ( return (
<Box <Box
key={cell.key} key={cell.key}
sx={[ sx={mergeSx(
barSx("empty", cell.heightPct), barSx("empty", cell.heightPct),
!!cell.date && !!onCellClick ? { cursor: "pointer" } : undefined !!cell.date && !!onCellClick ? { cursor: "pointer" } : undefined
]} )}
onClick={() => { onClick={() => {
if (cell.date && onCellClick) { if (cell.date && onCellClick) {
onCellClick(cell.date); onCellClick(cell.date);
@@ -69,10 +70,10 @@ export const ThemedHistogram = ({
placement="top" placement="top"
> >
<Box <Box
sx={[ sx={mergeSx(
barSx(cell.barKind, cell.heightPct, cell.severity), barSx(cell.barKind, cell.heightPct, cell.severity),
!!cell.date && !!onCellClick ? { cursor: "pointer" } : undefined !!cell.date && !!onCellClick ? { cursor: "pointer" } : undefined
]} )}
aria-label={cell.ariaLabel} aria-label={cell.ariaLabel}
onClick={() => { onClick={() => {
if (cell.date && onCellClick) { if (cell.date && onCellClick) {
@@ -0,0 +1,16 @@
import type { SxProps, Theme } from "@mui/material/styles";
export const mergeSx = (
...styles: Array<SxProps<Theme> | false | null | undefined>
): SxProps<Theme> => {
const result: SxProps<Theme>[] = [];
for (const style of styles) {
if (!style) continue;
if (Array.isArray(style)) {
result.push(...(style.filter(Boolean) as SxProps<Theme>[]));
} else {
result.push(style);
}
}
return result as SxProps<Theme>;
};
+4 -1
View File
@@ -20,7 +20,10 @@ export interface Incident {
updatedAt: string; updatedAt: string;
} }
export type PublicIncident = Pick<Incident, "id" | "monitorId" | "status" | "startTime" | "endTime" | "resolutionType" | "message" | "statusCode" | "createdAt">; export type PublicIncident = Pick<
Incident,
"id" | "monitorId" | "status" | "startTime" | "endTime" | "resolutionType" | "message" | "statusCode" | "createdAt"
>;
export interface IncidentSummaryTopMonitor { export interface IncidentSummaryTopMonitor {
monitorId: string; monitorId: string;
@@ -117,7 +117,6 @@ export class StatusPageService implements IStatusPageService {
createdAt: incident.createdAt, createdAt: incident.createdAt,
}); });
createStatusPage = async ( createStatusPage = async (
userId: string, userId: string,
teamId: string, teamId: string,