Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Fixes part of text input output component test where component popover elements are block others #2297

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1e1c11e
Fixes part of text input output component test where component popove…
596050 Jun 24, 2024
997726c
Merge branch 'dev' into fix/frontend_text_input_output_component_test
Cristhianzl Jun 24, 2024
c0624c4
chore: update linting workflows to include dev branch in merge_group
ogabrielluiz Jun 24, 2024
71a9ee5
Update README.md
rodrigosnader Jun 24, 2024
7337301
Update README.md
rodrigosnader Jun 24, 2024
546f856
chore: update package versions in pyproject.toml files
ogabrielluiz Jun 24, 2024
916fcdb
Add offset and focus utility functions
596050 Jun 24, 2024
bc334ca
Merge branch 'main' into dev
ogabrielluiz Jun 24, 2024
349913e
Merge branch 'dev' into fix/frontend_text_input_output_component_test
596050 Jun 24, 2024
022a5a2
Merge branch 'dev' into fix/frontend_text_input_output_component_test
596050 Jun 24, 2024
77e23d9
Refactor "created_at" column type for consistency and fix cancel midd…
ogabrielluiz Jun 24, 2024
6b67c49
chore: Update AstraDB.py imports and method signature for search_docu…
ogabrielluiz Jun 24, 2024
75fa498
chore: Update package versions in pyproject.toml files
ogabrielluiz Jun 24, 2024
c6ca57c
chore: Update run-name in release.yml for Langflow Release
ogabrielluiz Jun 24, 2024
f97c5be
Merge branch 'main' into dev
ogabrielluiz Jun 24, 2024
b02462f
fix: add call to _add_documents_to_vector_store in AstraDB component
ogabrielluiz Jun 24, 2024
fcdaeb3
chore: Fix missing parentheses in RequestCancelledMiddleware
ogabrielluiz Jun 24, 2024
c4d1427
chore: Update pydantic-settings and tenacity versions
ogabrielluiz Jun 24, 2024
7a6c957
Update README.md
rodrigosnader Jun 24, 2024
5d8abaf
Merge remote-tracking branch 'origin/main' into dev
ogabrielluiz Jun 24, 2024
dfd419e
fix fetch data to work even with autologin true
anovazzi1 Jun 24, 2024
853f548
format code
anovazzi1 Jun 24, 2024
b812146
Merge branch 'dev' into fix/frontend_text_input_output_component_test
596050 Jun 25, 2024
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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ Alternatively, click the **"Open in Cloud Shell"** button below to launch Google

Use this template to deploy Langflow 1.0 on Railway:


[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/JMXEWp?referralCode=MnPSdg)

