Skip to content

Commit 7f5a10a

Browse files
committed
some code cleanup and deleted redundant files
1 parent 35e9160 commit 7f5a10a

File tree

13 files changed

+11
-1172
lines changed

13 files changed

+11
-1172
lines changed

frontend/src/components/CanvasForPipelines/DestinationNode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const DestinationNode = ({ data: Data }: any) => {
6969
<div className="flex ml-5 flex-col items-center justify-center w-full">
7070
<div style={{ fontSize: "9px", lineHeight: "0.8rem" }} className="font-medium">{Data.name}</div>
7171
<div className="flex justify-between gap-2 mr-4 text-xs mt-2">
72-
{SourceLabel.map((source, index) => (
72+
{SourceLabel.map((source:any, index:number) => (
7373
<p style={{fontSize:"8px"}} key={index}>
7474
{source}
7575
</p>

frontend/src/components/CanvasForPipelines/PipelineCanvas.tsx

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
import React, { useState, useCallback, useEffect } from 'react';
1+
import React, { useState, useCallback } from 'react';
22
import ReactFlow, {
33
MiniMap,
44
Controls,
55
Background,
66
addEdge,
7-
useNodesState,
87
useEdgesState,
98
Edge,
109
Connection,
1110
ReactFlowInstance,
12-
Node
1311
} from 'reactflow';
1412
import 'reactflow/dist/style.css';
1513
import { SourceNode } from './SourceNode';
@@ -29,42 +27,14 @@ const nodeTypes = {
2927
};
3028

3129
const PipelineBuilder = () => {
32-
const fetchLocalStorageData = () => {
33-
const Nodes=JSON.parse(localStorage.getItem("Nodes") || "[]")
34-
return {Nodes};
35-
};
36-
const {Nodes } = fetchLocalStorageData();
37-
const initialNodes:any = [
38-
...Nodes.map((source: any, index: number) => ({
39-
id: source.component_id.toString(),
40-
type: source.component_role == "receiver" ? "source" : source.component_role == "exporter" ? "destination" : "processor",
41-
position: { x: 100, y: 100 + index * 100 },
42-
data: {
43-
label: (
44-
<div style={{ fontSize: '10px', textAlign: 'center' }}>
45-
{`${source.name}-(${index + 1})`}
46-
</div>
47-
),
48-
type: source.component_role,
49-
name: source.name,
50-
supported_signals: source.supported_signals,
51-
plugin_name: source.plugin_name,
52-
},
53-
})),
54-
];
5530

5631
const { nodeValue, setNodeValue, onNodesChange } = useNodeValue();
5732

58-
// useEffect(() => {
59-
// console.log("Updated nodeValue:", nodeValue);
60-
// }, [nodeValue]);
61-
6233
const validatedNodeValue = nodeValue.map((node, index) => ({
6334
...node,
6435
position: node.position || { x: 100, y: 100 + index * 100 }, // Fallback position
6536
}));
6637

67-
// const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
6838
const [edges, setEdges, onEdgesChange] = useEdgesState(JSON.parse(localStorage.getItem("PipelineEdges") || "[]"));
6939
const [reactFlowInstance, setReactFlowInstance] = useState<ReactFlowInstance | null>(null);
7040

@@ -83,8 +53,8 @@ const PipelineBuilder = () => {
8353
target: params.target,
8454
animated: true,
8555
data: {
86-
sourceComponentId: parseInt(params.source,10), // Use the source node's ID
87-
targetComponentId: parseInt(params.target,10), // Use the target node's ID
56+
sourceComponentId: parseInt(params.source,10),
57+
targetComponentId: parseInt(params.target,10),
8858
},
8959
},
9060
eds

frontend/src/components/CanvasForPipelines/ProcessorNode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export const ProcessorNode = ({ data }: any) => {
7878
};
7979
if(formData.name!==data.label && formData.http!==data.sublabel){
8080
setChangesLog(prev => [...prev, { type: 'processor', name: data.label, status: "edited" }])
81-
}
81+
}
8282

8383
setErrors(newErrors);
8484
setTouched({

frontend/src/components/CanvasForPipelines/SourceNode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const SourceNode = ({ data:Data }: any) => {
7979
<div className="bg-gray-200 rounded-tr-md rounded-br-md border-2 border-gray-300 p-4 h-[6rem] shadow-md w-[8rem] relative">
8080
<div style={{ fontSize: "9px", lineHeight: "0.8rem" }} className="font-medium">{Data.name}</div>
8181
<div className="flex justify-between gap-2 mr-2 text-xs mt-2">
82-
{SourceLabel.map((source, index) => (
82+
{SourceLabel.map((source:any, index:number) => (
8383
<p style={{fontSize:"8px"}} key={index}>
8484
{source}
8585
</p>

frontend/src/components/Pipelines/AddNewPipelineComponent/AddAgent.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,8 @@ const AddAgent = () => {
141141
setIsDialogOpen(true)
142142
}
143143

144-
const handleCheck = () => {
145-
setCheck(!check)
146-
}
147-
148144
const handleGetAgent = async () => {
149-
setFilteredAgents(agentValues); // Initialize filteredAgents with the full list
145+
setFilteredAgents(agentValues);
150146
};
151147

152148
useEffect(() => {

frontend/src/components/Pipelines/AddNewPipelineComponent/ProgressFlow.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const ProgressFlow = () => {
1616
<div className="relative">
1717
{steps.map((step, index) => (
1818
<div key={index} className="flex items-start space-x-4">
19-
{/* Circle Indicator */}
2019
<div className="relative flex flex-col items-center">
2120
<div
2221
className={`w-4 h-4 rounded-full border-2 ${index <= currentStep ? "border-blue-500 bg-blue-500" : "border-gray-300"

frontend/src/components/Pipelines/AddNewPipelineComponent/destination/DestinationConfiguration.tsx

Lines changed: 0 additions & 265 deletions
This file was deleted.

0 commit comments

Comments
 (0)