fix: re-add name and description editing on tool mode except for Composio, fix MCP server code (#7901)
* Changed backend to contain readonly props for tools * Show name editing for not readonly tools * Fixed edit-tools test * Updated command to use "uvx" instead of "npx" for stability * Fixed mcp code for authentication on auto_login=false * removed args from component desc * [autofix.ci] apply automated fixes * making tool mode inputs the priority. * fix: Clean up comments and whitespace in component_tool.py * Fix column name * update the dispaly name in composio * fix format * ✨ (get-started-progress.tsx): add data-testid attribute to improve testability and accessibility 🔧 (user-progress-track.spec.ts): update test assertions to use the new data-testid attribute for get started progress title --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
This commit is contained in:
parent
82e08d6100
commit
75deddd102
8 changed files with 128 additions and 60 deletions
|
|
@ -84,7 +84,10 @@ export const GetStartedProgress: FC<{
|
|||
return (
|
||||
<div className="mt-3 h-[10.8rem] w-full">
|
||||
<div className="mb-2 flex items-center justify-between">
|
||||
<span className="text-sm font-semibold">
|
||||
<span
|
||||
className="text-sm font-semibold"
|
||||
data-testid="get_started_progress_title"
|
||||
>
|
||||
{percentageGetStarted >= 100 ? (
|
||||
<>
|
||||
<span>All Set</span> <span className="pl-1"> 🎉 </span>
|
||||
|
|
|
|||
|
|
@ -147,27 +147,27 @@ export default function ToolsTable({
|
|||
cellClass: "text-muted-foreground",
|
||||
},
|
||||
{
|
||||
field: isAction ? "name" : "tags",
|
||||
field: "name",
|
||||
headerName: isAction ? "Action" : "Slug",
|
||||
flex: 1,
|
||||
resizable: false,
|
||||
valueGetter: (params) =>
|
||||
isAction
|
||||
? params.data.name !== ""
|
||||
? parseString(params.data.name, [
|
||||
"snake_case",
|
||||
"no_blank",
|
||||
"uppercase",
|
||||
])
|
||||
: parseString(params.data.display_name, [
|
||||
"snake_case",
|
||||
"no_blank",
|
||||
"uppercase",
|
||||
])
|
||||
: parseString(params.data.tags.join(", "), [
|
||||
params.data.name !== ""
|
||||
? parseString(params.data.name, [
|
||||
"snake_case",
|
||||
"no_blank",
|
||||
"uppercase",
|
||||
]),
|
||||
])
|
||||
: isAction
|
||||
? parseString(params.data.display_name, [
|
||||
"snake_case",
|
||||
"no_blank",
|
||||
"uppercase",
|
||||
])
|
||||
: parseString(params.data.tags.join(", "), [
|
||||
"snake_case",
|
||||
"uppercase",
|
||||
]),
|
||||
cellClass: "text-muted-foreground",
|
||||
},
|
||||
{
|
||||
|
|
@ -281,7 +281,7 @@ export default function ToolsTable({
|
|||
>
|
||||
<SidebarHeader className="flex-none px-4 py-4">
|
||||
{focusedRow &&
|
||||
(isAction ? (
|
||||
(isAction || !focusedRow.readonly ? (
|
||||
<div className="flex flex-col gap-4">
|
||||
<div className="flex flex-col gap-2">
|
||||
<label
|
||||
|
|
|
|||
|
|
@ -69,18 +69,17 @@ const McpServerTab = ({ folderName }: { folderName: string }) => {
|
|||
const MCP_SERVER_JSON = `{
|
||||
"mcpServers": {
|
||||
"lf-${parseString(folderName ?? "project", ["snake_case", "no_blank", "lowercase"]).slice(0, 11)}": {
|
||||
"command": "npx",
|
||||
"command": "uvx",
|
||||
"args": [
|
||||
"-y",
|
||||
"supergateway",
|
||||
"--sse",
|
||||
"${apiUrl}"${
|
||||
"mcp-proxy",${
|
||||
isAutoLogin
|
||||
? ""
|
||||
: `,
|
||||
"--header",
|
||||
"x-api-key:${apiKey || "YOUR_API_KEY"}"`
|
||||
: `
|
||||
"--headers",
|
||||
"x-api-key",
|
||||
"${apiKey || "YOUR_API_KEY"}",`
|
||||
}
|
||||
"${apiUrl}"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,9 @@ test(
|
|||
await expect(
|
||||
page.getByTestId("empty_page_drag_and_drop_text"),
|
||||
).toBeVisible();
|
||||
await expect(page.getByTestId("app-header")).not.toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("get_started_progress_title"),
|
||||
).not.toBeVisible();
|
||||
|
||||
await page.getByTestId("empty_page_github_button").click();
|
||||
|
||||
|
|
@ -69,7 +71,7 @@ test(
|
|||
timeout: 100000,
|
||||
});
|
||||
|
||||
await expect(page.getByTestId("app-header")).toBeVisible();
|
||||
await expect(page.getByTestId("get_started_progress_title")).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("github_starred_icon_get_started"),
|
||||
).toBeVisible();
|
||||
|
|
@ -94,7 +96,7 @@ test(
|
|||
|
||||
await newPageDiscord.close();
|
||||
|
||||
await expect(page.getByTestId("app-header")).toBeVisible();
|
||||
await expect(page.getByTestId("get_started_progress_title")).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("discord_joined_icon_get_started"),
|
||||
).toBeVisible();
|
||||
|
|
@ -156,7 +158,9 @@ test(
|
|||
await expect(
|
||||
page.getByTestId("empty_page_drag_and_drop_text"),
|
||||
).toBeVisible();
|
||||
await expect(page.getByTestId("app-header")).not.toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("get_started_progress_title"),
|
||||
).not.toBeVisible();
|
||||
|
||||
await page.getByTestId("empty_page_github_button").click();
|
||||
|
||||
|
|
@ -188,7 +192,7 @@ test(
|
|||
timeout: 100000,
|
||||
});
|
||||
|
||||
await expect(page.getByTestId("app-header")).toBeVisible();
|
||||
await expect(page.getByTestId("get_started_progress_title")).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("github_starred_icon_get_started"),
|
||||
).toBeVisible();
|
||||
|
|
|
|||
|
|
@ -74,8 +74,50 @@ test(
|
|||
await page.locator('input[data-ref="eInput"]').nth(4).isChecked(),
|
||||
).toBe(false);
|
||||
|
||||
await page.locator('input[data-ref="eInput"]').nth(0).click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.getByRole("gridcell").nth(0).click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
expect(
|
||||
await page.locator('[data-testid="sidebar_header_name"]').isHidden(),
|
||||
).toBe(true);
|
||||
|
||||
expect(
|
||||
await page
|
||||
.locator('[data-testid="sidebar_header_description"]')
|
||||
.isHidden(),
|
||||
).toBe(true);
|
||||
|
||||
expect(
|
||||
await page.locator('[data-testid="input_update_name"]').isVisible(),
|
||||
).toBe(true);
|
||||
|
||||
expect(
|
||||
await page
|
||||
.locator('[data-testid="input_update_description"]')
|
||||
.isVisible(),
|
||||
).toBe(true);
|
||||
|
||||
await page.locator('[data-testid="input_update_name"]').fill("test name");
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page
|
||||
.locator('[data-testid="input_update_description"]')
|
||||
.fill("test description");
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.getByText("Close").last().click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
expect(await page.getByTestId("tool_test_name").isVisible()).toBe(true);
|
||||
|
||||
await page.waitForSelector(
|
||||
'[data-testid="generic-node-title-arrangement"]',
|
||||
{
|
||||
|
|
@ -93,38 +135,66 @@ test(
|
|||
.isVisible(),
|
||||
).toBe(true);
|
||||
|
||||
await page.getByTestId("div-tools_tools_metadata").click();
|
||||
await page.getByTestId("button_open_actions").click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
expect(
|
||||
await page.locator('input[data-ref="eInput"]').nth(3).isChecked(),
|
||||
).toBe(false);
|
||||
).toBe(true);
|
||||
|
||||
expect(
|
||||
await page.locator('input[data-ref="eInput"]').nth(4).isChecked(),
|
||||
).toBe(true);
|
||||
|
||||
await page.locator('input[data-ref="eInput"]').nth(4).click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
expect(
|
||||
await page.locator('input[data-ref="eInput"]').nth(4).isChecked(),
|
||||
).toBe(false);
|
||||
|
||||
await page.locator('input[data-ref="eInput"]').nth(3).click();
|
||||
await page.getByRole("gridcell").nth(0).click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
expect(
|
||||
await page.locator('input[data-ref="eInput"]').nth(3).isChecked(),
|
||||
).toBe(true);
|
||||
|
||||
await page.getByRole("gridcell").nth(0).click();
|
||||
|
||||
expect(
|
||||
await page.locator('[data-testid="sidebar_header_name"]').isVisible(),
|
||||
await page.locator('[data-testid="sidebar_header_name"]').isHidden(),
|
||||
).toBe(true);
|
||||
|
||||
expect(
|
||||
await page
|
||||
.locator('[data-testid="sidebar_header_description"]')
|
||||
.isHidden(),
|
||||
).toBe(true);
|
||||
|
||||
expect(
|
||||
await page.locator('[data-testid="input_update_name"]').isVisible(),
|
||||
).toBe(true);
|
||||
|
||||
expect(
|
||||
await page
|
||||
.locator('[data-testid="input_update_description"]')
|
||||
.isVisible(),
|
||||
).toBe(true);
|
||||
|
||||
expect(
|
||||
await page.locator('[data-testid="input_update_name"]').inputValue(),
|
||||
).toBe("test_name");
|
||||
|
||||
expect(
|
||||
await page
|
||||
.locator('[data-testid="input_update_description"]')
|
||||
.inputValue(),
|
||||
).toBe("test description");
|
||||
|
||||
await page.locator('[data-testid="input_update_name"]').fill("");
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.locator('[data-testid="input_update_description"]').fill("");
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.getByText("Close").last().click();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue