From 46ab2d67dcb865b52a8ca5353a1c0edef2c91c3b Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Thu, 26 Jun 2025 13:43:29 +0300 Subject: [PATCH] order: revert cancel button for master --- apps/web/components/orders/order-buttons.tsx | 5 +++-- apps/web/components/shared/action-panel.tsx | 18 +----------------- apps/web/components/shared/status.tsx | 2 +- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/apps/web/components/orders/order-buttons.tsx b/apps/web/components/orders/order-buttons.tsx index 4ed46d3..12bfa69 100644 --- a/apps/web/components/orders/order-buttons.tsx +++ b/apps/web/components/orders/order-buttons.tsx @@ -36,8 +36,9 @@ export function OrderButtons({ documentId }: Readonly) { return ( handleCancel()} + onCancel={ + isCancelled || (!isMaster && isCancelling) || isCompleted ? undefined : () => handleCancel() + } onConfirm={ !isMaster || isApproved || isCancelled || isCancelling || isCompleted ? undefined diff --git a/apps/web/components/shared/action-panel.tsx b/apps/web/components/shared/action-panel.tsx index 495e4e9..4b1e134 100644 --- a/apps/web/components/shared/action-panel.tsx +++ b/apps/web/components/shared/action-panel.tsx @@ -2,10 +2,9 @@ import { Button } from '@repo/ui/components/ui/button'; import { Card } from '@repo/ui/components/ui/card'; -import { Ban, Check, Loader2, Lock, RotateCcw, Trash2, Unlock } from 'lucide-react'; +import { Ban, Check, Lock, RotateCcw, Trash2, Unlock } from 'lucide-react'; type FloatingActionPanelProps = { - readonly isCancelling?: boolean; readonly isOpen?: boolean; readonly onCancel?: () => void; readonly onConfirm?: () => void; @@ -15,7 +14,6 @@ type FloatingActionPanelProps = { }; export default function FloatingActionPanel({ - isCancelling = false, isOpen, onCancel, onConfirm, @@ -26,20 +24,6 @@ export default function FloatingActionPanel({ // Если не переданы обработчики, скрываем панель if (!onCancel && !onConfirm && !onDelete && !onRepeat && !onToggle) return null; - // Если слот отменяется, показываем статус вместо кнопок - if (isCancelling) { - return ( - -
- - - Слот отменяется... - -
-
- ); - } - return (
diff --git a/apps/web/components/shared/status.tsx b/apps/web/components/shared/status.tsx index 7d7e819..9a4eb1e 100644 --- a/apps/web/components/shared/status.tsx +++ b/apps/web/components/shared/status.tsx @@ -128,7 +128,7 @@ const ALERT_BY_STATE: Record = { cancelling: ( - Отменяется + Ожидает отмены ), closed: (