fix: dashboard edit previews, migration journal, and notes comments
Register drizzle journal entries for 0022/0023 so prod migrations apply. Key edit-mode widget previews by index so bangs.stats shows live data. Add comments to notes detail pages.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { notFound } from "next/navigation";
|
||||
import { Suspense } from "react";
|
||||
import { getCurrentSession } from "@/lib/session";
|
||||
import { parseDashboardLayout, widgetContentKey } from "@/lib/dashboard";
|
||||
import { parseDashboardLayout, widgetContentIndexKey } from "@/lib/dashboard";
|
||||
import { readEditorDraftLayout } from "@/lib/dashboard-editor-draft";
|
||||
import { computeDefaultLayout, normalizeDashboardLayout } from "@/lib/dashboard.server";
|
||||
import { getWidget, getWidgetMetas } from "@/modules/_core";
|
||||
@@ -58,10 +58,10 @@ export default async function DashboardPage({
|
||||
if (isEditing) {
|
||||
const ctx = { userId: user.id, householdId: household.id };
|
||||
const widgetContents = Object.fromEntries(
|
||||
layout.widgets.map((placement) => [
|
||||
widgetContentKey(placement),
|
||||
layout.widgets.map((placement, index) => [
|
||||
widgetContentIndexKey(index),
|
||||
<DashboardWidgetContent
|
||||
key={widgetContentKey(placement)}
|
||||
key={widgetContentIndexKey(index)}
|
||||
placement={placement}
|
||||
ctx={ctx}
|
||||
/>,
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { notFound } from "next/navigation";
|
||||
import { getCurrentSession } from "@/lib/session";
|
||||
import { NoteEditor } from "@/modules/notes/components/note-editor";
|
||||
import { getNote } from "@/modules/notes/server/queries";
|
||||
|
||||
export default async function NotePage({ params }: { params: Promise<{ id: string }> }) {
|
||||
const { id } = await params;
|
||||
const note = await getNote(id).catch(() => null);
|
||||
const [{ user }, note] = await Promise.all([getCurrentSession(), getNote(id).catch(() => null)]);
|
||||
if (!note) notFound();
|
||||
|
||||
return <NoteEditor note={note} />;
|
||||
return <NoteEditor note={note} currentUserId={user.id} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user