From b362ab0be61ca66be0e3eaadedcdd20654733d68 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Wed, 12 Jun 2024 23:34:55 -0300 Subject: [PATCH] refactor: Update TextInput display name and info Update the display name and info of the TextInput component in TextInput.py to improve clarity and consistency. The display name is changed to "Text" and the info is updated to reflect that it expects text input. This change aligns with recent updates to the langflow library and enhances the usability of the component. --- .../langflow/components/inputs/TextInput.py | 6 ++--- .../components/parameterComponent/index.tsx | 22 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/backend/base/langflow/components/inputs/TextInput.py b/src/backend/base/langflow/components/inputs/TextInput.py index f8143d0c6..0dd59db42 100644 --- a/src/backend/base/langflow/components/inputs/TextInput.py +++ b/src/backend/base/langflow/components/inputs/TextInput.py @@ -13,9 +13,9 @@ class TextInput(TextComponent): StrInput( name="input_value", type=str, - display_name="Value", - info="Text or Data to be passed as input.", - input_types=["Data", "Text"], + display_name="Text", + info="Text to be passed as input.", + input_types=["Text", "Message"], ), StrInput( name="data_template", diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index 49566f273..c4e8684fb 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -115,7 +115,7 @@ export default function ParameterComponent({ handleUpdateValues, debouncedHandleUpdateValues, setNode, - setIsLoading + setIsLoading, ); const { handleNodeClass: handleNodeClassHook } = useHandleNodeClass( @@ -123,7 +123,7 @@ export default function ParameterComponent({ name, takeSnapshot, setNode, - updateNodeInternals + updateNodeInternals, ); const { handleRefreshButtonPress: handleRefreshButtonPressHook } = @@ -132,13 +132,13 @@ export default function ParameterComponent({ let disabled = edges.some( (edge) => - edge.targetHandle === scapedJSONStringfy(proxy ? { ...id, proxy } : id) + edge.targetHandle === scapedJSONStringfy(proxy ? { ...id, proxy } : id), ) ?? false; let disabledOutput = edges.some( (edge) => - edge.sourceHandle === scapedJSONStringfy(proxy ? { ...id, proxy } : id) + edge.sourceHandle === scapedJSONStringfy(proxy ? { ...id, proxy } : id), ) ?? false; const handleRefreshButtonPress = async (name, data) => { @@ -149,7 +149,7 @@ export default function ParameterComponent({ const handleOnNewValue = async ( newValue: string | string[] | boolean | Object[], - skipSnapshot: boolean | undefined = false + skipSnapshot: boolean | undefined = false, ): Promise => { handleOnNewValueHook(newValue, skipSnapshot); }; @@ -262,14 +262,14 @@ export default function ParameterComponent({ className={classNames( left ? "my-12 -ml-0.5 " : " my-12 -mr-0.5 ", "h-3 w-3 rounded-full border-2 bg-background", - !showNode ? "mt-0" : "" + !showNode ? "mt-0" : "", )} style={{ borderColor: color ?? nodeColors.unknown, }} onClick={() => { setFilterEdge( - groupByFamily(myData, tooltipTitle!, left, nodes!) + groupByFamily(myData, tooltipTitle!, left, nodes!), ); }} > @@ -347,8 +347,8 @@ export default function ParameterComponent({ className={classNames( "h-5 w-5 rounded-md", displayOutputPreview && !unknownOutput - ? " hover:bg-secondary-foreground/5 hover:text-medium-indigo" - : " cursor-not-allowed text-muted-foreground" + ? " hover:text-medium-indigo" + : " cursor-not-allowed text-muted-foreground", )} name={"ScanEye"} /> @@ -405,12 +405,12 @@ export default function ParameterComponent({ } className={classNames( left ? "-ml-0.5" : "-mr-0.5", - "h-3 w-3 rounded-full border-2 bg-background" + "h-3 w-3 rounded-full border-2 bg-background", )} style={{ borderColor: color ?? nodeColors.unknown }} onClick={() => { setFilterEdge( - groupByFamily(myData, tooltipTitle!, left, nodes!) + groupByFamily(myData, tooltipTitle!, left, nodes!), ); }} />