Skip to content

Open-source status page, incident response and uptime monitoring

Feat/location change info (#934)

Maximilian Kaske8c77c7bc7222
diff --git a/apps/web/public/assets/changelog/status-report-location-change.png b/apps/web/public/assets/changelog/status-report-location-change.png
new file mode 100644
index 000000000..157b2da8f
Binary files /dev/null and b/apps/web/public/assets/changelog/status-report-location-change.png differ
diff --git a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/layout.tsx b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/layout.tsx
index 195dfb685..1bae4f4cc 100644
--- a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/layout.tsx
+++ b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/layout.tsx
@@ -3,6 +3,8 @@ import { api } from "@/trpc/server";
import { notFound } from "next/navigation";
import type { ReactNode } from "react";
import { WorkspaceClientCookie } from "../worskpace-client-cookie";
+import { InfoAlertDialog } from "@/components/dashboard/info-alert-dialog";
+import Link from "next/link";
// TODO: make the container min-h-screen and the footer below!
export default async function AppLayout({
@@ -26,6 +28,26 @@ export default async function AppLayout({
{children}
</main>
<WorkspaceClientCookie {...{ workspaceSlug }} />
+ <InfoAlertDialog
+ id="status-report-location-change"
+ title="An update on Status Reports"
+ expires={365} // 1 year - TODO: delete the block after 30 days
+ description={
+ <>
+ Each report is now saved within a{" "}
+ <span className="font-semibold text-foreground">Status Page</span>.
+ Select a page to view all reports for related to it.{" "}
+ <Link
+ href="/changelog/status-report-location-change"
+ className="underline underline-offset-4 hover:text-primary hover:no-underline"
+ >
+ Read changelog
+ </Link>
+ .
+ </>
+ }
+ workspaceSlug={workspaceSlug}
+ />
</div>
);
}
diff --git a/apps/web/src/components/dashboard/info-alert-dialog.tsx b/apps/web/src/components/dashboard/info-alert-dialog.tsx
new file mode 100644
index 000000000..4a97db15f
--- /dev/null
+++ b/apps/web/src/components/dashboard/info-alert-dialog.tsx
@@ -0,0 +1,74 @@
+"use client";
+
+import { useParams } from "next/navigation";
+import { useEffect, useState } from "react";
+
+import {
+ AlertDialog,
+ AlertDialogAction,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogTitle,
+} from "@openstatus/ui";
+
+interface InfoAlertDialogProps {
+ workspaceSlug: string;
+ /**
+ * Default expiration time in days
+ */
+ expires?: number;
+
+ id: string;
+ title: React.ReactNode;
+ description: React.ReactNode;
+}
+
+export function InfoAlertDialog({
+ workspaceSlug,
+ expires = 7,
+ id,
+ title,
+ description,
+}: InfoAlertDialogProps) {
+ const [open, setOpen] = useState(false);
+
+ function onClick() {
+ if (document) {
+ const expiresAt = new Date();
+ expiresAt.setDate(expiresAt.getDate() + expires);
+ // store the cookie for 7 days and only for a specific workspace
+ document.cookie = `${id}=true; expires=${expiresAt}; path=/app/${workspaceSlug}`;
+ }
+ setOpen(false);
+ }
+
+ useEffect(() => {
+ async function configureProBanner() {
+ if (document) {
+ const cookie = document.cookie
+ .split("; ")
+ .find((row) => row.startsWith(id));
+ if (!cookie) {
+ setOpen(true);
+ }
+ }
+ }
+ configureProBanner();
+ }, [id]);
+
+ return (
+ <AlertDialog open={open} onOpenChange={setOpen}>
+ <AlertDialogContent>
+ <AlertDialogHeader>
+ <AlertDialogTitle>{title}</AlertDialogTitle>
+ <AlertDialogDescription>{description}</AlertDialogDescription>
+ </AlertDialogHeader>
+ <AlertDialogFooter>
+ <AlertDialogAction onClick={onClick}>Continue</AlertDialogAction>
+ </AlertDialogFooter>
+ </AlertDialogContent>
+ </AlertDialog>
+ );
+}
diff --git a/apps/web/src/content/changelog/status-report-location-change.mdx b/apps/web/src/content/changelog/status-report-location-change.mdx
new file mode 100644
index 000000000..2b89ebf58
--- /dev/null
+++ b/apps/web/src/content/changelog/status-report-location-change.mdx
@@ -0,0 +1,10 @@
+---
+title: Status Report location change
+description: Each report is now saved within a Status Page.
+publishedAt: 2024-07-14
+image: /assets/changelog/status-report-location-change.png
+---
+
+The location of your reports has changed. The can be found within the connected status page. No need to connect manually to a status page.
+
+If you encounter any issues. Please [contact us](mailto:[email protected]).
\ No newline at end of file