Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/backend/base/langflow/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
openrouter,
perplexity,
processing,
prototypes,
redis,
sambanova,
scrapegraph,
Expand Down Expand Up @@ -95,7 +94,6 @@
"input_output": "langflow.components.input_output",
"logic": "langflow.components.logic",
"custom_component": "langflow.components.custom_component",
"prototypes": "langflow.components.prototypes",
"openai": "langflow.components.openai",
"anthropic": "langflow.components.anthropic",
"google": "langflow.components.google",
Expand Down Expand Up @@ -215,7 +213,6 @@
"openrouter",
"perplexity",
"processing",
"prototypes",
"redis",
"sambanova",
"scrapegraph",
Expand Down
34 changes: 0 additions & 34 deletions src/backend/base/langflow/components/prototypes/__init__.py

This file was deleted.

73 changes: 0 additions & 73 deletions src/backend/base/langflow/components/prototypes/python_function.py

This file was deleted.

20 changes: 0 additions & 20 deletions src/backend/tests/unit/test_experimental_components.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ export const getPlaceholder = (
returnMessage: string = DEFAULT_PLACEHOLDER,
) => {
if (disabled) return RECEIVING_INPUT_VALUE;
return returnMessage;

return returnMessage || DEFAULT_PLACEHOLDER;
};
3 changes: 0 additions & 3 deletions src/frontend/tests/core/features/filterSidebar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ test(
await page.getByTestId("sidebar-legacy-switch").click();
await page.getByTestId("sidebar-options-trigger").click();

await expect(page.getByTestId("disclosure-prototypes")).toBeVisible();

await expect(page.getByTestId("input_outputChat Input")).toBeVisible();
await expect(page.getByTestId("input_outputChat Output")).toBeVisible();
await expect(page.getByTestId("processingPrompt Template")).toBeVisible();
Expand Down Expand Up @@ -117,7 +115,6 @@ test(

await expect(page.getByTestId("disclosure-data")).toBeVisible();
await expect(page.getByTestId("disclosure-helpers")).toBeVisible();
await expect(page.getByTestId("disclosure-prototypes")).toBeVisible();
await expect(page.getByTestId("disclosure-tools")).toBeVisible();

await expect(page.getByTestId("dataAPI Request")).toBeVisible();
Expand Down
84 changes: 59 additions & 25 deletions src/frontend/tests/core/unit/codeAreaModalComponent.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test } from "@playwright/test";
import { expect, test } from "@playwright/test";
import { addLegacyComponents } from "../../utils/add-legacy-components";
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";

Expand All @@ -9,36 +9,68 @@ test(
await awaitBootstrapTest(page);

await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
timeout: 3000,
});

await page.getByTestId("blank-flow").click();
await page.getByTestId("sidebar-search-input").click();
await page.getByTestId("sidebar-search-input").fill("python function");

await page.waitForSelector('[data-testid="sidebar-options-trigger"]', {
await page.getByTestId("canvas_controls_dropdown").click();

await page.waitForSelector('[data-testid="zoom_out"]', {
timeout: 3000,
});
await page.getByTestId("canvas_controls_dropdown").click();

await addLegacyComponents(page);
await page.getByTestId("sidebar-custom-component-button").click();

await page.waitForSelector('[data-testid="prototypesPython Function"]', {
await expect(page.getByTestId("code-button-modal")).toBeVisible({
timeout: 3000,
});
await page.getByTestId("prototypesPython Function").hover();
await page
.getByTestId("prototypesPython Function")
.getByTestId("icon-Plus")
.click();
await page.getByTestId("canvas_controls_dropdown").click();

await page.getByTestId("fit_view").click();
await page.getByTestId("zoom_out").click();
await page.getByTestId("canvas_controls_dropdown").click();
await page.getByTestId("code-button-modal").last().click();

const codeInputCode = `
# from langflow.field_typing import Data
from langflow.custom import Component
from langflow.io import CodeInput, Output
from langflow.schema import Data
from time import sleep
from langflow.schema.message import Message

class CustomComponent(Component):
display_name = "Custom Component"
description = "Use as a template to create your own component."
documentation: str = "https://docs.langflow.org/components-custom-components"
icon = "custom_components"
name = "CustomComponent"

inputs = [
CodeInput(
name="function_code",
display_name="Function Code",
info="The code for the function.",
),
]

outputs = [
Output(display_name="Output", name="output", method="build_output"),
]

def build_output(self) -> Message:
data = Data(value=self.function_code)
self.status = data
sleep(60)
return data`;

await page.locator(".ace_content").click();
await page.keyboard.press(`ControlOrMeta+A`);
await page.locator("textarea").fill(codeInputCode);

await page.getByText("Check & Save").last().click();

await page.getByTestId("div-generic-node").click();

await page.getByTestId("code-button-modal").click();
await page.getByTestId("codearea_code_function_code").click();

const wCode =
'def python_function(text: str) -> st: """This is a default python function that returns the input text""" return text';
Expand All @@ -53,17 +85,19 @@ class PythonFunctionComponent(CustomComponent):
"""This is a default python function that returns the input text"""
return text`;

await page
.locator("#CodeEditor div")
.filter({ hasText: "PythonFunctionComponent" })
.nth(1)
.click();
await page.locator("textarea").press("Control+a");
await page.locator(".ace_content").click();
await page.locator("textarea").press("ControlOrMeta+a");
await page.locator("textarea").fill(wCode);
await page.locator('//*[@id="checkAndSaveBtn"]').click();
await page.locator("textarea").press("Control+a");
await page.locator("textarea").fill(wCode);
await expect(
page.getByText("invalid syntax (<unknown>, line 1)"),
).toBeVisible({ timeout: 3000 });
await page.locator("textarea").press("ControlOrMeta+a");
await page.locator("textarea").fill(customComponentCode);
await page.locator('//*[@id="checkAndSaveBtn"]').click();
await expect(page.getByTestId("codearea_code_function_code")).toHaveText(
customComponentCode,
{ timeout: 3000 },
);
},
);
Loading