From c9246dec258311669541d468f5ea284eccb1693c Mon Sep 17 00:00:00 2001 From: Urtzi Alfaro Date: Tue, 18 Nov 2025 12:14:13 +0100 Subject: [PATCH] Add Modify button handler to enable PO editing from dashboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: - The "Modify" button in the Action Queue (Panel de Control) did nothing when clicked - Previously removed handleModify function and onModify prop during earlier refactoring - Users couldn't open the purchase order modal in edit mode from the dashboard Solution: - Added handleModify function that sets poModalMode to 'edit' before opening modal - Updated handleViewDetails to explicitly set mode to 'view' for clarity - Passed onModify handler to ActionQueueCard component How it works: - View button -> Opens modal in view mode (read-only) - Modify button -> Opens modal in edit mode (editable fields) - Both use the same PurchaseOrderDetailsModal component - Modal's initialMode prop controls which mode is shown first Now users can: - Click "View Details" to see PO information - Click "Modify" to edit priority, delivery date, notes, and product quantities - See real-time updates as they edit quantities and prices 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- frontend/src/pages/app/DashboardPage.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/app/DashboardPage.tsx b/frontend/src/pages/app/DashboardPage.tsx index 5496744c..688a7976 100644 --- a/frontend/src/pages/app/DashboardPage.tsx +++ b/frontend/src/pages/app/DashboardPage.tsx @@ -119,8 +119,16 @@ export function NewDashboardPage() { }; const handleViewDetails = (actionId: string) => { - // Open modal to show PO details + // Open modal to show PO details in view mode setSelectedPOId(actionId); + setPOModalMode('view'); + setIsPOModalOpen(true); + }; + + const handleModify = (actionId: string) => { + // Open modal to edit PO details + setSelectedPOId(actionId); + setPOModalMode('edit'); setIsPOModalOpen(true); }; @@ -273,6 +281,7 @@ export function NewDashboardPage() { onApprove={handleApprove} onReject={handleReject} onViewDetails={handleViewDetails} + onModify={handleModify} tenantId={tenantId} />