Move the notification settings onto the general settings page

This commit is contained in:
2026-10-23 04:11:21 +01:00
parent a5eb2b6a95
commit 5475241371
10 changed files with 24 additions and 51 deletions
-6
View File
@@ -1,5 +1,4 @@
import {
Bell,
BookOpen,
Bot,
CpuAi,
@@ -47,11 +46,6 @@ export const SettingsPages: SettingsPage[] = [
Icon: SlidersHorizontal,
},
{ title: "Profile", url: "/admin/settings/profile", Icon: UserRound },
{
title: "Notifications",
url: "/admin/settings/notifications",
Icon: Bell,
},
{
title: "Change password",
url: "/admin/settings/change-password",
@@ -1,7 +1,27 @@
import type { PagePropsType } from "@/src/types";
import type { BunextPageServerFn } from "@moduletrace/bunext/types";
import grabPushOverview from "@/src/functions/backend/db/push/grab-push-overview";
import { ensureVapidKeys } from "@/src/push/vapid";
import grabSettingsServerProps from "../(functions)/grab-settings-server-props";
/**
* The General page: app appearance and behavior, plus this user's
* notification devices and the public key a new device subscribes with.
*/
export const server: BunextPageServerFn<PagePropsType> = async (params) => {
return await grabSettingsServerProps(params);
const settings = await grabSettingsServerProps(params);
if (!settings.props?.person?.id) return settings;
const keys = await ensureVapidKeys().catch(() => null);
return {
props: {
...settings.props,
push_overview: await grabPushOverview({
user_id: settings.props.person.id,
public_key: keys?.public_key || null,
}),
},
};
};
@@ -1,4 +1,5 @@
import AppearanceSection from "./(sections)/appearance-section";
import NotificationsSection from "./(sections)/notifications-section";
import PromptSection from "./(sections)/prompt-section";
import StorageSection from "./(sections)/storage-section";
import VersionSection from "./(sections)/version-section";
@@ -12,6 +13,7 @@ export default function AdminSettingsGeneralPage() {
description="How the app looks and behaves."
>
<AppearanceSection />
<NotificationsSection />
<PromptSection />
<StorageSection />
<VersionSection />
@@ -1,27 +0,0 @@
import type { PagePropsType } from "@/src/types";
import type { BunextPageServerFn } from "@moduletrace/bunext/types";
import grabPushOverview from "@/src/functions/backend/db/push/grab-push-overview";
import { ensureVapidKeys } from "@/src/push/vapid";
import grabSettingsServerProps from "../(functions)/grab-settings-server-props";
/**
* The Notifications page: this user's devices and the public key a new
* device subscribes with.
*/
export const server: BunextPageServerFn<PagePropsType> = async (params) => {
const settings = await grabSettingsServerProps(params);
if (!settings.props?.person?.id) return settings;
const keys = await ensureVapidKeys().catch(() => null);
return {
props: {
...settings.props,
push_overview: await grabPushOverview({
user_id: settings.props.person.id,
public_key: keys?.public_key || null,
}),
},
};
};
@@ -1,16 +0,0 @@
import NotificationsSection from "./(sections)/notifications-section";
import SettingsShell from "../(partials)/settings-shell";
import settingsPageMeta from "../(functions)/settings-page-meta";
export default function AdminSettingsNotificationsPage() {
return (
<SettingsShell
title="Notifications"
description="When a bot needs you, and which devices hear about it."
>
<NotificationsSection />
</SettingsShell>
);
}
export const meta = settingsPageMeta({ label: "Notifications" });
+1 -1
View File
@@ -42,7 +42,7 @@ export const handler: BunextAPIRouteHandler<APIResponseObject> = async ({
payload: {
title: `${SiteData["SiteName"]} notifications are on`,
body: "This is what a bot's message will look like.",
url: "/admin/settings/notifications",
url: "/admin/settings/general",
tag: "cobble-test",
},
});