Release v0.1.4 with terrain rescanning and owner-published map updates
All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 6m26s
All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 6m26s
This commit is contained in:
@@ -17,6 +17,7 @@ import { ExportMap } from "./MapTransfer";
|
||||
type Draft = {
|
||||
imported_from_id: string | null;
|
||||
imported_owner_name: string | null;
|
||||
ownsPublishedParent: boolean;
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
@@ -87,7 +88,7 @@ export function DraftEditor({
|
||||
clearTimeout(timer);
|
||||
};
|
||||
}, [id, version]);
|
||||
async function save(submit = false) {
|
||||
async function save(submit = false, publishOwnContribution = false) {
|
||||
setBusy(true);
|
||||
setError("");
|
||||
setMessage("");
|
||||
@@ -99,12 +100,25 @@ export function DraftEditor({
|
||||
);
|
||||
dirty.current = false;
|
||||
if (submit) {
|
||||
await api("datasets/" + id + "/submit", {});
|
||||
const publishUpdate =
|
||||
draft?.state === "published" && !draft.parent_dataset_id;
|
||||
await api(
|
||||
"datasets/" +
|
||||
id +
|
||||
(publishOwnContribution
|
||||
? "/publish-own-contribution"
|
||||
: publishUpdate
|
||||
? "/publish-update"
|
||||
: "/submit"),
|
||||
{},
|
||||
);
|
||||
setVersion((v) => v + 1);
|
||||
setMessage(
|
||||
draft?.parent_dataset_id
|
||||
? "Submitted for map owner approval."
|
||||
: "Submitted for moderator review.",
|
||||
publishUpdate || publishOwnContribution
|
||||
? "Map update published."
|
||||
: draft?.parent_dataset_id
|
||||
? "Submitted for map owner approval."
|
||||
: "Submitted for moderator review.",
|
||||
);
|
||||
} else setMessage("Draft saved.");
|
||||
} catch (e) {
|
||||
@@ -384,8 +398,19 @@ export function DraftEditor({
|
||||
>
|
||||
{draft.parent_dataset_id
|
||||
? t("Submit to map owner →")
|
||||
: t("Submit for review →")}
|
||||
: draft.state === "published"
|
||||
? t("Publish update →")
|
||||
: t("Submit for review →")}
|
||||
</button>
|
||||
{draft.parent_dataset_id && draft.ownsPublishedParent && (
|
||||
<button
|
||||
className="button primary"
|
||||
disabled={busy || refreshing || selected.length < minimum}
|
||||
onClick={() => save(true, true)}
|
||||
>
|
||||
{t("Update my map now →")}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{!draft.imported_from_id && !draft.parent_dataset_id && (
|
||||
|
||||
Reference in New Issue
Block a user