Ejemplo n.º 1
0
        public async Task <FlowConfig> Build(FlowGuiConfig inputGuiConfig)
        {
            var defaultConfig = await FlowData.GetDefaultConfig();

            var config = defaultConfig ?? FlowConfig.From(JsonConfig.CreateEmpty());

            // Set the flowName. This will be the case for new flow creation
            if (string.IsNullOrWhiteSpace(inputGuiConfig.Name))
            {
                string flowName = GenerateValidFlowName(inputGuiConfig.DisplayName);
                config.Name         = flowName;
                inputGuiConfig.Name = flowName;
            }
            var guiConfig = await HandleSensitiveData(inputGuiConfig);

            config.Name = guiConfig?.Name ?? config.Name;

            config.DisplayName = guiConfig?.DisplayName ?? config.DisplayName;
            config.Gui         = guiConfig.ToJson()._jt;

            return(FlowConfig.From(config.ToString()));
        }