Inbjudningslänkar, adressuppslag för kartregistret och närvaromärke
Böcker kan delas med en inbjudningslänk (roll, giltighetstid, en eller flera personer, bara en hash sparas). Inloggningen går tillbaka till inbjudan. Kartregistrets markeringar kan få position genom uppslag mot karttjänsten, ett i sekunden. Redigeringsformulär och listor visar vem som har något öppet för redigering. Migrering 0009. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1fd1ce78cb
commit
5c58f70bdd
34 files changed
+1610
-30
No files matched your search
@@ -11,6 +11,7 @@ import { RelationBondFields } from "@/components/relation-bond-fields";
|
||||
import { PageBody, PageHeader } from "@/components/page";
|
||||
import { getT } from "@/i18n/server";
|
||||
import { versionOf } from "@/lib/conflict";
|
||||
import { whoIsEditing } from "@/lib/presence";
|
||||
import { prisma } from "@/lib/db";
|
||||
import { requireBook } from "@/lib/session";
|
||||
import { getTemplate } from "@/lib/templates";
|
||||
@@ -24,7 +25,7 @@ export default async function RelationPage({
|
||||
}) {
|
||||
const { bookId, relationId } = await params;
|
||||
const { saved } = await searchParams;
|
||||
await requireBook(bookId, "EDITOR");
|
||||
const access = await requireBook(bookId, "EDITOR");
|
||||
const { t, locale } = await getT();
|
||||
|
||||
const relation = await prisma.relation.findFirst({
|
||||
@@ -32,6 +33,7 @@ export default async function RelationPage({
|
||||
include: { from: true, to: true, members: { include: { entity: true } } },
|
||||
});
|
||||
if (!relation) notFound();
|
||||
const editing = await whoIsEditing(bookId, "relation", relation.id, access.userId);
|
||||
const candidates = await prisma.entity.findMany({
|
||||
where: { bookId, id: { notIn: [relation.fromId, relation.toId] } },
|
||||
select: { id: true, name: true, kind: true },
|
||||
@@ -97,7 +99,12 @@ export default async function RelationPage({
|
||||
/>
|
||||
<PageBody>
|
||||
{saved ? <div className="alert alert-success">{t("common.saved")}</div> : null}
|
||||
<ConflictForm key={versionOf(relation.updatedAt)} action={saveRelation} version={versionOf(relation.updatedAt)}>
|
||||
<ConflictForm
|
||||
key={versionOf(relation.updatedAt)}
|
||||
action={saveRelation}
|
||||
version={versionOf(relation.updatedAt)}
|
||||
presence={{ bookId, kind: "relation", targetId: relation.id, others: editing }}
|
||||
>
|
||||
<input type="hidden" name="bookId" value={bookId} />
|
||||
<input type="hidden" name="id" value={relation.id} />
|
||||
<div className="card mb-3">
|
||||
|
||||
Reference in new issue
Block a user