From 1f308fffc43d0a7f5101038b1c30338e774630ac Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Thu, 6 Feb 2025 23:33:54 +0800 Subject: [PATCH] Change position of generate with ai button in data schema (#1739) --- .../WorkflowDataSchemaInputGroup.tsx | 107 +++++++++--------- 1 file changed, 56 insertions(+), 51 deletions(-) diff --git a/skyvern-frontend/src/components/DataSchemaInputGroup/WorkflowDataSchemaInputGroup.tsx b/skyvern-frontend/src/components/DataSchemaInputGroup/WorkflowDataSchemaInputGroup.tsx index 29a770e8..56223ee4 100644 --- a/skyvern-frontend/src/components/DataSchemaInputGroup/WorkflowDataSchemaInputGroup.tsx +++ b/skyvern-frontend/src/components/DataSchemaInputGroup/WorkflowDataSchemaInputGroup.tsx @@ -61,20 +61,66 @@ function WorkflowDataSchemaInputGroup({ return (
-
-
- - +
+
+
+ + +
+ { + onChange( + checked ? JSON.stringify(exampleValue, null, 2) : "null", + ); + }} + />
- { - onChange(checked ? JSON.stringify(exampleValue, null, 2) : "null"); - }} - /> + {value !== "null" && !generateWithAIActive && ( + + )}
+ {value !== "null" && (
+ {generateWithAIActive ? ( +
+ { + setGenerateWithAIActive(false); + setGenerateWithAIPrompt(""); + }} + /> + { + setGenerateWithAIPrompt(event.target.value); + }} + placeholder="Describe how you want your output formatted" + /> + {getDataSchemaSuggestionMutation.isPending ? ( + + ) : ( + { + getDataSchemaSuggestionMutation.mutate(); + }} + /> + )} +
+ ) : null} - {value !== "null" && - (generateWithAIActive ? ( -
- { - setGenerateWithAIActive(false); - setGenerateWithAIPrompt(""); - }} - /> - { - setGenerateWithAIPrompt(event.target.value); - }} - placeholder="Describe how you want your output formatted" - /> - {getDataSchemaSuggestionMutation.isPending ? ( - - ) : ( - { - getDataSchemaSuggestionMutation.mutate(); - }} - /> - )} -
- ) : ( - - ))}
)}