From 208b5d4bb8af097d86ba9955e1dfe8ecb4e3cc40 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 28 Jul 2023 14:45:05 -0300 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=93=9D=20docs(custom.mdx):=20improve?= =?UTF-8?q?=20formatting=20and=20add=20missing=20punctuation=20in=20the=20?= =?UTF-8?q?table=20description=20=F0=9F=90=9B=20fix(custom.mdx):=20add=20m?= =?UTF-8?q?issing=20punctuation=20in=20the=20field=20descriptions=20?= =?UTF-8?q?=E2=9C=A8=20feat(custom.mdx):=20add=20clarification=20to=20the?= =?UTF-8?q?=20field=20descriptions=20and=20provide=20examples=20for=20some?= =?UTF-8?q?=20fields=20=F0=9F=93=9D=20docs(custom.mdx):=20add=20missing=20?= =?UTF-8?q?punctuation=20in=20the=20method=20description=20=F0=9F=90=9B=20?= =?UTF-8?q?fix(custom.mdx):=20add=20comment=20to=20clarify=20the=20purpose?= =?UTF-8?q?=20of=20the=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs/components/custom.mdx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/docs/components/custom.mdx b/docs/docs/components/custom.mdx index e2bcab798..9f7fa65ca 100644 --- a/docs/docs/components/custom.mdx +++ b/docs/docs/components/custom.mdx @@ -36,17 +36,17 @@ Their values are of type _`dict`_ with any of the following keys (all of them ar | Key | Description | | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| _`field_type: str`_ | The type of the field (can be any of the types supported by the _`build`_ method) | -| _`is_list: bool`_ | If the field is a list | +| _`field_type: str`_ | The type of the field (can be any of the types supported by the _`build`_ method, passed as a string). | +| _`is_list: bool`_ | If the field is a list. | | _`options: List[str]`_ | This defines the options to be displayed. The _`field_type`_ should invariably be _`str`_. If you set the _`value`_ attribute to one of the options, it will be selected by default. Having _`options`_ will display a dropdown menu. | -| _`multiline: bool`_ | When the field is a string, if it should be multiline | -| _`input_types: List[str]`_ | To be used when you want a _`str`_ field to have connectable handles | -| _`display_name: str`_ | To define the name of the field | -| _`advanced: bool`_ | To hide the field in default view | -| _`password: bool`_ | To mask the input text | -| _`required: bool`_ | To make the field required | -| _`info: str`_ | To add a tooltip to the field | -| _`file_types: List[str]`_ | This is a requirement if the _`field_type`_ is file. Defines which file types will be accepted. For example, json, yaml or yml | +| _`multiline: bool`_ | When the field is a string, this would allow the user to open a text editor. | +| _`input_types: List[str]`_ | To be used when you want a _`str`_ field to have connectable handles. | +| _`display_name: str`_ | To define the name of the field. | +| _`advanced: bool`_ | To hide the field in default view. This is useful when a field is for advanced users or you simply want to remove it from view. | +| _`password: bool`_ | To mask the input text. This is used to allow the user to hide the values of the text (e.g. API keys). | +| _`required: bool`_ | To make the field required. | +| _`info: str`_ | To add a tooltip to the field. | +| _`file_types: List[str]`_ | This is a requirement if the _`field_type`_ is file. Defines which file types will be accepted. For example, json, yaml or yml. | The CustomComponent class provides the following methods: @@ -67,7 +67,7 @@ def build(self, flow_name: str) raise ValueError(f"Flow {flow_name} not found") flow = self.load_flow(found_flow.id) - result = flow() + result = flow() # Run the flow return result ``` From 641bcb4a58586bf5585dd0614dfb583d6a943548 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Fri, 28 Jul 2023 14:48:40 -0300 Subject: [PATCH 2/3] Fixed unique keys bug --- src/backend/.gitignore | 3 +++ .../pages/FlowPage/components/extraSidebarComponent/index.tsx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/.gitignore b/src/backend/.gitignore index 9af18a35f..6f5ccc322 100644 --- a/src/backend/.gitignore +++ b/src/backend/.gitignore @@ -131,3 +131,6 @@ dmypy.json # Pyre type checker .pyre/ + +# Custom Components +langflow/components diff --git a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx index 45aa67526..87af2261c 100644 --- a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx @@ -137,7 +137,7 @@ export default function ExtraSidebar() { Object.keys(dataFilter[d]).length > 0 ? ( Date: Fri, 28 Jul 2023 14:51:06 -0300 Subject: [PATCH 3/3] Fixed key bug inside accordion --- .../pages/FlowPage/components/extraSidebarComponent/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx index 3a97b81b7..a52a21801 100644 --- a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx @@ -167,7 +167,7 @@ export default function ExtraSidebar() {