Add Modify button handler to enable PO editing from dashboard
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user