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
7 files changed
+41 -15

No files matched your search

@@ -27,7 +27,13 @@ interface IncidentModalProps {
onClose: () => void;
}
export const IncidentModal = ({ url, monitorId, date, timezone, onClose }: IncidentModalProps) => {
export const IncidentModal = ({
url,
monitorId,
date,
timezone,
onClose,
}: IncidentModalProps) => {
const theme = useTheme();
const { t } = useTranslation();
const open = Boolean(monitorId && date);
@@ -2,6 +2,7 @@ import Tooltip from "@mui/material/Tooltip";
import Box from "@mui/material/Box";
import type { SxProps, Theme } from "@mui/material/styles";
import { useTranslation } from "react-i18next";
import { mergeSx } from "@/Pages/StatusPage/Status/themes/shared/sx";
import type {
ChartCell,
@@ -20,7 +21,7 @@ export const ThemedHeatmap = ({ cells, containerSx, cellSx, onCellClick }: Props
return (
<Box
sx={[containerSx, { gridTemplateColumns: `repeat(${cells.length}, 1fr)` }]}
sx={mergeSx(containerSx, { gridTemplateColumns: `repeat(${cells.length}, 1fr)` })}
role="img"
aria-label={t("pages.statusPages.monitorsList.chart.heatmapAria")}
>
@@ -29,10 +30,10 @@ export const ThemedHeatmap = ({ cells, containerSx, cellSx, onCellClick }: Props
return (
<Box
key={cell.key}
sx={[
sx={mergeSx(
cellSx("empty"),
!!cell.date && !!onCellClick ? { cursor: "pointer" } : undefined
]}
)}
onClick={() => {
if (cell.date && onCellClick) {
onCellClick(cell.date);
@@ -49,10 +50,10 @@ export const ThemedHeatmap = ({ cells, containerSx, cellSx, onCellClick }: Props
placement="top"
>
<Box
sx={[
sx={mergeSx(
cellSx(cell.heatKind, cell.severity),
!!cell.date && !!onCellClick ? { cursor: "pointer" } : undefined
]}
)}
aria-label={cell.ariaLabel}
onClick={() => {
if (cell.date && onCellClick) {
@@ -5,6 +5,7 @@ import Stack from "@mui/material/Stack";
import type { SxProps, Theme } from "@mui/material/styles";
import { useTranslation } from "react-i18next";
import { formatMs } from "@/Utils/TimeUtils";
import { mergeSx } from "@/Pages/StatusPage/Status/themes/shared/sx";
import type {
BarKind,
@@ -42,17 +43,17 @@ export const ThemedHistogram = ({
return (
<Stack gap={statsGap}>
<Box
sx={[containerSx, { gridTemplateColumns: `repeat(${cells.length}, 1fr)` }]}
sx={mergeSx(containerSx, { gridTemplateColumns: `repeat(${cells.length}, 1fr)` })}
>
{cells.map((cell) => {
if (cell.barKind === "empty") {
return (
<Box
key={cell.key}
sx={[
sx={mergeSx(
barSx("empty", cell.heightPct),
!!cell.date && !!onCellClick ? { cursor: "pointer" } : undefined
]}
)}
onClick={() => {
if (cell.date && onCellClick) {
onCellClick(cell.date);
@@ -69,10 +70,10 @@ export const ThemedHistogram = ({
placement="top"
>
<Box
sx={[
sx={mergeSx(
barSx(cell.barKind, cell.heightPct, cell.severity),
!!cell.date && !!onCellClick ? { cursor: "pointer" } : undefined
]}
)}
aria-label={cell.ariaLabel}
onClick={() => {
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;
}
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 {
monitorId: string;
@@ -117,7 +117,6 @@ export class StatusPageService implements IStatusPageService {
createdAt: incident.createdAt,
});
createStatusPage = async (
userId: string,
teamId: string,
@@ -449,7 +449,7 @@ describe("StatusPageService", () => {
it("fetches and sanitizes incidents successfully", async () => {
const { service, repo, incidentsRepo } = createService();
(repo.findByUrl as jest.Mock).mockResolvedValue(publishedPage());
const mockIncident = {
id: "inc-1",
monitorId: "mon-1",
@@ -466,7 +466,7 @@ describe("StatusPageService", () => {
(incidentsRepo.findByMonitorIdAndDate as jest.Mock).mockResolvedValue([mockIncident]);
const results = await service.getPublicMonitorIncidents("my-status-page", "mon-1", "2026-08-01");
expect(incidentsRepo.findByMonitorIdAndDate).toHaveBeenCalled();
expect(results).toHaveLength(1);
expect(results[0]).toHaveProperty("id", "inc-1");