## Deploy on Render
Expand Down
53 changes: 27 additions & 26 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langflow"
version = "1.0.2"
version = "1.0.3"
description = "A Python package with a built-in web application"
authors = ["Langflow <[email protected]>"]
maintainers = [
Expand Down
2 changes: 1 addition & 1 deletion src/backend/base/langflow/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async def dispatch(self, request: Request, call_next):
async def message_poller(sentinel, handler_task, request):
nonlocal queue
while True:
message = await request.receive
message = await request.receive()
if message["type"] == "http.disconnect":
handler_task.cancel()
return sentinel # Break the loop
Expand Down
12 changes: 6 additions & 6 deletions src/backend/base/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/backend/base/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langflow-base"
version = "0.0.78"
version = "0.0.79"
description = "A Python package with a built-in web application"
authors = ["Langflow <[email protected]>"]
maintainers = [
Expand Down
7 changes: 0 additions & 7 deletions src/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,6 @@ export default function App() {
if (isAuthenticated) {
try {
await setupAxiosDefaults();

const res = await getGlobalVariables();
setGlobalVariables(res);

checkHasStore();
fetchApiData();

resolve();
} catch (error) {
console.error("Failed to fetch data:", error);
Expand Down
18 changes: 16 additions & 2 deletions src/frontend/src/contexts/authContext.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import { createContext, useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
import Cookies from "universal-cookie";
import { getLoggedUser, requestLogout } from "../controllers/API";
import {
getGlobalVariables,
getLoggedUser,
requestLogout,
} from "../controllers/API";
import useAlertStore from "../stores/alertStore";
import { useFolderStore } from "../stores/foldersStore";
import { useGlobalVariablesStore } from "../stores/globalVariablesStore/globalVariables";
import { useStoreStore } from "../stores/storeStore";
import { Users } from "../types/api";
import { AuthContextType } from "../types/contexts/auth";

Expand Down Expand Up @@ -45,6 +51,11 @@ export function AuthProvider({ children }): React.ReactElement {
);

const getFoldersApi = useFolderStore((state) => state.getFoldersApi);
const setGlobalVariables = useGlobalVariablesStore(
(state) => state.setGlobalVariables,
);
const checkHasStore = useStoreStore((state) => state.checkHasStore);
const fetchApiData = useStoreStore((state) => state.fetchApiData);

useEffect(() => {
const storedAccessToken = cookies.get("access_token_lf");
Expand All @@ -66,8 +77,11 @@ export function AuthProvider({ children }): React.ReactElement {
setUserData(user);
const isSuperUser = user!.is_superuser;
setIsAdmin(isSuperUser);

getFoldersApi(true, true);
const res = await getGlobalVariables();
setGlobalVariables(res);
checkHasStore();
fetchApiData();
})
.catch((error) => {
setLoading(false);
Expand Down
47 changes: 33 additions & 14 deletions src/frontend/tests/end-to-end/textInputOutput.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { expect, test } from "@playwright/test";
import * as dotenv from "dotenv";
import path from "path";
import { focusElementsOnBoard, offsetElements } from "../reactflowE2ETestUtils";

test("TextInputOutputComponent", async ({ page }) => {
if (!process.env.CI) {
Expand Down Expand Up @@ -56,22 +57,40 @@ test("TextInputOutputComponent", async ({ page }) => {
await page.getByTitle("zoom out").click();
await page.getByTitle("zoom out").click();

// Click and hold on the first element
await page
.locator(
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[1]/div/div[2]/div[5]/button/div[1]',
)
.hover();
await page.mouse.down();
const component1 = await page.locator(
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[1]',
);

// Move to the second element
await page
.locator(
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[2]/div/div[2]/div[3]/div/button/div[1]',
)
.hover();
const element1 = await page.locator(
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[1]/div/div[2]/div[5]/button/div[1]',
);

// Release the mouse
const component2 = await page.locator(
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[2]',
);

const element2 = await page.locator(
'//*[@id="react-flow-id"]/div/div[1]/div/div/div[2]/div[2]/div/div[2]/div[3]/div/button/div[1]',
);

await offsetElements({
sourceElement: component1,
targetElement: component2,
page,
});

await focusElementsOnBoard({
page,
});

// ensure elements popups are not blocking
component1.blur();
component2.blur();

// Click and hold on the first element and move to the second element
await element1?.dragTo(element2);

// ensure the mouse button is up
await page.mouse.up();

await page.getByPlaceholder("Search").click();
Expand Down
26 changes: 26 additions & 0 deletions src/frontend/tests/reactflowE2ETestUtils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export const offsetElements = async ({
sourceElement,
targetElement,
page,
}) => {
// Get bounding boxes
const box1 = await sourceElement.boundingBox();
const box2 = await targetElement.boundingBox();

await page.mouse.move((box2?.x || 0) + 5, (box2?.y || 0) + 5);
await page.mouse.down();

// Move to the right of the source element
await page.mouse.move(
(box2?.x || 0) + (box2?.width || 0) / 2 + (box1?.width || 0),
box2?.y || 0,
);
await page.mouse.up();
};

export const focusElementsOnBoard = async ({ page }) => {
const focusElements = await page.locator(
'//*[@id="react-flow-id"]/div/div[2]/button[3]',
);
focusElements.click();
};
Loading