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.
This commit is contained in:
Rodrigo 2024-06-12 23:34:55 -03:00
commit b362ab0be6
2 changed files with 14 additions and 14 deletions

View file

@ -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",

View file

@ -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<void> => {
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!),
);
}}
></Handle>
@ -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!),
);
}}
/>