From ec122449d762486d370df4e63448dbac875d9618 Mon Sep 17 00:00:00 2001 From: Ankitkumar Satapara Date: Tue, 21 Apr 2026 00:21:47 +0530 Subject: [PATCH] Fixed issue on save load auth node error --- Examples/Nodify.Calculator/GraphSerializer.cs | 25 +++++++++++++++++++ .../Models/SaveGraphModel.cs | 4 +++ 2 files changed, 29 insertions(+) diff --git a/Examples/Nodify.Calculator/GraphSerializer.cs b/Examples/Nodify.Calculator/GraphSerializer.cs index 854ccf6..c39d891 100644 --- a/Examples/Nodify.Calculator/GraphSerializer.cs +++ b/Examples/Nodify.Calculator/GraphSerializer.cs @@ -43,6 +43,12 @@ namespace Nodify.Calculator nodeData.NthIndex = take.NthIndex; nodeData.IsRandom = take.IsRandom; break; + case AuthOperationViewModel auth: + nodeData.NodeType = "System"; + nodeData.SystemOp = auth.SystemOperationType.ToString(); + nodeData.AuthBaseUrl = auth.BaseUrl ?? string.Empty; + nodeData.AuthType = auth.AuthType ?? string.Empty; + break; case FunctionOperationViewModel func: nodeData.NodeType = "Function"; nodeData.FunctionName = func.FunctionName; @@ -417,6 +423,25 @@ namespace Nodify.Calculator op.Output.Add(DeserializeConnector(sc, false)); } } + else if (sysVm.SystemOperationType == SystemOperations.AUTH) + { + if (op is AuthOperationViewModel authOp) + { + authOp.BaseUrl = nd.AuthBaseUrl ?? string.Empty; + if (!string.IsNullOrEmpty(nd.AuthType)) + authOp.AuthType = nd.AuthType; + + // Restore data input connectors (preserve the leading triangle flow connector). + var dataInputs = op.Input.Where(i => i.Shape != ConnectorShape.Triangle).ToList(); + foreach (var d in dataInputs) op.Input.Remove(d); + + foreach (var ic in nd.InputConnectors) + { + if (ic.Shape == "Triangle") continue; + op.Input.Add(DeserializeConnector(ic, true)); + } + } + } else if (sysVm.SystemOperationType == SystemOperations.KNOT) { // Restore knot connector shape/color/datatype from saved data diff --git a/Examples/Nodify.Calculator/Models/SaveGraphModel.cs b/Examples/Nodify.Calculator/Models/SaveGraphModel.cs index e21c846..7f4beac 100644 --- a/Examples/Nodify.Calculator/Models/SaveGraphModel.cs +++ b/Examples/Nodify.Calculator/Models/SaveGraphModel.cs @@ -30,6 +30,10 @@ namespace Nodify.Calculator.Models public string SystemOp { get; set; } = string.Empty; public string ClassName { get; set; } = string.Empty; + // Auth node properties + public string AuthBaseUrl { get; set; } = string.Empty; + public string AuthType { get; set; } = string.Empty; + // Take node properties public int NthIndex { get; set; } public bool IsRandom { get; set; }