tgu: DELETE /plans/{draftPlanId} — отказ от черновика (бэкенд + кнопка «Отмена» и авто-отмена в редакторе)

This commit is contained in:
Дмитрий Соловьев
2026-06-03 13:59:52 +03:00
parent ec67d9d83d
commit 2a841fc7b3
7 changed files with 236 additions and 4 deletions
@@ -12,6 +12,7 @@ type EditorToolbarProps = {
addedCount: number;
dirty: boolean;
applying: boolean;
canceling: boolean;
windowLabel: string;
rightMode: "none" | "inspect" | "shoot" | "downlink" | "mapInfo";
onSetRightMode: (mode: "shoot" | "downlink") => void;
@@ -19,6 +20,7 @@ type EditorToolbarProps = {
onRedo: () => void;
onCheck: () => void;
onApply: () => void;
onCancel: () => void;
onZoom: (factor: number) => void;
onPan: (factor: number) => void;
};
@@ -34,6 +36,7 @@ export function EditorToolbar({
addedCount,
dirty,
applying,
canceling,
windowLabel,
rightMode,
onSetRightMode,
@@ -41,6 +44,7 @@ export function EditorToolbar({
onRedo,
onCheck,
onApply,
onCancel,
onZoom,
onPan
}: EditorToolbarProps) {
@@ -107,7 +111,18 @@ export function EditorToolbar({
{checking ? "Проверка..." : conflictCount > 0 ? `Конфликты · ${conflictCount}` : "Проверить"}
</button>
<button className="tgu-button tgu-button--primary" type="button" onClick={onApply} disabled={!dirty || applying}>
{dirty && (
<button
className="tgu-button tgu-button--reject"
type="button"
onClick={onCancel}
disabled={canceling || applying}
>
{canceling ? "Отмена..." : "Отмена"}
</button>
)}
<button className="tgu-button tgu-button--primary" type="button" onClick={onApply} disabled={!dirty || applying || canceling}>
{applying ? "Применение..." : `Применить${addedCount > 0 ? ` · +${addedCount}` : ""}`}
</button>
</div>