public virtual async Task Ensure(ApplicationDeveloperClient appDev, string entApiKey)
        {
            await appDev.EnsureIDESettings(entApiKey);

            if (State.AddNew == null)
            {
                State.AddNew = new IdeSettingsAddNew();
            }

            if (State.Arch == null)
            {
                State.Arch = new IdeSettingsArchitechtureState()
                {
                    LCUs = new List <LowCodeUnitSetupConfig>()
                }
            }
            ;

            if (State.Config == null)
            {
                State.Config = new IdeSettingsConfigState()
                {
                    LCUConfig = new LowCodeUnitConfiguration()
                }
            }
            ;
        }
Exemple #2
0
        public virtual async Task SaveDAFApp(ApplicationDeveloperClient appDev, ApplicationManagerClient appMgr, string entLookup,
                                             string host, DataDAFAppDetails dafAppDetails)
        {
            log.LogInformation($"Saving DAF Application for {entLookup}");

            var saveRes = await appDev.SaveAppAndDAFApps(new SaveAppAndDAFAppsRequest()
            {
                Application = new Application()
                {
                    ID           = dafAppDetails.ID,
                    Name         = dafAppDetails.Name,
                    Description  = dafAppDetails.Description,
                    PathRegex    = $"{dafAppDetails.Path.TrimEnd('/')}*",
                    AccessRights = dafAppDetails.Security.AccessRights,
                    Licenses     = dafAppDetails.Security.Licenses,
                    IsPrivate    = dafAppDetails.Security.IsPrivate,
                    Priority     = dafAppDetails.Priority
                },
                DAFApps = dafAppDetails.Configs.Select(dafAppConfig =>
                {
                    return(new DAFApplication()
                    {
                        Lookup = dafAppConfig.Key,
                        Details = dafAppConfig.Value,
                        Priority = 500
                    });
                }).ToList()
            }, entLookup, host);

            State.ActiveDAFAppID = null;

            await LoadApplications(appMgr, entLookup);
        }
Exemple #3
0
        public virtual async Task SaveDataApp(ApplicationDeveloperClient appDev, ApplicationManagerClient appMgr, string entApiKey, string host,
                                              Application app)
        {
            var appResp = await appDev.SaveApp(app, host, "lcu-data-apps", entApiKey);

            await SetActiveApp(appMgr, entApiKey, appResp.Model);
        }
Exemple #4
0
        public virtual async Task SaveDataFlow(ApplicationManagerClient appMgr, ApplicationDeveloperClient appDev, string entLookup, DataFlow dataFlow)
        {
            // Create a new data flow
            if (String.IsNullOrEmpty(dataFlow.Lookup) && (dataFlow.ID == Guid.Empty))
            {
                var resp = await appMgr.SaveDataFlow(dataFlow, entLookup, State.EnvironmentLookup);

                State.IsCreating = true;
            }
            else
            {
                // If lookup property exists, look for existing data flow
                var existing = await appMgr.GetDataFlow(entLookup, State.EnvironmentLookup, dataFlow.Lookup);

                if (existing == null)
                {
                    // If it doesn't exist, clear the lookup
                    dataFlow.Lookup  = String.Empty;
                    State.IsCreating = true;
                }

                var resp = await appMgr.SaveDataFlow(dataFlow, entLookup, State.EnvironmentLookup);

                State.IsCreating = !resp.Status;
            }

            await LoadDataFlows(appMgr, appDev, entLookup);
        }
