Add community content reports, map bans, and appeals
This commit is contained in:
@@ -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>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user