Add community content reports, map bans, and appeals

This commit is contained in:
2026-10-06 13:00:10 +05:00
parent 5f43e97d32
commit dd67b5c0de
18 changed files with 1167 additions and 50 deletions

View File

@@ -9,6 +9,7 @@ import { PanoramaPreview } from "./PanoramaPreview";
import { OwnerContributions } from "./OwnerContributions";
import Link from "next/link";
import { MapRefresh } from "./MapRefresh";
import { MapAppeal } from "./MapAppeal";
type Draft = {
id: string;
name: string;
@@ -25,6 +26,9 @@ type Draft = {
allow_contributions: boolean;
contribution_server_address: string | null;
update_state: string | null;
report_strikes: number;
banned_at: string | null;
ban_reason: string | null;
};
export function DraftEditor({ id }: { id: string }) {
const dirty = useRef(false);
@@ -52,6 +56,7 @@ export function DraftEditor({ id }: { id: string }) {
setSelected(d.manifest.viewpoints.map((p) => p.id));
}
if (
d.banned_at ||
["uploading", "processing"].includes(d.state) ||
["queued", "running"].includes(d.upload_jobs?.state ?? "")
)
@@ -139,6 +144,16 @@ export function DraftEditor({ id }: { id: string }) {
{!draft.parent_dataset_id && <a href="#map-tools">Map tools</a>}
</div>
<span className="badge">{draft.state}</span>
{!draft.parent_dataset_id &&
(draft.report_strikes > 0 || draft.banned_at) && (
<MapAppeal
id={id}
strikes={draft.report_strikes}
bannedAt={draft.banned_at}
banReason={draft.ban_reason}
onChange={() => setVersion((v) => v + 1)}
/>
)}
{draft.update_state && (
<span className="badge">Update: {draft.update_state}</span>
)}