Exemple #5
0
        public virtual async Task DeleteDAFApp(ApplicationDeveloperClient appDev, ApplicationManagerClient appMgr, string entLookup,
                                               Guid appId, List <string> lookups)
        {
            log.LogInformation($"Deleting DAF Applications for {entLookup} from {appId} with lookups {lookups.ToJSON()}");

            var dafApps = await appMgr.ListDAFApplications(entLookup, appId);

            await lookups.Each(async lookup =>
            {
                lookup = lookup.Trim();

                var dafApp = dafApps.Model.FirstOrDefault(da => da.Lookup == lookup);

                if (dafApp != null)
                {
                    log.LogInformation($"Removing DAF Application {lookup} for {appId}");

                    await appDev.RemoveDAFApp(appId, dafApp.ID, entLookup);
                }
            });

            dafApps = await appMgr.ListDAFApplications(entLookup, appId);

            if (dafApps.Status && dafApps.Model.IsNullOrEmpty())
            {
                log.LogInformation($"Removing entire Application {appId}");

                await appDev.RemoveApp(appId, entLookup);
            }

            await LoadApplications(appMgr, entLookup);
        }
        public virtual async Task DeleteSideBarSection(ApplicationDeveloperClient appDev, ApplicationManagerClient appMgr, string entApiKey, string section)
        {
            await appDev.DeleteSideBarSection(section, entApiKey, State.SideBarEditActivity);

            //  TODO:  Also need to delete all related side bar actions for sections

            await LoadSideBarSections(appMgr, entApiKey);
        }
        public virtual async Task DeleteLCU(ApplicationDeveloperClient appDev, ApplicationManagerClient appMgr, string entApiKey, string lcuLookup)
        {
            await appDev.DeleteLCU(lcuLookup, entApiKey);

            //  TODO:  Need to delete other assets related to the LCU...  created apps, delete from filesystem, cleanup state??  Or what do we want to do with that stuff?

            await LoadLCUs(appMgr, entApiKey);
        }
        public static async Task <BaseResponse> SaveLCUCapabilities(this ApplicationDeveloperClient appDev, LowCodeUnitConfiguration lcuConfig, string entApiKey,
                                                                    string lcuLookup)
        {
            var response = await appDev.Post <LowCodeUnitConfiguration, BaseResponse>($"hosting/{entApiKey}/lcus/{lcuLookup}",
                                                                                      lcuConfig);

            return(response);
        }
        public Refresh(EnterpriseManagerClient entMgr, ApplicationManagerClient appMgr, ApplicationDeveloperClient appDev)
        {
            this.appDev = appDev;

            this.appMgr = appMgr;

            this.entMgr = entMgr;
        }
Exemple #10
0
        public Refresh(ApplicationDeveloperClient appDev, ApplicationManagerClient appMgr, IdentityManagerClient idMgr)
        {
            this.appDev = appDev;

            this.appMgr = appMgr;

            this.idMgr = idMgr;
        }
Exemple #11
0
        public SetActiveDataFlow(EnterpriseManagerClient entMgr, ApplicationManagerClient appMgr, ApplicationDeveloperClient appDev)
        {
            this.appDev = appDev;

            this.entMgr = entMgr;

            this.appMgr = appMgr;
        }
Exemple #12
0
        public virtual async Task LoadDataFlows(ApplicationManagerClient appMgr, ApplicationDeveloperClient appDev, string entApiKey)
        {
            var resp = await appMgr.ListDataFlows(entApiKey, State.EnvironmentLookup);

            State.DataFlows = resp.Model;

            await SetActiveDataFlow(appDev, entApiKey, State?.ActiveDataFlow?.Lookup);
        }
Exemple #13
0
        public virtual async Task CheckActiveDataFlowStatus(ApplicationDeveloperClient appDev, string entApiKey)
        {
            var resp = await appDev.CheckDataFlowStatus(new Personas.Applications.CheckDataFlowStatusRequest()
            {
                DataFlow = State.ActiveDataFlow,
                Type     = Personas.Applications.DataFlowStatusTypes.QuickView
            }, entApiKey, State.EnvironmentLookup);

            State.ActiveDataFlow = resp.DataFlow;
        }
