-
- {!isLoading || data?.length > 0 ? (
- data?.map((item, idx) => (
- {
- removeFlow(item.id);
- }}
- key={idx}
- data={item}
- disabled={isLoading}
- button={
- !is_component ? (
-
- ) : (
- <>>
- )
- }
- />
- ))
- ) : !isLoading && data?.length === 0 ? (
- <>You haven't created {name}s yet.>
- ) : (
- <>
-
-
- >
- )}
-
+ {!isLoading && data.length === 0 ? (
+
You haven't created any {name}s yet.
+ ) : (
+
+ {!isLoading || data?.length > 0 ? (
+ data?.map((item, idx) => (
+ {
+ removeFlow(item.id);
+ }}
+ key={idx}
+ data={item}
+ disabled={isLoading}
+ button={
+ !is_component ? (
+
+ ) : (
+ <>>
+ )
+ }
+ />
+ ))
+ ) : (
+ <>
+
+
+ >
+ )}
+
+ )}
{!isLoading && allData.length > 0 && (
diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts
index fd272e908..028be352d 100644
--- a/src/frontend/src/types/components/index.ts
+++ b/src/frontend/src/types/components/index.ts
@@ -283,9 +283,10 @@ export type PaginatorComponentType = {
export type ConfirmationModalType = {
onCancel?: () => void;
title: string;
- titleHeader: string;
+ titleHeader?: string;
asChild?: boolean;
- modalContentTitle: string;
+ destructive?: boolean;
+ modalContentTitle?: string;
cancelText: string;
confirmationText: string;
children: [
diff --git a/src/frontend/src/utils/styleUtils.ts b/src/frontend/src/utils/styleUtils.ts
index fc1b90929..9d5136975 100644
--- a/src/frontend/src/utils/styleUtils.ts
+++ b/src/frontend/src/utils/styleUtils.ts
@@ -99,6 +99,8 @@ import {
X,
XCircle,
Zap,
+ Combine,
+ TerminalIcon
} from "lucide-react";
import { FaApple, FaGithub } from "react-icons/fa";
import { AWSIcon } from "../icons/AWS";
@@ -111,7 +113,7 @@ import { EvernoteIcon } from "../icons/Evernote";
import { FBIcon } from "../icons/FacebookMessenger";
import { GitBookIcon } from "../icons/GitBook";
import { GoogleIcon } from "../icons/Google";
-import { GradientInfinity } from "../icons/GradientSparkles";
+import { GradientInfinity, GradientSave } from "../icons/GradientSparkles";
import { HuggingFaceIcon } from "../icons/HuggingFace";
import { IFixIcon } from "../icons/IFixIt";
import { MetaIcon } from "../icons/Meta";
@@ -260,7 +262,7 @@ export const nodeIconsLucide: iconsType = {
advanced: Laptop2,
chat: MessageCircle,
embeddings: Fingerprint,
- saved_components: Save,
+ saved_components: GradientSave,
documentloaders: Paperclip,
vectorstores: Layers,
toolkits: Hammer,
@@ -356,4 +358,6 @@ export const nodeIconsLucide: iconsType = {
Link,
ToyBrick,
RefreshCcw,
+ Combine,
+ TerminalIcon,
};
diff --git a/tests/test_cache.py b/tests/test_cache.py
index 925402769..c2c706ee9 100644
--- a/tests/test_cache.py
+++ b/tests/test_cache.py
@@ -1,7 +1,7 @@
import json
+from langflow.graph import Graph
import pytest
-from langflow.graph import Graph
def get_graph(_type="basic"):
@@ -41,5 +41,5 @@ def langchain_objects_are_equal(obj1, obj2):
def test_build_graph(client, basic_data_graph):
graph = Graph.from_payload(basic_data_graph)
assert graph is not None
- assert len(graph.vertices) == len(basic_data_graph["nodes"])
+ assert len(graph.nodes) == len(basic_data_graph["nodes"])
assert len(graph.edges) == len(basic_data_graph["edges"])
diff --git a/tests/test_endpoints.py b/tests/test_endpoints.py
index aacc009d0..338224004 100644
--- a/tests/test_endpoints.py
+++ b/tests/test_endpoints.py
@@ -1,18 +1,17 @@
-from collections import namedtuple
+import time
import uuid
-from langflow.processing.process import Result
-from langflow.services.auth.utils import get_password_hash
-from langflow.services.database.models.api_key.model import ApiKey
-from langflow.services.deps import get_settings_service
-from langflow.services.database.utils import session_getter
-from langflow.services.deps import get_db_service
+from collections import namedtuple
+
import pytest
from fastapi.testclient import TestClient
from langflow.interface.tools.constants import CUSTOM_TOOLS
+from langflow.processing.process import Result
+from langflow.services.auth.utils import get_password_hash
+from langflow.services.database.models.api_key.model import ApiKey
+from langflow.services.database.utils import session_getter
+from langflow.services.deps import get_db_service, get_settings_service
from langflow.template.frontend_node.chains import TimeTravelGuideChainNode
-import time
-
def run_post(client, flow_id, headers, post_data):
response = client.post(
@@ -25,7 +24,7 @@ def run_post(client, flow_id, headers, post_data):
# Helper function to poll task status
-def poll_task_status(client, headers, href, max_attempts=20, sleep_time=1):
+def poll_task_status(client, headers, href, max_attempts=20, sleep_time=2):
for _ in range(max_attempts):
task_status_response = client.get(
href,
diff --git a/tests/test_graph.py b/tests/test_graph.py
index 020642798..9a69e33b5 100644
--- a/tests/test_graph.py
+++ b/tests/test_graph.py
@@ -81,8 +81,8 @@ def test_graph_structure(basic_graph):
assert isinstance(node, Vertex)
for edge in basic_graph.edges:
assert isinstance(edge, Edge)
- assert edge.source_id in basic_graph.vertex_ids
- assert edge.target_id in basic_graph.vertex_ids
+ assert edge.source_id in basic_graph.vertex_map.keys()
+ assert edge.target_id in basic_graph.vertex_map.keys()
def test_circular_dependencies(basic_graph):
diff --git a/tests/test_loading.py b/tests/test_loading.py
index e5c409c93..94cf34d8e 100644
--- a/tests/test_loading.py
+++ b/tests/test_loading.py
@@ -1,9 +1,10 @@
import json
+
import pytest
from langchain.chains.base import Chain
-from langflow.processing.process import load_flow_from_json
from langflow.graph import Graph
-from langflow.utils.payload import get_root_node
+from langflow.processing.process import load_flow_from_json
+from langflow.utils.payload import get_root_vertex
def test_load_flow_from_json():
@@ -22,14 +23,15 @@ def test_load_flow_from_json_with_tweaks():
assert loaded.llm.model_name == "test model"
-def test_get_root_node():
+def test_get_root_vertex():
with open(pytest.BASIC_EXAMPLE_PATH, "r") as f:
flow_graph = json.load(f)
data_graph = flow_graph["data"]
nodes = data_graph["nodes"]
edges = data_graph["edges"]
graph = Graph(nodes, edges)
- root = get_root_node(graph)
+ root = get_root_vertex(graph)
assert root is not None
assert hasattr(root, "id")
assert hasattr(root, "data")
+ assert hasattr(root, "data")