From d550da0e1e190d8d0e54df23763a2c34fde4d7d1 Mon Sep 17 00:00:00 2001 From: Devika Date: Fri, 23 May 2025 16:05:12 +0530 Subject: [PATCH] Changed the font color in the Add Table popup --- src/components/DataflowCanvasUpdated.jsx | 59 ++++++++++++++++++------ src/components/TableCreationPopup.jsx | 17 ++++--- 2 files changed, 55 insertions(+), 21 deletions(-) diff --git a/src/components/DataflowCanvasUpdated.jsx b/src/components/DataflowCanvasUpdated.jsx index 5c59940..1e319ec 100644 --- a/src/components/DataflowCanvasUpdated.jsx +++ b/src/components/DataflowCanvasUpdated.jsx @@ -228,7 +228,18 @@ const CustomEdge = ({ id, source, target, sourceX, sourceY, targetX, targetY, so }; // Process Node (represents ETL or data transformation) -const ProcessNode = ({ data }) => { +const ProcessNode = ({ data, id }) => { + // Function to handle process edit + const handleProcessEdit = () => { + // Find the process in the mock data + const process = mockApiData.processes.find(p => p.slug === id); + if (process) { + // We'll use window.processEditCallback which will be set in the main component + if (window.processEditCallback) { + window.processEditCallback(process); + } + } + }; // Determine status color const statusColor = data.status === 'active' ? '#52c41a' : '#ff4d4f'; const isActive = data.status === 'active'; @@ -334,7 +345,7 @@ const ProcessNode = ({ data }) => { alignItems: 'center', justifyContent: 'center', padding: '15px', - pointerEvents: 'none' // Allow clicks to pass through to the node + pointerEvents: 'auto' // Enable clicks on the content }}> {/* Icon and title */}
{ alignItems: 'center', marginBottom: '5px' }}> -
+
@@ -1176,6 +1193,20 @@ const DataflowCanvas = () => { } }, [reactFlowInstance]); + // Set up a global callback for process editing + // This is used by the ProcessNode component + useEffect(() => { + window.processEditCallback = (process) => { + setSelectedProcessForEdit(process); + setShowProcessForm(true); + }; + + return () => { + // Clean up when component unmounts + window.processEditCallback = null; + }; + }, []); + return (
{ // Wrap with ReactFlowProvider const DataflowCanvasWithProvider = () => ( - + ); diff --git a/src/components/TableCreationPopup.jsx b/src/components/TableCreationPopup.jsx index 6a277db..8418881 100644 --- a/src/components/TableCreationPopup.jsx +++ b/src/components/TableCreationPopup.jsx @@ -77,7 +77,7 @@ const TableCreationPopup = ({ onClose, onCreateTable }) => { boxShadow: '0 4px 12px rgba(0, 0, 0, 0.15)' }}>
-

+

{getTableTypeIcon()} Create New Table

@@ -97,7 +97,7 @@ const TableCreationPopup = ({ onClose, onCreateTable }) => {
-
-