Exemple #14
0
        public virtual async Task DeployDataFlow(ApplicationManagerClient appMgr, ApplicationDeveloperClient appDev, string entApiKey, string dataFlowLookup)
        {
            var resp = await appDev.DeployDataFlow(new Personas.Applications.DeployDataFlowRequest()
            {
                DataFlowLookup = dataFlowLookup
            }, entApiKey, State.EnvironmentLookup);

            State.IsCreating = !resp.Status;

            await LoadDataFlows(appMgr, appDev, entApiKey);
        }
        public BootOrganizationOrchestration(ApplicationDeveloperClient appDev, DevOpsArchitectClient devOpsArch, EnterpriseArchitectClient entArch,
                                             EnterpriseManagerClient entMgr)
        {
            this.appDev = appDev;

            this.devOpsArch = devOpsArch;

            this.entArch = entArch;

            this.entMgr = entMgr;
        }
        public virtual async Task SaveLCU(ApplicationDeveloperClient appDev, ApplicationManagerClient appMgr, string entApiKey, string host, LowCodeUnitSetupConfig lcu)
        {
            if (!lcu.Lookup.IsNullOrEmpty() && !lcu.NPMPackage.IsNullOrEmpty() && !lcu.PackageVersion.IsNullOrEmpty())
            {
                var ensured = await appDev.EnsureLowCodeUnitView(lcu, entApiKey, host);

                await LoadLCUs(appMgr, entApiKey);

                await ToggleAddNew(AddNewTypes.None);
            }
        }
Exemple #17
0
        public virtual async Task SetActiveDataFlow(ApplicationDeveloperClient appDev, string entApiKey, string dfLookup)
        {
            State.ActiveDataFlow = State.DataFlows.FirstOrDefault(df => df.Lookup == dfLookup);

            if (State.ActiveDataFlow != null)
            {
                //  Trying on refresh only...
                // await LoadModulePackSetup();

                await CheckActiveDataFlowStatus(appDev, entApiKey);
            }
        }
        public virtual async Task SaveLCUCapabilities(ApplicationDeveloperClient appDev, ApplicationManagerClient appMgr, string entApiKey, string host, string lcuLookup,
                                                      LowCodeUnitConfiguration lcuConfig)
        {
            if (!lcuLookup.IsNullOrEmpty())
            {
                var status = await appDev.SaveLCUCapabilities(lcuConfig, entApiKey, lcuLookup);

                await LoadLCUs(appMgr, entApiKey);

                await LoadLCUConfig(appMgr, entApiKey, lcuLookup);
            }
        }
Exemple #19
0
        public virtual async Task Mock(ApplicationManagerClient appMgr, ApplicationDeveloperClient appDev, EnterpriseManagerClient entMgr, string entLookup, string host)
        {
            State.EnvironmentLookup = Environment.GetEnvironmentVariable("EnvironmentLookup");

            if (State.DataFlows.IsNullOrEmpty())
            {
                State.DataFlows = new List <DataFlow>();
            }

            await LoadModulePackSetup(appMgr, entMgr, entLookup, host);

            await LoadDataFlows(appMgr, appDev, entLookup);
        }
        public virtual async Task SaveSectionAction(ApplicationDeveloperClient appDev, ApplicationManagerClient appMgr, string entApiKey, IDESideBarAction action)
        {
            if (!action.Action.IsNullOrEmpty() && !action.Title.IsNullOrEmpty())
            {
                action.Section = State.EditSection;

                var secAct = await appDev.SaveSectionAction(action, entApiKey, State.SideBarEditActivity);

                await LoadSecionActions(appMgr, entApiKey);

                await ToggleAddNew(AddNewTypes.None);
            }
        }
        public virtual async Task <Status> BootDataFlow(ApplicationDeveloperClient appDev)
        {
            if (!State.NewEnterpriseAPIKey.IsNullOrEmpty() && !State.EnvironmentLookup.IsNullOrEmpty())
            {
                var resp = await appDev.ConfigureNapkinIDEForDataFlows(State.NewEnterpriseAPIKey, State.Host);

                return(resp.Status);
            }
            else
            {
                return(Status.GeneralError.Clone("Boot not properly configured."));
            }
        }
Exemple #22
0
        public virtual async Task SetActiveDataFlow(ApplicationDeveloperClient appDev, string entLookup, DataFlow dataFlow)
        {
            State.ActiveDataFlow = dataFlow;

            State.IsCreating = false;

            // if (State.ActiveDataFlow != null)
            // {
            //     //  Trying on refresh only...
            //     // await LoadModulePackSetup();

            //     await CheckActiveDataFlowStatus(appDev, entLookup);
            // }
        }
