tgu: DELETE /plans/{draftPlanId} — отказ от черновика (бэкенд + кнопка «Отмена» и авто-отмена в редакторе)
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user