diff --git a/Oqtane.Client/Modules/Admin/Jobs/Log.razor b/Oqtane.Client/Modules/Admin/Jobs/Log.razor index 9efc1486..2d4ef706 100644 --- a/Oqtane.Client/Modules/Admin/Jobs/Log.razor +++ b/Oqtane.Client/Modules/Admin/Jobs/Log.razor @@ -22,7 +22,7 @@ else @context.FinishDate - @context.Notes + @((MarkupString)context.Notes) } diff --git a/Oqtane.Client/Modules/Admin/ModuleDefinitions/Edit.razor b/Oqtane.Client/Modules/Admin/ModuleDefinitions/Edit.razor index 743938bf..51ed8992 100644 --- a/Oqtane.Client/Modules/Admin/ModuleDefinitions/Edit.razor +++ b/Oqtane.Client/Modules/Admin/ModuleDefinitions/Edit.razor @@ -75,12 +75,20 @@ - + + + + + + + + + @@ -110,6 +118,7 @@ private string _url = ""; private string _contact = ""; private string _license = ""; + private string _runtimes = ""; private string _permissions; private string _createdby; private DateTime _createdon; @@ -139,6 +148,7 @@ _url = moduleDefinition.Url; _contact = moduleDefinition.Contact; _license = moduleDefinition.License; + _runtimes = moduleDefinition.Runtimes; _permissions = moduleDefinition.Permissions; _createdby = moduleDefinition.CreatedBy; _createdon = moduleDefinition.CreatedOn; diff --git a/Oqtane.Client/Modules/Admin/Modules/Import.razor b/Oqtane.Client/Modules/Admin/Modules/Import.razor index e341ad78..1d99bcb9 100644 --- a/Oqtane.Client/Modules/Admin/Modules/Import.razor +++ b/Oqtane.Client/Modules/Admin/Modules/Import.razor @@ -31,9 +31,15 @@ { try { - await ModuleService.ImportModuleAsync(ModuleState.ModuleId, _content); - StateHasChanged(); - NavigationManager.NavigateTo(NavigateUrl()); + bool success = await ModuleService.ImportModuleAsync(ModuleState.ModuleId, _content); + if (success) + { + AddModuleMessage("Content Imported Successfully", MessageType.Success); + } + else + { + AddModuleMessage("A Problem Was Encountered Importing Content. Please Ensure The Content Is Formatted Correctly For The Module.", MessageType.Warning); + } } catch (Exception ex) { diff --git a/Oqtane.Client/Modules/Admin/Pages/Add.razor b/Oqtane.Client/Modules/Admin/Pages/Add.razor index 194b0e13..9e73435b 100644 --- a/Oqtane.Client/Modules/Admin/Pages/Add.razor +++ b/Oqtane.Client/Modules/Admin/Pages/Add.razor @@ -162,17 +162,6 @@ - - - - - - - - @@ -217,7 +206,6 @@ private string _isnavigation = "True"; private string _url; private string _ispersonalizable = "False"; - private string _mode = "view"; private string _themetype = "-"; private string _layouttype = "-"; private string _containertype = "-"; @@ -373,7 +361,6 @@ page.IsNavigation = (_isnavigation == null ? true : Boolean.Parse(_isnavigation)); page.Url = _url; - page.EditMode = (_mode == "edit" ? true : false); page.ThemeType = (_themetype != "-") ? _themetype : string.Empty; if (!string.IsNullOrEmpty(page.ThemeType) && page.ThemeType == PageState.Site.DefaultThemeType) { diff --git a/Oqtane.Client/Modules/Admin/Pages/Edit.razor b/Oqtane.Client/Modules/Admin/Pages/Edit.razor index 4b28d530..ee191dd8 100644 --- a/Oqtane.Client/Modules/Admin/Pages/Edit.razor +++ b/Oqtane.Client/Modules/Admin/Pages/Edit.razor @@ -173,17 +173,6 @@ - - - - - - - - @@ -235,7 +224,6 @@ private string _isnavigation; private string _url; private string _ispersonalizable; - private string _mode; private string _themetype = "-"; private string _layouttype = "-"; private string _containertype = "-"; @@ -290,7 +278,6 @@ _isnavigation = page.IsNavigation.ToString(); _url = page.Url; _ispersonalizable = page.IsPersonalizable.ToString(); - _mode = (page.EditMode) ? "edit" : "view"; _themetype = page.ThemeType; if (_themetype == PageState.Site.DefaultThemeType) { @@ -463,7 +450,6 @@ } page.IsNavigation = (_isnavigation == null || Boolean.Parse(_isnavigation)); page.Url = _url; - page.EditMode = (_mode == "edit"); page.ThemeType = (_themetype != "-") ? _themetype : string.Empty; if (!string.IsNullOrEmpty(page.ThemeType) && page.ThemeType == PageState.Site.DefaultThemeType) { diff --git a/Oqtane.Client/Modules/Controls/ActionDialog.razor b/Oqtane.Client/Modules/Controls/ActionDialog.razor index f016d997..020b004c 100644 --- a/Oqtane.Client/Modules/Controls/ActionDialog.razor +++ b/Oqtane.Client/Modules/Controls/ActionDialog.razor @@ -100,7 +100,7 @@ private bool IsAuthorized() { bool authorized = false; - if (PageState.EditMode || !_editmode) + if (PageState.EditMode || _editmode) { SecurityAccessLevel security = SecurityAccessLevel.Host; if (Security == null) diff --git a/Oqtane.Client/Modules/Controls/ActionLink.razor b/Oqtane.Client/Modules/Controls/ActionLink.razor index 8d6b6895..383fb114 100644 --- a/Oqtane.Client/Modules/Controls/ActionLink.razor +++ b/Oqtane.Client/Modules/Controls/ActionLink.razor @@ -100,7 +100,7 @@ private bool IsAuthorized() { var authorized = false; - if (PageState.EditMode || !_editmode) + if (PageState.EditMode || _editmode) { var security = SecurityAccessLevel.Host; if (Security == null) diff --git a/Oqtane.Client/Modules/Controls/ModuleMessage.razor b/Oqtane.Client/Modules/Controls/ModuleMessage.razor index a486ace4..ad5957fa 100644 --- a/Oqtane.Client/Modules/Controls/ModuleMessage.razor +++ b/Oqtane.Client/Modules/Controls/ModuleMessage.razor @@ -1,9 +1,16 @@ @namespace Oqtane.Modules.Controls @inherits ModuleControlBase +@inject NavigationManager NavigationManager @if (!string.IsNullOrEmpty(_message)) { - +
} diff --git a/Oqtane.Client/Modules/HtmlText/Index.razor b/Oqtane.Client/Modules/HtmlText/Index.razor index 8160c19a..c237402d 100644 --- a/Oqtane.Client/Modules/HtmlText/Index.razor +++ b/Oqtane.Client/Modules/HtmlText/Index.razor @@ -7,12 +7,12 @@ @if (PageState.EditMode) { -


+


} @code { public override List Resources => new List() - { +{ new Resource { ResourceType = ResourceType.Stylesheet, Url = ModulePath() + "Module.css" } }; diff --git a/Oqtane.Client/Themes/Controls/ControlPanel.razor b/Oqtane.Client/Themes/Controls/ControlPanel.razor index 6d74b47f..24e90513 100644 --- a/Oqtane.Client/Themes/Controls/ControlPanel.razor +++ b/Oqtane.Client/Themes/Controls/ControlPanel.razor @@ -127,7 +127,10 @@ { if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.Utilize, moduledefinition.Permissions)) { - + if (moduledefinition.Runtimes == "" || moduledefinition.Runtimes.Contains(PageState.Runtime.ToString())) + { + + } } } @@ -196,26 +199,17 @@ @if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.Permissions) || (PageState.Page.IsPersonalizable && PageState.User != null)) { - @if (PageState.Page.EditMode) + if (PageState.EditMode) { - } else { - if (PageState.EditMode) - { - - } - else - { - - } + } } diff --git a/Oqtane.Client/Themes/Controls/ModuleActions.razor b/Oqtane.Client/Themes/Controls/ModuleActions.razor index 3252a9a1..6373a11d 100644 --- a/Oqtane.Client/Themes/Controls/ModuleActions.razor +++ b/Oqtane.Client/Themes/Controls/ModuleActions.razor @@ -2,7 +2,7 @@ @inherits ModuleActionsBase @attribute [OqtaneIgnore] -@if (PageState.EditMode && !PageState.Page.EditMode && UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, ModuleState.Permissions)) +@if (PageState.EditMode && UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, ModuleState.Permissions)) {
diff --git a/Oqtane.Client/UI/Pane.razor b/Oqtane.Client/UI/Pane.razor index 48f4d0ce..bf51e4ee 100644 --- a/Oqtane.Client/UI/Pane.razor +++ b/Oqtane.Client/UI/Pane.razor @@ -1,4 +1,5 @@ -@namespace Oqtane.UI +@using Microsoft.AspNetCore.Components.Rendering +@namespace Oqtane.UI @inject IUserService UserService @inject IModuleService ModuleService @inject IModuleDefinitionService ModuleDefinitionService @@ -25,7 +26,7 @@ protected override void OnParametersSet() { - if (PageState.EditMode && !PageState.Page.EditMode && UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, PageState.Page.Permissions) && Name != Constants.AdminPane) + if (PageState.EditMode && UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, PageState.Page.Permissions) && Name != Constants.AdminPane) { _paneadminborder = "app-pane-admin-border"; _panetitle = "
" + Name + " Pane
"; @@ -51,7 +52,7 @@ { typename = Constants.DefaultModuleActionsTemplate.Replace(Constants.ActionToken, PageState.Action); } - + var moduleType = Type.GetType(typename); if (moduleType != null) { @@ -88,10 +89,7 @@ { module.Title = module.ControlTitle; } - - builder.OpenComponent(0, Type.GetType(Constants.ContainerComponent)); - builder.AddAttribute(1, "Module", module); - builder.CloseComponent(); + CreateComponent(builder, module); } } else @@ -111,9 +109,7 @@ // check if user is authorized to view module if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.Permissions)) { - builder.OpenComponent(0, Type.GetType(Constants.ContainerComponent)); - builder.AddAttribute(1, "Module", module); - builder.CloseComponent(); + CreateComponent(builder, module); } } } @@ -124,14 +120,19 @@ // check if user is authorized to view module if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.Permissions)) { - builder.OpenComponent(0, Type.GetType(Constants.ContainerComponent)); - builder.AddAttribute(1, "Module", module); - builder.SetKey(module.PageModuleId); - builder.CloseComponent(); + CreateComponent(builder, module); } } } } }; } + + private void CreateComponent(RenderTreeBuilder builder, Module module) + { + builder.OpenComponent(0, Type.GetType(Constants.ContainerComponent)); + builder.AddAttribute(1, "Module", module); + builder.SetKey(module.PageModuleId); + builder.CloseComponent(); + } } diff --git a/Oqtane.Client/UI/SiteRouter.razor b/Oqtane.Client/UI/SiteRouter.razor index 21ee8575..5c7f6cd5 100644 --- a/Oqtane.Client/UI/SiteRouter.razor +++ b/Oqtane.Client/UI/SiteRouter.razor @@ -260,17 +260,14 @@ { page = pages.Where(item => item.Path == path).FirstOrDefault(); reload = Reload.Page; - if (page != null) - { - editmode = page.EditMode; - } + editmode = false; } if (page != null) { if (PageState == null) { - editmode = page.EditMode; + editmode = false; } // check if user is authorized to view page @@ -401,6 +398,13 @@ string panes = ""; Type themetype = Type.GetType(page.ThemeType); + if (themetype == null) + { + // fallback + page.ThemeType = Constants.DefaultTheme; + page.LayoutType = Constants.DefaultLayout; + themetype = Type.GetType(Constants.DefaultTheme); + } if (themetype != null) { var themeobject = Activator.CreateInstance(themetype) as IThemeControl; @@ -442,7 +446,7 @@ if (module.PageId == page.PageId || module.ModuleId == moduleid) { var typename = string.Empty; - if (module.ModuleDefinition != null) + if (module.ModuleDefinition != null && (module.ModuleDefinition.Runtimes == "" || module.ModuleDefinition.Runtimes.Contains(GetRuntime().ToString()))) { typename = module.ModuleDefinition.ControlTypeTemplate; } diff --git a/Oqtane.Client/UI/ThemeBuilder.razor b/Oqtane.Client/UI/ThemeBuilder.razor index 60c40e59..12513215 100644 --- a/Oqtane.Client/UI/ThemeBuilder.razor +++ b/Oqtane.Client/UI/ThemeBuilder.razor @@ -54,11 +54,6 @@ DynamicComponent = builder => { var themeType = Type.GetType(PageState.Page.ThemeType); - if (themeType == null) - { - // fallback - themeType = Type.GetType(Constants.DefaultTheme); - } builder.OpenComponent(0, themeType); builder.CloseComponent(); }; diff --git a/Oqtane.Server/Controllers/ModuleController.cs b/Oqtane.Server/Controllers/ModuleController.cs index 55ea9e1e..b90db0b8 100644 --- a/Oqtane.Server/Controllers/ModuleController.cs +++ b/Oqtane.Server/Controllers/ModuleController.cs @@ -122,7 +122,7 @@ namespace Oqtane.Controllers var pages = _pages.GetPages(module.SiteId).ToList(); foreach (Page page in pages) { - if (page.PageId != pageModule.PageId && !page.EditMode) + if (page.PageId != pageModule.PageId && !page.Path.StartsWith("admin/")) { _pageModules.AddPageModule(new PageModule { PageId = page.PageId, ModuleId = pageModule.ModuleId, Title = pageModule.Title, Pane = pageModule.Pane, Order = pageModule.Order, ContainerType = pageModule.ContainerType }); } diff --git a/Oqtane.Server/Controllers/PageController.cs b/Oqtane.Server/Controllers/PageController.cs index 72e4f352..01645921 100644 --- a/Oqtane.Server/Controllers/PageController.cs +++ b/Oqtane.Server/Controllers/PageController.cs @@ -125,7 +125,7 @@ namespace Oqtane.Controllers _syncManager.AddSyncEvent(_tenants.GetTenant().TenantId, EntityNames.Site, page.SiteId); _logger.Log(LogLevel.Information, this, LogFunction.Create, "Page Added {Page}", page); - if (!page.EditMode) + if (!page.Path.StartsWith("admin/")) { var modules = _modules.GetModules(page.SiteId).Where(item => item.AllPages).ToList(); foreach (Module module in modules) @@ -163,7 +163,6 @@ namespace Oqtane.Controllers page.Order = 0; page.IsNavigation = false; page.Url = ""; - page.EditMode = false; page.ThemeType = parent.ThemeType; page.LayoutType = parent.LayoutType; page.DefaultContainerType = parent.DefaultContainerType; diff --git a/Oqtane.Server/Infrastructure/Jobs/NotificationJob.cs b/Oqtane.Server/Infrastructure/Jobs/NotificationJob.cs index 520533d9..7c8f8b62 100644 --- a/Oqtane.Server/Infrastructure/Jobs/NotificationJob.cs +++ b/Oqtane.Server/Infrastructure/Jobs/NotificationJob.cs @@ -38,7 +38,7 @@ namespace Oqtane.Infrastructure List sites = siteRepository.GetSites().ToList(); foreach (Site site in sites) { - log += "Processing Notifications For Site: " + site.Name + "\n\n"; + log += "Processing Notifications For Site: " + site.Name + "
"; // get site settings List sitesettings = settingRepository.GetSettings(EntityNames.Site, site.SiteId).ToList(); @@ -101,14 +101,14 @@ namespace Oqtane.Infrastructure catch (Exception ex) { // error - log += ex.Message + "\n\n"; + log += ex.Message + "
"; } } - log += "Notifications Delivered: " + sent + "\n\n"; + log += "Notifications Delivered: " + sent + "
"; } else { - log += "SMTP Not Configured" + "\n\n"; + log += "SMTP Not Configured" + "
"; } } } @@ -116,7 +116,6 @@ namespace Oqtane.Infrastructure return log; } - private Dictionary GetSettings(List settings) { Dictionary dictionary = new Dictionary(); diff --git a/Oqtane.Server/Infrastructure/SiteTemplates/DefaultSiteTemplate.cs b/Oqtane.Server/Infrastructure/SiteTemplates/DefaultSiteTemplate.cs index 4b56e443..f7fe1d89 100644 --- a/Oqtane.Server/Infrastructure/SiteTemplates/DefaultSiteTemplate.cs +++ b/Oqtane.Server/Infrastructure/SiteTemplates/DefaultSiteTemplate.cs @@ -42,7 +42,6 @@ namespace Oqtane.SiteTemplates Icon = "home", IsNavigation = true, IsPersonalizable = false, - EditMode = false, PagePermissions = new List { new Permission(PermissionNames.View, Constants.AllUsersRole, true), new Permission(PermissionNames.View, Constants.AdminRole, true), @@ -89,7 +88,6 @@ namespace Oqtane.SiteTemplates Icon = "lock-locked", IsNavigation = true, IsPersonalizable = false, - EditMode = false, PagePermissions = new List { new Permission(PermissionNames.View, Constants.RegisteredRole, true), new Permission(PermissionNames.View, Constants.AdminRole, true), @@ -114,7 +112,6 @@ namespace Oqtane.SiteTemplates Icon = "target", IsNavigation = true, IsPersonalizable = true, - EditMode = false, PagePermissions = new List { new Permission(PermissionNames.View, Constants.AllUsersRole, true), new Permission(PermissionNames.View, Constants.AdminRole, true), diff --git a/Oqtane.Server/Infrastructure/SiteTemplates/EmptySiteTemplate.cs b/Oqtane.Server/Infrastructure/SiteTemplates/EmptySiteTemplate.cs index 1dfefdf0..33ccaf32 100644 --- a/Oqtane.Server/Infrastructure/SiteTemplates/EmptySiteTemplate.cs +++ b/Oqtane.Server/Infrastructure/SiteTemplates/EmptySiteTemplate.cs @@ -30,7 +30,6 @@ namespace Oqtane.SiteTemplates Icon = "home", IsNavigation = true, IsPersonalizable = false, - EditMode = false, PagePermissions = new List { new Permission(PermissionNames.View, Constants.AllUsersRole, true), new Permission(PermissionNames.View, Constants.AdminRole, true), diff --git a/Oqtane.Server/Oqtane.Server.csproj b/Oqtane.Server/Oqtane.Server.csproj index 11521d10..c9f9be47 100644 --- a/Oqtane.Server/Oqtane.Server.csproj +++ b/Oqtane.Server/Oqtane.Server.csproj @@ -22,6 +22,9 @@ + + + @@ -32,6 +35,7 @@ + diff --git a/Oqtane.Server/Repository/SiteRepository.cs b/Oqtane.Server/Repository/SiteRepository.cs index ae179abe..2cdeaab0 100644 --- a/Oqtane.Server/Repository/SiteRepository.cs +++ b/Oqtane.Server/Repository/SiteRepository.cs @@ -58,7 +58,6 @@ namespace Oqtane.Repository Icon = Icons.LockLocked, IsNavigation = false, IsPersonalizable = false, - EditMode = false, PagePermissions = new List { new Permission(PermissionNames.View, Constants.AdminRole, true), @@ -88,7 +87,6 @@ namespace Oqtane.Repository Icon = Icons.Person, IsNavigation = false, IsPersonalizable = false, - EditMode = false, PagePermissions = new List { new Permission(PermissionNames.View, Constants.AdminRole, true), @@ -119,7 +117,6 @@ namespace Oqtane.Repository Icon = Icons.Person, IsNavigation = false, IsPersonalizable = false, - EditMode = false, PagePermissions = new List { new Permission(PermissionNames.View, Constants.AdminRole, true), @@ -149,7 +146,6 @@ namespace Oqtane.Repository Icon = Icons.Person, IsNavigation = false, IsPersonalizable = false, - EditMode = false, PagePermissions = new List { new Permission(PermissionNames.View, Constants.AdminRole, true), @@ -175,7 +171,7 @@ namespace Oqtane.Repository // admin pages pageTemplates.Add(new PageTemplate { - Name = "Admin", Parent = "", Path = "admin", Icon = "", IsNavigation = false, IsPersonalizable = false, EditMode = true, + Name = "Admin", Parent = "", Path = "admin", Icon = "", IsNavigation = false, IsPersonalizable = false, PagePermissions = new List { new Permission(PermissionNames.View, Constants.AdminRole, true), @@ -203,7 +199,6 @@ namespace Oqtane.Repository Icon = Icons.Home, IsNavigation = false, IsPersonalizable = false, - EditMode = true, PagePermissions = new List { new Permission(PermissionNames.View, Constants.AdminRole, true), @@ -231,7 +226,6 @@ namespace Oqtane.Repository Icon = Icons.Layers, IsNavigation = false, IsPersonalizable = false, - EditMode = true, PagePermissions = new List { new Permission(PermissionNames.View, Constants.AdminRole, true), @@ -259,7 +253,6 @@ namespace Oqtane.Repository Icon = Icons.People, IsNavigation = false, IsPersonalizable = false, - EditMode = true, PagePermissions = new List { new Permission(PermissionNames.View, Constants.AdminRole, true), @@ -287,7 +280,6 @@ namespace Oqtane.Repository Icon = Icons.Person, IsNavigation = false, IsPersonalizable = false, - EditMode = true, PagePermissions = new List { new Permission(PermissionNames.View, Constants.AdminRole, true), @@ -315,7 +307,6 @@ namespace Oqtane.Repository Icon = Icons.LockLocked, IsNavigation = false, IsPersonalizable = false, - EditMode = true, PagePermissions = new List { new Permission(PermissionNames.View, Constants.AdminRole, true), @@ -343,7 +334,6 @@ namespace Oqtane.Repository Icon = Icons.File, IsNavigation = false, IsPersonalizable = false, - EditMode = true, PagePermissions = new List { new Permission(PermissionNames.View, Constants.AdminRole, true), @@ -371,7 +361,6 @@ namespace Oqtane.Repository Icon = Icons.Trash, IsNavigation = false, IsPersonalizable = false, - EditMode = true, PagePermissions = new List { new Permission(PermissionNames.View, Constants.AdminRole, true), @@ -401,7 +390,6 @@ namespace Oqtane.Repository Icon = Icons.MagnifyingGlass, IsNavigation = false, IsPersonalizable = false, - EditMode = true, PagePermissions = new List { new Permission(PermissionNames.View, Constants.HostRole, true), @@ -428,7 +416,6 @@ namespace Oqtane.Repository Icon = Icons.List, IsNavigation = false, IsPersonalizable = false, - EditMode = true, PagePermissions = new List { new Permission(PermissionNames.View, Constants.HostRole, true), @@ -450,7 +437,7 @@ namespace Oqtane.Repository }); pageTemplates.Add(new PageTemplate { - Name = "Site Management", Parent = "Admin", Path = "admin/sites", Icon = Icons.Globe, IsNavigation = false, IsPersonalizable = false, EditMode = true, + Name = "Site Management", Parent = "Admin", Path = "admin/sites", Icon = Icons.Globe, IsNavigation = false, IsPersonalizable = false, PagePermissions = new List { new Permission(PermissionNames.View, Constants.HostRole, true), @@ -472,7 +459,7 @@ namespace Oqtane.Repository }); pageTemplates.Add(new PageTemplate { - Name = "Module Management", Parent = "Admin", Path = "admin/modules", Icon = Icons.Browser, IsNavigation = false, IsPersonalizable = false, EditMode = true, + Name = "Module Management", Parent = "Admin", Path = "admin/modules", Icon = Icons.Browser, IsNavigation = false, IsPersonalizable = false, PagePermissions = new List { new Permission(PermissionNames.View, Constants.HostRole, true), @@ -494,7 +481,7 @@ namespace Oqtane.Repository }); pageTemplates.Add(new PageTemplate { - Name = "Theme Management", Parent = "Admin", Path = "admin/themes", Icon = Icons.Brush, IsNavigation = false, IsPersonalizable = false, EditMode = true, + Name = "Theme Management", Parent = "Admin", Path = "admin/themes", Icon = Icons.Brush, IsNavigation = false, IsPersonalizable = false, PagePermissions = new List { new Permission(PermissionNames.View, Constants.HostRole, true), @@ -516,7 +503,7 @@ namespace Oqtane.Repository }); pageTemplates.Add(new PageTemplate { - Name = "Scheduled Jobs", Parent = "Admin", Path = "admin/jobs", Icon = Icons.Timer, IsNavigation = false, IsPersonalizable = false, EditMode = true, + Name = "Scheduled Jobs", Parent = "Admin", Path = "admin/jobs", Icon = Icons.Timer, IsNavigation = false, IsPersonalizable = false, PagePermissions = new List { new Permission(PermissionNames.View, Constants.HostRole, true), @@ -544,7 +531,6 @@ namespace Oqtane.Repository Icon = "spreadsheet", IsNavigation = false, IsPersonalizable = false, - EditMode = true, PagePermissions = new List { new Permission(PermissionNames.View, Constants.HostRole, true), @@ -572,7 +558,6 @@ namespace Oqtane.Repository Icon = "medical-cross", IsNavigation = false, IsPersonalizable = false, - EditMode = true, PagePermissions = new List { new Permission(PermissionNames.View, Constants.HostRole, true), @@ -594,7 +579,7 @@ namespace Oqtane.Repository }); pageTemplates.Add(new PageTemplate { - Name = "System Update", Parent = "Admin", Path = "admin/update", Icon = Icons.Aperture, IsNavigation = false, IsPersonalizable = false, EditMode = true, + Name = "System Update", Parent = "Admin", Path = "admin/update", Icon = Icons.Aperture, IsNavigation = false, IsPersonalizable = false, PagePermissions = new List { new Permission(PermissionNames.View, Constants.HostRole, true), @@ -754,7 +739,6 @@ namespace Oqtane.Repository Order = 1, Url = "", IsNavigation = pagetemplate.IsNavigation, - EditMode = pagetemplate.EditMode, ThemeType = "", LayoutType = "", DefaultContainerType = "", diff --git a/Oqtane.Server/Scripts/Tenant.01.00.02.01.sql b/Oqtane.Server/Scripts/Tenant.01.00.02.01.sql new file mode 100644 index 00000000..409f4f10 --- /dev/null +++ b/Oqtane.Server/Scripts/Tenant.01.00.02.01.sql @@ -0,0 +1,9 @@ +/* + +Version 1.0.2.1 migration script + +*/ + +ALTER TABLE [dbo].[Page] + DROP COLUMN EditMode +GO \ No newline at end of file diff --git a/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Edit.razor b/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Edit.razor index 7df2397c..9da7cd0e 100644 --- a/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Edit.razor +++ b/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Edit.razor @@ -50,7 +50,7 @@ if (PageState.Action == "Edit") { _id = Int32.Parse(PageState.QueryString["id"]); - [Module] [Module] = await [Module]Service.Get[Module]Async(_id); + [Module] [Module] = await [Module]Service.Get[Module]Async(_id, ModuleState.ModuleId); if ([Module] != null) { _name = [Module].Name; @@ -82,7 +82,7 @@ } else { - [Module] [Module] = await [Module]Service.Get[Module]Async(_id); + [Module] [Module] = await [Module]Service.Get[Module]Async(_id, ModuleState.ModuleId); [Module].Name = _name; await [Module]Service.Update[Module]Async([Module]); await logger.LogInformation("[Module] Updated {[Module]}", [Module]); diff --git a/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Index.razor b/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Index.razor index c45943db..e00f0f90 100644 --- a/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Index.razor +++ b/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Index.razor @@ -95,7 +95,7 @@ else { try { - await [Module]Service.Delete[Module]Async([Module].[Module]Id); + await [Module]Service.Delete[Module]Async([Module].[Module]Id, ModuleState.ModuleId); await logger.LogInformation("[Module] Deleted {[Module]}", [Module]); _[Module]s = await [Module]Service.Get[Module]sAsync(ModuleState.ModuleId); StateHasChanged(); diff --git a/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Services/I[Module]Service.cs b/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Services/I[Module]Service.cs index e98da06d..8e055608 100644 --- a/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Services/I[Module]Service.cs +++ b/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Services/I[Module]Service.cs @@ -8,12 +8,12 @@ namespace [Owner].[Module]s.Services { Task> Get[Module]sAsync(int ModuleId); - Task<[Module]> Get[Module]Async(int [Module]Id); + Task<[Module]> Get[Module]Async(int [Module]Id, int ModuleId); Task<[Module]> Add[Module]Async([Module] [Module]); Task<[Module]> Update[Module]Async([Module] [Module]); - Task Delete[Module]Async(int [Module]Id); + Task Delete[Module]Async(int [Module]Id, int ModuleId); } } diff --git a/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Services/[Module]Service.cs b/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Services/[Module]Service.cs index f95c41b9..5fe282e6 100644 --- a/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Services/[Module]Service.cs +++ b/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Services/[Module]Service.cs @@ -18,32 +18,44 @@ namespace [Owner].[Module]s.Services _siteState = siteState; } - private string Apiurl=> CreateApiUrl(_siteState.Alias, "[Module]"); + private string Apiurl => CreateApiUrl(_siteState.Alias, "[Module]"); public async Task> Get[Module]sAsync(int ModuleId) { - List<[Module]> [Module]s = await GetJsonAsync>($"{Apiurl}?moduleid={ModuleId}"); + List<[Module]> [Module]s = await GetJsonAsync>(CreateAuthPolicyUrl($"{Apiurl}?moduleid={ModuleId}", ModuleId)); return [Module]s.OrderBy(item => item.Name).ToList(); } - public async Task<[Module]> Get[Module]Async(int [Module]Id) + public async Task<[Module]> Get[Module]Async(int [Module]Id, int ModuleId) { - return await GetJsonAsync<[Module]>($"{Apiurl}/{[Module]Id}"); + return await GetJsonAsync<[Module]>(CreateAuthPolicyUrl($"{Apiurl}/{[Module]Id}", ModuleId)); } public async Task<[Module]> Add[Module]Async([Module] [Module]) { - return await PostJsonAsync<[Module]>($"{Apiurl}?entityid={[Module].ModuleId}", [Module]); + return await PostJsonAsync<[Module]>(CreateAuthPolicyUrl($"{Apiurl}?entityid={[Module].ModuleId}", [Module].ModuleId), [Module]); } public async Task<[Module]> Update[Module]Async([Module] [Module]) { - return await PutJsonAsync<[Module]>($"{Apiurl}/{[Module].[Module]Id}?entityid={[Module].ModuleId}", [Module]); + return await PutJsonAsync<[Module]>(CreateAuthPolicyUrl($"{Apiurl}/{[Module].[Module]Id}", [Module].ModuleId), [Module]); } - public async Task Delete[Module]Async(int [Module]Id) + public async Task Delete[Module]Async(int [Module]Id, int ModuleId) { - await DeleteAsync($"{Apiurl}/{[Module]Id}"); + await DeleteAsync(CreateAuthPolicyUrl($"{Apiurl}/{[Module]Id}", ModuleId)); + } + + private string CreateAuthPolicyUrl(string Url, int ModuleId) + { + if (Url.Contains("?")) + { + return Url + "&entityid=" + ModuleId.ToString(); + } + else + { + return Url + "?entityid=" + ModuleId.ToString(); + } } } } diff --git a/Oqtane.Server/wwwroot/Modules/Templates/External/Server/Controllers/[Module]Controller.cs b/Oqtane.Server/wwwroot/Modules/Templates/External/Server/Controllers/[Module]Controller.cs index 1ff6a0ab..b8e19abc 100644 --- a/Oqtane.Server/wwwroot/Modules/Templates/External/Server/Controllers/[Module]Controller.cs +++ b/Oqtane.Server/wwwroot/Modules/Templates/External/Server/Controllers/[Module]Controller.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Authorization; using System.Collections.Generic; +using Microsoft.AspNetCore.Http; using Oqtane.Shared; using Oqtane.Enums; using Oqtane.Infrastructure; @@ -14,16 +15,22 @@ namespace [Owner].[Module]s.Controllers { private readonly I[Module]Repository _[Module]s; private readonly ILogManager _logger; + protected int _entityId = -1; - public [Module]Controller(I[Module]Repository [Module]s, ILogManager logger) + public [Module]Controller(I[Module]Repository [Module]s, ILogManager logger, IHttpContextAccessor accessor) { _[Module]s = [Module]s; _logger = logger; + + if (accessor.HttpContext.Request.Query.ContainsKey("entityid")) + { + _entityId = int.Parse(accessor.HttpContext.Request.Query["entityid"]); + } } // GET: api/?moduleid=x [HttpGet] - [Authorize(Roles = Constants.RegisteredRole)] + [Authorize(Policy = "ViewModule")] public IEnumerable<[Module]> Get(string moduleid) { return _[Module]s.Get[Module]s(int.Parse(moduleid)); @@ -31,18 +38,23 @@ namespace [Owner].[Module]s.Controllers // GET api//5 [HttpGet("{id}")] - [Authorize(Roles = Constants.RegisteredRole)] + [Authorize(Policy = "ViewModule")] public [Module] Get(int id) { - return _[Module]s.Get[Module](id); + [Module] [Module] = _[Module]s.Get[Module](id); + if ([Module] != null && [Module].ModuleId != _entityId) + { + [Module] = null; + } + return [Module]; } // POST api/ [HttpPost] - [Authorize(Roles = Constants.AdminRole)] + [Authorize(Policy = "EditModule")] public [Module] Post([FromBody] [Module] [Module]) { - if (ModelState.IsValid) + if (ModelState.IsValid && [Module].ModuleId == _entityId) { [Module] = _[Module]s.Add[Module]([Module]); _logger.Log(LogLevel.Information, this, LogFunction.Create, "[Module] Added {[Module]}", [Module]); @@ -52,10 +64,10 @@ namespace [Owner].[Module]s.Controllers // PUT api//5 [HttpPut("{id}")] - [Authorize(Roles = Constants.AdminRole)] + [Authorize(Policy = "EditModule")] public [Module] Put(int id, [FromBody] [Module] [Module]) { - if (ModelState.IsValid) + if (ModelState.IsValid && [Module].ModuleId == _entityId) { [Module] = _[Module]s.Update[Module]([Module]); _logger.Log(LogLevel.Information, this, LogFunction.Update, "[Module] Updated {[Module]}", [Module]); @@ -65,11 +77,15 @@ namespace [Owner].[Module]s.Controllers // DELETE api//5 [HttpDelete("{id}")] - [Authorize(Roles = Constants.AdminRole)] + [Authorize(Policy = "EditModule")] public void Delete(int id) { - _[Module]s.Delete[Module](id); - _logger.Log(LogLevel.Information, this, LogFunction.Delete, "[Module] Deleted {[Module]Id}", id); + [Module] [Module] = _[Module]s.Get[Module](id); + if ([Module] != null && [Module].ModuleId == _entityId) + { + _[Module]s.Delete[Module](id); + _logger.Log(LogLevel.Information, this, LogFunction.Delete, "[Module] Deleted {[Module]Id}", id); + } } } } diff --git a/Oqtane.Server/wwwroot/Modules/Templates/External/Server/wwwroot/Modules/[Owner].[Module]s/resources.txt b/Oqtane.Server/wwwroot/Modules/Templates/External/Server/wwwroot/Modules/[Owner].[Module]s/resources.txt deleted file mode 100644 index 903815cf..00000000 --- a/Oqtane.Server/wwwroot/Modules/Templates/External/Server/wwwroot/Modules/[Owner].[Module]s/resources.txt +++ /dev/null @@ -1 +0,0 @@ -This is the location where static resources such as images, style sheets, or scripts for this module will be located. Static assets can be organized in subfolders. When the module package is deployed the assets will be extracted under the web root in a folder that matches the module namespace. \ No newline at end of file diff --git a/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Client/Modules/[Owner].[Module]s/Edit.razor b/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Client/Modules/[Owner].[Module]s/Edit.razor index 525590f5..9da7cd0e 100644 --- a/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Client/Modules/[Owner].[Module]s/Edit.razor +++ b/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Client/Modules/[Owner].[Module]s/Edit.razor @@ -28,8 +28,14 @@ @code { public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Edit; + public override string Actions => "Add,Edit"; + public override List Resources => new List() + { + new Resource { ResourceType = ResourceType.Stylesheet, Url = ModulePath() + "Module.css" } + }; + int _id; string _name; string _createdby; @@ -44,7 +50,7 @@ if (PageState.Action == "Edit") { _id = Int32.Parse(PageState.QueryString["id"]); - [Module] [Module] = await [Module]Service.Get[Module]Async(_id); + [Module] [Module] = await [Module]Service.Get[Module]Async(_id, ModuleState.ModuleId); if ([Module] != null) { _name = [Module].Name; @@ -76,7 +82,7 @@ } else { - [Module] [Module] = await [Module]Service.Get[Module]Async(_id); + [Module] [Module] = await [Module]Service.Get[Module]Async(_id, ModuleState.ModuleId); [Module].Name = _name; await [Module]Service.Update[Module]Async([Module]); await logger.LogInformation("[Module] Updated {[Module]}", [Module]); diff --git a/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Client/Modules/[Owner].[Module]s/Index.razor b/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Client/Modules/[Owner].[Module]s/Index.razor index b683abf4..4e70fadb 100644 --- a/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Client/Modules/[Owner].[Module]s/Index.razor +++ b/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Client/Modules/[Owner].[Module]s/Index.razor @@ -61,6 +61,11 @@ else @code { + public override List Resources => new List() + { + new Resource { ResourceType = ResourceType.Stylesheet, Url = ModulePath() + "Module.css" } + }; + List<[Module]> _[Module]s; protected override async Task OnInitializedAsync() @@ -80,7 +85,7 @@ else { try { - await [Module]Service.Delete[Module]Async([Module].[Module]Id); + await [Module]Service.Delete[Module]Async([Module].[Module]Id, ModuleState.ModuleId); await logger.LogInformation("[Module] Deleted {[Module]}", [Module]); _[Module]s = await [Module]Service.Get[Module]sAsync(ModuleState.ModuleId); StateHasChanged(); diff --git a/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Client/Modules/[Owner].[Module]s/Services/I[Module]Service.cs b/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Client/Modules/[Owner].[Module]s/Services/I[Module]Service.cs index e98da06d..8e055608 100644 --- a/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Client/Modules/[Owner].[Module]s/Services/I[Module]Service.cs +++ b/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Client/Modules/[Owner].[Module]s/Services/I[Module]Service.cs @@ -8,12 +8,12 @@ namespace [Owner].[Module]s.Services { Task> Get[Module]sAsync(int ModuleId); - Task<[Module]> Get[Module]Async(int [Module]Id); + Task<[Module]> Get[Module]Async(int [Module]Id, int ModuleId); Task<[Module]> Add[Module]Async([Module] [Module]); Task<[Module]> Update[Module]Async([Module] [Module]); - Task Delete[Module]Async(int [Module]Id); + Task Delete[Module]Async(int [Module]Id, int ModuleId); } } diff --git a/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Client/Modules/[Owner].[Module]s/Services/[Module]Service.cs b/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Client/Modules/[Owner].[Module]s/Services/[Module]Service.cs index f95c41b9..5fe282e6 100644 --- a/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Client/Modules/[Owner].[Module]s/Services/[Module]Service.cs +++ b/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Client/Modules/[Owner].[Module]s/Services/[Module]Service.cs @@ -18,32 +18,44 @@ namespace [Owner].[Module]s.Services _siteState = siteState; } - private string Apiurl=> CreateApiUrl(_siteState.Alias, "[Module]"); + private string Apiurl => CreateApiUrl(_siteState.Alias, "[Module]"); public async Task> Get[Module]sAsync(int ModuleId) { - List<[Module]> [Module]s = await GetJsonAsync>($"{Apiurl}?moduleid={ModuleId}"); + List<[Module]> [Module]s = await GetJsonAsync>(CreateAuthPolicyUrl($"{Apiurl}?moduleid={ModuleId}", ModuleId)); return [Module]s.OrderBy(item => item.Name).ToList(); } - public async Task<[Module]> Get[Module]Async(int [Module]Id) + public async Task<[Module]> Get[Module]Async(int [Module]Id, int ModuleId) { - return await GetJsonAsync<[Module]>($"{Apiurl}/{[Module]Id}"); + return await GetJsonAsync<[Module]>(CreateAuthPolicyUrl($"{Apiurl}/{[Module]Id}", ModuleId)); } public async Task<[Module]> Add[Module]Async([Module] [Module]) { - return await PostJsonAsync<[Module]>($"{Apiurl}?entityid={[Module].ModuleId}", [Module]); + return await PostJsonAsync<[Module]>(CreateAuthPolicyUrl($"{Apiurl}?entityid={[Module].ModuleId}", [Module].ModuleId), [Module]); } public async Task<[Module]> Update[Module]Async([Module] [Module]) { - return await PutJsonAsync<[Module]>($"{Apiurl}/{[Module].[Module]Id}?entityid={[Module].ModuleId}", [Module]); + return await PutJsonAsync<[Module]>(CreateAuthPolicyUrl($"{Apiurl}/{[Module].[Module]Id}", [Module].ModuleId), [Module]); } - public async Task Delete[Module]Async(int [Module]Id) + public async Task Delete[Module]Async(int [Module]Id, int ModuleId) { - await DeleteAsync($"{Apiurl}/{[Module]Id}"); + await DeleteAsync(CreateAuthPolicyUrl($"{Apiurl}/{[Module]Id}", ModuleId)); + } + + private string CreateAuthPolicyUrl(string Url, int ModuleId) + { + if (Url.Contains("?")) + { + return Url + "&entityid=" + ModuleId.ToString(); + } + else + { + return Url + "?entityid=" + ModuleId.ToString(); + } } } } diff --git a/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Server/Modules/[Owner].[Module]s/Controllers/[Module]Controller.cs b/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Server/Modules/[Owner].[Module]s/Controllers/[Module]Controller.cs index 1ff6a0ab..b8e19abc 100644 --- a/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Server/Modules/[Owner].[Module]s/Controllers/[Module]Controller.cs +++ b/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Server/Modules/[Owner].[Module]s/Controllers/[Module]Controller.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Authorization; using System.Collections.Generic; +using Microsoft.AspNetCore.Http; using Oqtane.Shared; using Oqtane.Enums; using Oqtane.Infrastructure; @@ -14,16 +15,22 @@ namespace [Owner].[Module]s.Controllers { private readonly I[Module]Repository _[Module]s; private readonly ILogManager _logger; + protected int _entityId = -1; - public [Module]Controller(I[Module]Repository [Module]s, ILogManager logger) + public [Module]Controller(I[Module]Repository [Module]s, ILogManager logger, IHttpContextAccessor accessor) { _[Module]s = [Module]s; _logger = logger; + + if (accessor.HttpContext.Request.Query.ContainsKey("entityid")) + { + _entityId = int.Parse(accessor.HttpContext.Request.Query["entityid"]); + } } // GET: api/?moduleid=x [HttpGet] - [Authorize(Roles = Constants.RegisteredRole)] + [Authorize(Policy = "ViewModule")] public IEnumerable<[Module]> Get(string moduleid) { return _[Module]s.Get[Module]s(int.Parse(moduleid)); @@ -31,18 +38,23 @@ namespace [Owner].[Module]s.Controllers // GET api//5 [HttpGet("{id}")] - [Authorize(Roles = Constants.RegisteredRole)] + [Authorize(Policy = "ViewModule")] public [Module] Get(int id) { - return _[Module]s.Get[Module](id); + [Module] [Module] = _[Module]s.Get[Module](id); + if ([Module] != null && [Module].ModuleId != _entityId) + { + [Module] = null; + } + return [Module]; } // POST api/ [HttpPost] - [Authorize(Roles = Constants.AdminRole)] + [Authorize(Policy = "EditModule")] public [Module] Post([FromBody] [Module] [Module]) { - if (ModelState.IsValid) + if (ModelState.IsValid && [Module].ModuleId == _entityId) { [Module] = _[Module]s.Add[Module]([Module]); _logger.Log(LogLevel.Information, this, LogFunction.Create, "[Module] Added {[Module]}", [Module]); @@ -52,10 +64,10 @@ namespace [Owner].[Module]s.Controllers // PUT api//5 [HttpPut("{id}")] - [Authorize(Roles = Constants.AdminRole)] + [Authorize(Policy = "EditModule")] public [Module] Put(int id, [FromBody] [Module] [Module]) { - if (ModelState.IsValid) + if (ModelState.IsValid && [Module].ModuleId == _entityId) { [Module] = _[Module]s.Update[Module]([Module]); _logger.Log(LogLevel.Information, this, LogFunction.Update, "[Module] Updated {[Module]}", [Module]); @@ -65,11 +77,15 @@ namespace [Owner].[Module]s.Controllers // DELETE api//5 [HttpDelete("{id}")] - [Authorize(Roles = Constants.AdminRole)] + [Authorize(Policy = "EditModule")] public void Delete(int id) { - _[Module]s.Delete[Module](id); - _logger.Log(LogLevel.Information, this, LogFunction.Delete, "[Module] Deleted {[Module]Id}", id); + [Module] [Module] = _[Module]s.Get[Module](id); + if ([Module] != null && [Module].ModuleId == _entityId) + { + _[Module]s.Delete[Module](id); + _logger.Log(LogLevel.Information, this, LogFunction.Delete, "[Module] Deleted {[Module]Id}", id); + } } } } diff --git a/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Server/wwwroot/Modules/[Owner].[Module]s/resources.txt b/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Server/wwwroot/Modules/[Owner].[Module]s/resources.txt deleted file mode 100644 index 903815cf..00000000 --- a/Oqtane.Server/wwwroot/Modules/Templates/Internal/Oqtane.Server/wwwroot/Modules/[Owner].[Module]s/resources.txt +++ /dev/null @@ -1 +0,0 @@ -This is the location where static resources such as images, style sheets, or scripts for this module will be located. Static assets can be organized in subfolders. When the module package is deployed the assets will be extracted under the web root in a folder that matches the module namespace. \ No newline at end of file diff --git a/Oqtane.Shared/Models/ModuleDefinition.cs b/Oqtane.Shared/Models/ModuleDefinition.cs index 504cc890..1e66735f 100644 --- a/Oqtane.Shared/Models/ModuleDefinition.cs +++ b/Oqtane.Shared/Models/ModuleDefinition.cs @@ -20,6 +20,7 @@ namespace Oqtane.Models ServerManagerType = ""; ControlTypeRoutes = ""; ReleaseVersions = ""; + Runtimes = ""; Template = ""; } @@ -45,6 +46,8 @@ namespace Oqtane.Models [NotMapped] public string License { get; set; } [NotMapped] + public string Runtimes { get; set; } + [NotMapped] public string Dependencies { get; set; } [NotMapped] public string PermissionNames { get; set; } diff --git a/Oqtane.Shared/Models/Page.cs b/Oqtane.Shared/Models/Page.cs index 461d20fd..0960a52a 100644 --- a/Oqtane.Shared/Models/Page.cs +++ b/Oqtane.Shared/Models/Page.cs @@ -19,7 +19,6 @@ namespace Oqtane.Models public string DefaultContainerType { get; set; } public string Icon { get; set; } public bool IsNavigation { get; set; } - public bool EditMode { get; set; } public int? UserId { get; set; } public bool IsPersonalizable { get; set; } @@ -41,5 +40,9 @@ namespace Oqtane.Models public int Level { get; set; } [NotMapped] public bool HasChildren { get; set; } + + [Obsolete("This property is obsolete", false)] + [NotMapped] + public bool EditMode { get; set; } } } diff --git a/Oqtane.Shared/Models/SiteTemplate.cs b/Oqtane.Shared/Models/SiteTemplate.cs index e4e7a02d..74d259bb 100644 --- a/Oqtane.Shared/Models/SiteTemplate.cs +++ b/Oqtane.Shared/Models/SiteTemplate.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; namespace Oqtane.Models { @@ -16,9 +17,11 @@ namespace Oqtane.Models public string Icon { get; set; } public bool IsNavigation { get; set; } public bool IsPersonalizable { get; set; } - public bool EditMode { get; set; } public string PagePermissions { get; set; } public List PageTemplateModules { get; set; } + + [Obsolete("This property is obsolete", false)] + public bool EditMode { get; set; } } public class PageTemplateModule