Exemple #23
0
        // Note - Don't think we need the method below, we won't be provisioning anything during limited trial

        // public virtual async Task DeployDataFlow(string entLookup, string dataFlowLookup)
        // {
        //     var resp = await appDev.DeployDataFlow(new Personas.Applications.DeployDataFlowRequest()
        //     {
        //         DataFlowLookup = dataFlowLookup
        //     }, entLookup, State.EnvironmentLookup);

        //     State.IsCreating = !resp.Status;

        //     await LoadDataFlows(entLookup);
        // }

        // LoadDataFlows - Used to load the Emulated Data Flows
        public virtual async Task LoadDataFlows(ApplicationManagerClient appMgr, ApplicationDeveloperClient appDev, string entLookup)
        {
            var resp = await appMgr.ListDataFlows(entLookup, State.EnvironmentLookup);

            if (State.EnvironmentLookup == "limited-lcu-int")
            {
                State.EmulatedDataFlows = resp.Model.Where(df => df.Lookup == "edf").ToList();
            }
            else
            {
                State.EmulatedDataFlows = resp.Model.Where(df => df.Lookup == "ltd").ToList();
            }

            //await SetActiveDataFlow(appDev, entLookup, State.ActiveDataFlow);
        }
        public virtual async Task SaveActivity(ApplicationDeveloperClient appDev, ApplicationManagerClient appMgr, string entApiKey, IDEActivity activity)
        {
            if (!activity.Title.IsNullOrEmpty() && !activity.Lookup.IsNullOrEmpty() && !activity.Icon.IsNullOrEmpty())
            {
                var actResp = await appDev.SaveActivity(activity, entApiKey);

                activity = actResp.Model;

                await LoadActivities(appMgr, entApiKey);

                await ToggleAddNew(AddNewTypes.None);

                State.EditActivity = activity.Lookup;
            }
        }
        public virtual async Task AddDefaultDataFlowLCUs(ApplicationDeveloperClient appDev, ApplicationManagerClient appMgr, string entApiKey, string host)
        {
            var nideConfigured = await appDev.ConfigureNapkinIDEForDataFlows(entApiKey, host);

            if (nideConfigured.Status)
            {
                await LoadActivities(appMgr, entApiKey);

                await LoadSideBarSections(appMgr, entApiKey);

                await LoadSecionActions(appMgr, entApiKey);

                await LoadLCUs(appMgr, entApiKey);
            }
        }
Exemple #26
0
        public virtual async Task SaveDataFlow(ApplicationManagerClient appMgr, ApplicationDeveloperClient appDev, string entApiKey, DataFlow dataFlow)
        {
            var shouldSave = true;

            if (dataFlow.ID != Guid.Empty)
            {
                var existing = await appMgr.GetDataFlow(entApiKey, State.EnvironmentLookup, dataFlow.Lookup);

                shouldSave = existing == null;
            }

            if (shouldSave)
            {
                var resp = await appMgr.SaveDataFlow(dataFlow, entApiKey, State.EnvironmentLookup);

                State.IsCreating = !resp.Status;
            }
            else
            {
                State.IsCreating = true;    //  TODO:  How to get the error back to the user
            }
            await LoadDataFlows(appMgr, appDev, entApiKey);
        }
Exemple #27
0
        public DeleteSideBarSection(ApplicationDeveloperClient appDev, ApplicationManagerClient appMgr)
        {
            this.appDev = appDev;

            this.appMgr = appMgr;
        }
        public AddDefaultDataAppsLCUs(ApplicationDeveloperClient appDev, ApplicationManagerClient appMgr)
        {
            this.appDev = appDev;

            this.appMgr = appMgr;
        }
        public SaveSectionAction(ApplicationDeveloperClient appDev, ApplicationManagerClient appMgr)
        {
            this.appDev = appDev;

            this.appMgr = appMgr;
        }
        public DeleteDataFlow(ApplicationManagerClient appMgr, ApplicationDeveloperClient appDev)
        {
            this.appDev = appDev;

            this.appMgr = appMgr;
        }