From c5c3bc0775d7b8e525d153a54fd9fcb3b1f7541a Mon Sep 17 00:00:00 2001
From: PxlLoewe <72106766+PxlLoewe@users.noreply.github.com>
Date: Tue, 6 Jan 2026 12:19:10 +0100
Subject: [PATCH] =?UTF-8?q?Changelog-Seite,=20option=20zum=20verstecken=20?=
=?UTF-8?q?von=20Eintr=C3=A4gen=20auf=20dieser?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../admin/changelog/_components/Form.tsx | 12 ++
apps/hub/app/(app)/admin/changelog/page.tsx | 20 +-
.../(app)/changelog/_components/Timeline.tsx | 68 +++++++
apps/hub/app/(app)/changelog/page.tsx | 26 +++
apps/hub/app/_components/Nav.tsx | 182 +++++++++---------
apps/hub/next.config.ts | 2 +-
.../database/prisma/schema/changelog.prisma | 11 +-
.../migration.sql | 2 +
8 files changed, 226 insertions(+), 97 deletions(-)
create mode 100644 apps/hub/app/(app)/changelog/_components/Timeline.tsx
create mode 100644 apps/hub/app/(app)/changelog/page.tsx
create mode 100644 packages/database/prisma/schema/migrations/20260106104554_show_on_page_for_changelog_option/migration.sql
diff --git a/apps/hub/app/(app)/admin/changelog/_components/Form.tsx b/apps/hub/app/(app)/admin/changelog/_components/Form.tsx
index 0700d499..58479710 100644
--- a/apps/hub/app/(app)/admin/changelog/_components/Form.tsx
+++ b/apps/hub/app/(app)/admin/changelog/_components/Form.tsx
@@ -23,6 +23,7 @@ export const ChangelogForm = ({ changelog }: { changelog?: Changelog }) => {
title: changelog?.title || "",
text: changelog?.text || "",
previewImage: changelog?.previewImage || "", // Changed to accept a URL as a string
+ showOnChangelogPage: changelog?.showOnChangelogPage || true,
},
});
const [skipUserUpdate, setSkipUserUpdate] = useState(false);
@@ -84,6 +85,7 @@ export const ChangelogForm = ({ changelog }: { changelog?: Changelog }) => {
placeholder="Titel (vX.X.X)"
className="input-sm"
/>
+
{
)}
+
),
},
- ] as ColumnDef
[]
+ ] as ColumnDef[]
}
leftOfSearch={
diff --git a/apps/hub/app/(app)/changelog/_components/Timeline.tsx b/apps/hub/app/(app)/changelog/_components/Timeline.tsx
new file mode 100644
index 00000000..27dd3907
--- /dev/null
+++ b/apps/hub/app/(app)/changelog/_components/Timeline.tsx
@@ -0,0 +1,68 @@
+"use client";
+
+import MDEditor from "@uiw/react-md-editor";
+import Image from "next/image";
+
+export type TimelineEntry = {
+ id: number;
+ title: string;
+ text: string;
+ previewImage?: string | null;
+ createdAt: string;
+};
+
+const formatReleaseDate = (value: string) =>
+ new Intl.DateTimeFormat("en-GB", {
+ day: "2-digit",
+ month: "short",
+ year: "numeric",
+ }).format(new Date(value));
+
+export const ChangelogTimeline = ({ entries }: { entries: TimelineEntry[] }) => {
+ if (!entries.length)
+ return Es sind noch keine Changelog-Einträge vorhanden.
;
+
+ return (
+
+
+
+ {entries.map((entry, idx) => (
+
+
+
+
+
+
{entry.title}
+
+ Release Date: {formatReleaseDate(entry.createdAt)}
+
+
+ {entry.previewImage && (
+
+
+
+ )}
+
+
+
+
+
+
+
+ ))}
+
+
+ );
+};
diff --git a/apps/hub/app/(app)/changelog/page.tsx b/apps/hub/app/(app)/changelog/page.tsx
new file mode 100644
index 00000000..6197415c
--- /dev/null
+++ b/apps/hub/app/(app)/changelog/page.tsx
@@ -0,0 +1,26 @@
+import { prisma } from "@repo/db";
+import { ChangelogTimeline } from "./_components/Timeline";
+import { ActivityLogIcon } from "@radix-ui/react-icons";
+
+export default async function Page() {
+ const changelog = await prisma.changelog.findMany({
+ where: { showOnChangelogPage: true },
+ orderBy: { createdAt: "desc" },
+ });
+
+ const entries = changelog.map((entry) => ({
+ ...entry,
+ createdAt: entry.createdAt.toISOString(),
+ }));
+
+ return (
+ <>
+
+
+ >
+ );
+}
diff --git a/apps/hub/app/_components/Nav.tsx b/apps/hub/app/_components/Nav.tsx
index bd5f29fd..fbff5816 100644
--- a/apps/hub/app/_components/Nav.tsx
+++ b/apps/hub/app/_components/Nav.tsx
@@ -6,13 +6,15 @@ import {
RocketIcon,
ReaderIcon,
DownloadIcon,
+ UpdateIcon,
+ ActivityLogIcon,
} from "@radix-ui/react-icons";
import Link from "next/link";
import { WarningAlert } from "./ui/PageAlert";
import { getServerSession } from "api/auth/[...nextauth]/auth";
import { Error } from "./Error";
import Image from "next/image";
-import { Plane, Radar, Workflow } from "lucide-react";
+import { Loader, Plane, Radar, Workflow } from "lucide-react";
import { BookingButton } from "./BookingButton";
export const VerticalNav = async () => {
@@ -22,93 +24,101 @@ export const VerticalNav = async () => {
return p.startsWith("ADMIN");
});
return (
-
- -
-
- Dashboard
-
-
- -
-
-
- Events & Kurse
-
-
- -
-
-
- Einsatzhistorie
-
-
- -
-
-
- Einstellungen
-
-
- -
-
-
- Downloads / Links
-
-
- {viewAdminMenu && (
+
+
-
-
-
-
- Admin
-
-
- {session.user.permissions.includes("ADMIN_USER") && (
- -
- Benutzer
-
- )}
- {session.user.permissions.includes("ADMIN_STATION") && (
- -
- Stationen
-
- )}
- {session.user.permissions.includes("ADMIN_KEYWORD") && (
- -
- Stichworte
-
- )}
- {session.user.permissions.includes("ADMIN_HELIPORT") && (
- -
- Heliports
-
- )}
- {session.user.permissions.includes("ADMIN_EVENT") && (
- -
- Events
-
- )}
- {session.user.permissions.includes("ADMIN_MESSAGE") && (
- -
- Config
-
- )}
- {session.user.permissions.includes("ADMIN_USER") && (
- -
- Reports
-
- )}
- {session.user.permissions.includes("ADMIN_USER") && (
- -
- Audit-Log
-
- )}
- {session.user.permissions.includes("ADMIN_CHANGELOG") && (
- -
- Changelog
-
- )}
-
-
+
+ Dashboard
+
- )}
+
-
+
+
+ Events & Kurse
+
+
+
-
+
+
+ Einsatzhistorie
+
+
+
-
+
+
+ Einstellungen
+
+
+
-
+
+
+ Downloads / Links
+
+
+ {viewAdminMenu && (
+
-
+
+
+
+ Admin
+
+
+ {session.user.permissions.includes("ADMIN_USER") && (
+ -
+ Benutzer
+
+ )}
+ {session.user.permissions.includes("ADMIN_STATION") && (
+ -
+ Stationen
+
+ )}
+ {session.user.permissions.includes("ADMIN_KEYWORD") && (
+ -
+ Stichworte
+
+ )}
+ {session.user.permissions.includes("ADMIN_HELIPORT") && (
+ -
+ Heliports
+
+ )}
+ {session.user.permissions.includes("ADMIN_EVENT") && (
+ -
+ Events
+
+ )}
+ {session.user.permissions.includes("ADMIN_MESSAGE") && (
+ -
+ Config
+
+ )}
+ {session.user.permissions.includes("ADMIN_USER") && (
+ -
+ Reports
+
+ )}
+ {session.user.permissions.includes("ADMIN_USER") && (
+ -
+ Audit-Log
+
+ )}
+ {session.user.permissions.includes("ADMIN_CHANGELOG") && (
+ -
+ Changelog
+
+ )}
+
+
+
+ )}
+
+ -
+
+
+ Changelog
+
+
);
};
diff --git a/apps/hub/next.config.ts b/apps/hub/next.config.ts
index b8d111d6..f681ee94 100644
--- a/apps/hub/next.config.ts
+++ b/apps/hub/next.config.ts
@@ -3,7 +3,7 @@
/* const nextConfig = removeImports({}); */
const nextConfig = {
images: {
- domains: ["cdn.discordapp.com"],
+ domains: ["cdn.discordapp.com", "nextcloud.virtualairrescue.com"],
},
};
diff --git a/packages/database/prisma/schema/changelog.prisma b/packages/database/prisma/schema/changelog.prisma
index b0134ca4..06b0d10b 100644
--- a/packages/database/prisma/schema/changelog.prisma
+++ b/packages/database/prisma/schema/changelog.prisma
@@ -1,7 +1,8 @@
model Changelog {
- id Int @id @default(autoincrement())
- title String
- previewImage String?
- text String
- createdAt DateTime @default(now())
+ id Int @id @default(autoincrement())
+ title String
+ previewImage String?
+ text String
+ createdAt DateTime @default(now())
+ showOnChangelogPage Boolean @default(true)
}
diff --git a/packages/database/prisma/schema/migrations/20260106104554_show_on_page_for_changelog_option/migration.sql b/packages/database/prisma/schema/migrations/20260106104554_show_on_page_for_changelog_option/migration.sql
new file mode 100644
index 00000000..8ff8eebb
--- /dev/null
+++ b/packages/database/prisma/schema/migrations/20260106104554_show_on_page_for_changelog_option/migration.sql
@@ -0,0 +1,2 @@
+-- AlterTable
+ALTER TABLE "Changelog" ADD COLUMN "showOnChangelogPage" BOOLEAN NOT NULL DEFAULT true;