From 6e41cd850e8504a18c5bb1e2526134579ee74f6d Mon Sep 17 00:00:00 2001 From: Michael Atwood Date: Wed, 30 Sep 2020 22:53:41 -0700 Subject: [PATCH 1/2] allows page to find Custom Index page in Module from Actions Property --- Oqtane.Client/UI/SiteRouter.razor | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/Oqtane.Client/UI/SiteRouter.razor b/Oqtane.Client/UI/SiteRouter.razor index c395a868..797f962b 100644 --- a/Oqtane.Client/UI/SiteRouter.razor +++ b/Oqtane.Client/UI/SiteRouter.razor @@ -76,7 +76,7 @@ User user = null; List modules; var moduleid = -1; - var action = string.Empty; + var action = Constants.DefaultAction; var urlparameters = string.Empty; var editmode = false; var reload = Reload.None; @@ -459,25 +459,18 @@ typename = Constants.ErrorModule; } - if (module.ModuleId == moduleid && action != "") + // check if the module defines custom routes*@ + if (module.ModuleDefinition.ControlTypeRoutes != "") { - // check if the module defines custom routes - if (module.ModuleDefinition.ControlTypeRoutes != "") + foreach (string route in module.ModuleDefinition.ControlTypeRoutes.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) { - foreach (string route in module.ModuleDefinition.ControlTypeRoutes.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) + if (route.StartsWith(action + "=")) { - if (route.StartsWith(action + "=")) - { - typename = route.Replace(action + "=", ""); - } + typename = route.Replace(action + "=", ""); } } - module.ModuleType = typename.Replace(Constants.ActionToken, action); - } - else - { - module.ModuleType = typename.Replace(Constants.ActionToken, Constants.DefaultAction); } + module.ModuleType = typename.Replace(Constants.ActionToken, action); // get additional metadata from IModuleControl interface typename = module.ModuleType; From c2ca55627e9590484651fb85e1a45ad0283c98bd Mon Sep 17 00:00:00 2001 From: Michael Atwood Date: Sat, 3 Oct 2020 12:12:23 -0700 Subject: [PATCH 2/2] comment where index page is specifed if no action --- Oqtane.Client/UI/SiteRouter.razor | 1 + 1 file changed, 1 insertion(+) diff --git a/Oqtane.Client/UI/SiteRouter.razor b/Oqtane.Client/UI/SiteRouter.razor index 797f962b..a93661b7 100644 --- a/Oqtane.Client/UI/SiteRouter.razor +++ b/Oqtane.Client/UI/SiteRouter.razor @@ -202,6 +202,7 @@ { modIdPos = i + 1; actionPos = modIdPos + 1; + // Route to index page if no action is specifed if (actionPos > segments.Length - 1) { action = Constants.DefaultAction;