Skip to content

feat(status-page): display active maintenance banner and monitor maintenance alert (#2679) - #3833

Open
Shivam-Kapure wants to merge 2 commits into
bluewave-labs:developfrom
Shivam-Kapure:feat/maintenance-status-page-banner
Open

feat(status-page): display active maintenance banner and monitor maintenance alert (#2679)#3833
Shivam-Kapure wants to merge 2 commits into
bluewave-labs:developfrom
Shivam-Kapure:feat/maintenance-status-page-banner

Conversation

@Shivam-Kapure

Copy link
Copy Markdown

Summary

This PR implements maintenance mode visibility on public status pages and monitor detail pages as requested in #2679.

  • Status Pages: Displays a themed MaintenanceBanner when any monitors attached to the status page are undergoing active scheduled maintenance, detailing affected services and estimated completion time (ETA).
  • Monitor Detail Page: Displays an informative warning alert banner when the viewed monitor is currently in maintenance mode.
  • Backend:
    • Implemented getActiveWindowEnd() utility to calculate end times for one-time and recurring maintenance windows.
    • Updated StatusPageService.getPublicStatusPagePayload to query maintenanceWindowsRepository for active windows covering the status page monitors.
    • Injected IMaintenanceWindowsRepository in services.api.ts.
  • Localization: Added translation strings to en.json.

Fixes #2679

PR Checklist

  • Tested the app locally and confirmed changes work as intended.
  • Code reviewed and no debug logs or leftover code.
  • Included related issue (Fixes #2679).
  • All user-facing strings use t(...) translations with keys in en.json.
  • Shared themes/tokens used for styling.
  • Code passes npm run lint and all unit tests (67 test suites, 1262 tests passing).
  • Opened against the develop branch.

@Shivam-Kapure
Shivam-Kapure requested a review from ajhollid as a code owner August 9, 2026 10:45
Copilot AI lite review requested due to automatic review settings August 9, 2026 10:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds visibility of active scheduled maintenance to public status pages and the monitor detail UI, backed by new backend payload fields and maintenance-window time calculations.

Changes:

  • Backend: compute and return activeMaintenances for public status-page payloads based on active maintenance windows.
  • Frontend: render a MaintenanceBanner on status pages and a maintenance warning Alert on the monitor details page.
  • Tests/i18n: add unit tests for maintenance-window end calculation and status-page payload, plus new English translation strings.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
server/src/utils/maintenanceWindow.ts Adds getActiveWindowEnd() helper for active maintenance ETA calculation.
server/test/unit/utils/maintenanceWindow.test.ts Adds unit tests covering getActiveWindowEnd() for one-time and recurring windows.
server/src/domain/status-pages/status-page.type.ts Extends public status-page payload types with activeMaintenances.
server/src/domain/status-pages/status-page.service.ts Queries maintenance windows for status-page monitors and includes activeMaintenances in the public payload.
server/test/unit/services/statusPageService.test.ts Updates service construction and adds coverage for activeMaintenances inclusion/omission.
server/src/config/services.api.ts Wires maintenanceWindowsRepository into StatusPageService.
client/src/Types/StatusPage.ts Mirrors the new activeMaintenances payload type on the client.
client/src/Pages/Uptime/Details/index.tsx Shows a warning banner when the monitor is in maintenance status.
client/src/Pages/StatusPage/Status/themes/shared/MaintenanceBanner.tsx New themed banner that lists affected services and displays maintenance ETA.
client/src/Pages/StatusPage/Status/themes/shared/BaseStatusPage.tsx Injects MaintenanceBanner into the base status-page layout.
client/src/Pages/StatusPage/Status/index.tsx Passes activeMaintenances from API response into the themed status page view.
client/src/locales/en.json Adds translation keys for the banner title/ETA/affected services and the monitor maintenance alert text.
Suppressed comments (1)

client/src/Pages/StatusPage/Status/themes/shared/MaintenanceBanner.tsx:143

  • Using the array index as the React key (key={idx}) can cause unstable rendering if the list changes. Prefer a stable key derived from the data (e.g., maintenance-window id + service name) for the affected-services chips.
								{affectedNames.map((name, idx) => (
									<Box
										key={idx}
										sx={{

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread server/src/utils/maintenanceWindow.ts
Comment on lines +139 to +152
const activeList = windows
.filter((win) => isWindowActive(win, now))
.map((win) => {
const activeEnd = getActiveWindowEnd(win, now) ?? new Date(win.end);
const affectedMonitorIds = win.monitorIds.filter((id) => statusPage.monitors.includes(id));
return {
id: win.id,
name: win.name,
start: win.start,
end: activeEnd.toISOString(),
monitorIds: affectedMonitorIds,
};
})
.filter((m) => m.monitorIds.length > 0);
Comment on lines +193 to +204
{monitor.status === "maintenance" && (
<Alert
severity="warning"
icon={<Wrench size={20} />}
sx={{
borderRadius: "8px",
fontWeight: 500,
}}
>
{t("pages.uptime.details.maintenanceAlert")}
</Alert>
)}
Comment on lines +9 to +21
import { formatDateWithTz } from "@/Utils/TimeUtils";

interface Props {
activeMaintenances?: ActiveMaintenanceInfo[];
monitors: Monitor[];
timezone?: string;
}

export const MaintenanceBanner = ({ activeMaintenances, monitors, timezone }: Props) => {
const { t } = useTranslation();
const { tokens, timezone: themeTimezone } = useStatusPageTheme();
const effectiveTimezone = timezone || themeTimezone;

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change status to maintenance mode

2 participants