Minimize node fixes (#1029)
Fix Filter edges and unknown handle showing up when node are minimized
This commit is contained in:
commit
5cd44bb288
5 changed files with 16 additions and 5 deletions
|
|
@ -164,7 +164,7 @@ class FrontendNode(BaseModel):
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Handles specific field values for certain fields."""
|
"""Handles specific field values for certain fields."""
|
||||||
if key == "headers":
|
if key == "headers":
|
||||||
field.value = """{'Authorization': 'Bearer <token>'}"""
|
field.value = """{"Authorization": "Bearer <token>"}"""
|
||||||
FrontendNode._handle_model_specific_field_values(field, key, name)
|
FrontendNode._handle_model_specific_field_values(field, key, name)
|
||||||
FrontendNode._handle_api_key_specific_field_values(field, key, name)
|
FrontendNode._handle_api_key_specific_field_values(field, key, name)
|
||||||
|
|
||||||
|
|
@ -249,4 +249,4 @@ class FrontendNode(BaseModel):
|
||||||
if "default" in value:
|
if "default" in value:
|
||||||
field.value = value["default"]
|
field.value = value["default"]
|
||||||
if key == "headers":
|
if key == "headers":
|
||||||
field.value = """{'Authorization': 'Bearer <token>'}"""
|
field.value = """{"Authorization": "Bearer <token>"}"""
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@ class HeadersDefaultValueFormatter(FieldFormatter):
|
||||||
def format(self, field: TemplateField, name: Optional[str] = None) -> None:
|
def format(self, field: TemplateField, name: Optional[str] = None) -> None:
|
||||||
key = field.name
|
key = field.name
|
||||||
if key == "headers":
|
if key == "headers":
|
||||||
field.value = """{'Authorization': 'Bearer <token>'}"""
|
field.value = """{"Authorization": "Bearer <token>"}"""
|
||||||
|
|
||||||
|
|
||||||
class DictCodeFileFormatter(FieldFormatter):
|
class DictCodeFileFormatter(FieldFormatter):
|
||||||
|
|
|
||||||
|
|
@ -431,7 +431,7 @@ def set_headers_value(value: Dict[str, Any]) -> None:
|
||||||
"""
|
"""
|
||||||
Sets the value for the 'headers' key.
|
Sets the value for the 'headers' key.
|
||||||
"""
|
"""
|
||||||
value["value"] = """{'Authorization': 'Bearer <token>'}"""
|
value["value"] = """{"Authorization": "Bearer <token>"}"""
|
||||||
|
|
||||||
|
|
||||||
def add_options_to_field(
|
def add_options_to_field(
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,9 @@ export default function ParameterComponent({
|
||||||
type === "code" ||
|
type === "code" ||
|
||||||
type === "prompt" ||
|
type === "prompt" ||
|
||||||
type === "file" ||
|
type === "file" ||
|
||||||
type === "int") &&
|
type === "int" ||
|
||||||
|
type === "dict" ||
|
||||||
|
type === "NestedDict") &&
|
||||||
!optionalHandle ? (
|
!optionalHandle ? (
|
||||||
<></>
|
<></>
|
||||||
) : (
|
) : (
|
||||||
|
|
@ -229,6 +231,9 @@ export default function ParameterComponent({
|
||||||
borderColor: color,
|
borderColor: color,
|
||||||
top: position,
|
top: position,
|
||||||
}}
|
}}
|
||||||
|
onClick={() => {
|
||||||
|
setFilterEdge(groupedEdge.current);
|
||||||
|
}}
|
||||||
></Handle>
|
></Handle>
|
||||||
</ShadTooltip>
|
</ShadTooltip>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -280,6 +280,12 @@ export function TabsProvider({ children }: { children: ReactNode }) {
|
||||||
let id;
|
let id;
|
||||||
if (file) {
|
if (file) {
|
||||||
let text = await file.text();
|
let text = await file.text();
|
||||||
|
let fileData = JSON.parse(text);
|
||||||
|
if (fileData.flows) {
|
||||||
|
fileData.flows.forEach((flow: FlowType) => {
|
||||||
|
id = addFlow(flow, newProject);
|
||||||
|
});
|
||||||
|
}
|
||||||
// parse the text into a JSON object
|
// parse the text into a JSON object
|
||||||
let flow: FlowType = JSON.parse(text);
|
let flow: FlowType = JSON.parse(text);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue