Merge pull request #9 from oqtane/master

sync with upstream
This commit is contained in:
Shaun Walker 2019-10-17 09:17:35 -04:00 committed by GitHub
commit 1719270e7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 41 additions and 21 deletions

View File

@ -67,7 +67,7 @@
public void HideProgressIndicator() public void HideProgressIndicator()
{ {
progressindicator = true; progressindicator = false;
StateHasChanged(); StateHasChanged();
} }
} }

View File

@ -117,7 +117,7 @@
} }
else else
{ {
foreach (Module module in PageState.Modules.Where(item => item.Pane.ToLower() == Name.ToLower()).OrderBy(x => x.Order).ToArray()) foreach (Module module in PageState.Modules.Where(item => item.Pane.ToLower() == Name.ToLower() && !item.IsDeleted).OrderBy(x => x.Order).ToArray())
{ {
// check if user is authorized to view module // check if user is authorized to view module
if (UserSecurity.IsAuthorized(PageState.User, "View", module.Permissions)) if (UserSecurity.IsAuthorized(PageState.User, "View", module.Permissions))

View File

@ -196,6 +196,8 @@
pages.Add(p); pages.Add(p);
} }
} }
var panes = PageState.Page.Panes.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
pane = panes.Count() == 1 ? panes.SingleOrDefault() : "";
containers = ThemeService.GetContainerTypes(PageState.Themes); containers = ThemeService.GetContainerTypes(PageState.Themes);
containertype = PageState.Site.DefaultContainerType; containertype = PageState.Site.DefaultContainerType;
List<Module> modules = await ModuleService.GetModulesAsync(PageState.Site.SiteId, Constants.PageManagementModule); List<Module> modules = await ModuleService.GetModulesAsync(PageState.Site.SiteId, Constants.PageManagementModule);

View File

@ -103,7 +103,8 @@
url = EditUrl(pagemodule.ModuleId, "Export"); url = EditUrl(pagemodule.ModuleId, "Export");
break; break;
case "delete": case "delete":
await PageModuleService.DeletePageModuleAsync(pagemodule.PageModuleId); pagemodule.IsDeleted = true;
await PageModuleService.UpdatePageModuleAsync(pagemodule);
await PageModuleService.UpdatePageModuleOrderAsync(pagemodule.PageId, pagemodule.Pane); await PageModuleService.UpdatePageModuleOrderAsync(pagemodule.PageId, pagemodule.Pane);
break; break;
default: // move to pane default: // move to pane

View File

@ -47,6 +47,7 @@ namespace Oqtane.Controllers
module.CreatedOn = pagemodule.Module.CreatedOn; module.CreatedOn = pagemodule.Module.CreatedOn;
module.ModifiedBy = pagemodule.Module.ModifiedBy; module.ModifiedBy = pagemodule.Module.ModifiedBy;
module.ModifiedOn = pagemodule.Module.ModifiedOn; module.ModifiedOn = pagemodule.Module.ModifiedOn;
module.IsDeleted = pagemodule.IsDeleted;
module.PageModuleId = pagemodule.PageModuleId; module.PageModuleId = pagemodule.PageModuleId;
module.ModuleId = pagemodule.ModuleId; module.ModuleId = pagemodule.ModuleId;

View File

@ -64,7 +64,7 @@ namespace Oqtane.Repository
public void DeleteModule(int ModuleId) public void DeleteModule(int ModuleId)
{ {
Module Module = db.Module.Find(ModuleId); Module Module = db.Module.Find(ModuleId);
Permissions.UpdatePermissions(Module.SiteId, "Module", ModuleId, ""); Permissions.DeletePermissions(Module.SiteId, "Module", ModuleId);
db.Module.Remove(Module); db.Module.Remove(Module);
db.SaveChanges(); db.SaveChanges();
} }

View File

@ -9,11 +9,15 @@ namespace Oqtane.Repository
{ {
private TenantDBContext db; private TenantDBContext db;
private readonly IPermissionRepository Permissions; private readonly IPermissionRepository Permissions;
private readonly IPageModuleRepository PageModules;
private readonly IModuleRepository ModuleRepository;
public PageRepository(TenantDBContext context, IPermissionRepository Permissions) public PageRepository(TenantDBContext context, IPermissionRepository Permissions, IPageModuleRepository PageModules, IModuleRepository ModuleRepository)
{ {
db = context; db = context;
this.Permissions = Permissions; this.Permissions = Permissions;
this.PageModules = PageModules;
this.ModuleRepository = ModuleRepository;
} }
public IEnumerable<Page> GetPages() public IEnumerable<Page> GetPages()
@ -62,7 +66,12 @@ namespace Oqtane.Repository
public void DeletePage(int PageId) public void DeletePage(int PageId)
{ {
Page Page = db.Page.Find(PageId); Page Page = db.Page.Find(PageId);
Permissions.UpdatePermissions(Page.SiteId, "Page", PageId, ""); Permissions.DeletePermissions(Page.SiteId, "Page", PageId);
IEnumerable<PageModule> pageModules = db.PageModule.Where(item => item.PageId == PageId).ToList();
foreach (var pageModule in pageModules)
{
PageModules.DeletePageModule(pageModule.PageModuleId);
}
db.Page.Remove(Page); db.Page.Remove(Page);
db.SaveChanges(); db.SaveChanges();
} }

View File

@ -18,7 +18,7 @@ CREATE TABLE [dbo].[Site](
[ModifiedOn] [datetime] NOT NULL, [ModifiedOn] [datetime] NOT NULL,
[DeletedBy] [nvarchar](256) NULL, [DeletedBy] [nvarchar](256) NULL,
[DeletedOn] [datetime] NULL, [DeletedOn] [datetime] NULL,
[IsDeleted][bit] NOT NULL [IsDeleted][bit] NOT NULL,
CONSTRAINT [PK_Site] PRIMARY KEY CLUSTERED CONSTRAINT [PK_Site] PRIMARY KEY CLUSTERED
( (
[SiteId] ASC [SiteId] ASC
@ -44,7 +44,7 @@ CREATE TABLE [dbo].[Page](
[ModifiedOn] [datetime] NOT NULL, [ModifiedOn] [datetime] NOT NULL,
[DeletedBy] [nvarchar](256) NULL, [DeletedBy] [nvarchar](256) NULL,
[DeletedOn] [datetime] NULL, [DeletedOn] [datetime] NULL,
[IsDeleted][bit] NOT NULL [IsDeleted][bit] NOT NULL,
CONSTRAINT [PK_Page] PRIMARY KEY CLUSTERED CONSTRAINT [PK_Page] PRIMARY KEY CLUSTERED
( (
[PageId] ASC [PageId] ASC
@ -79,6 +79,9 @@ CREATE TABLE [dbo].[PageModule](
[CreatedOn] [datetime] NOT NULL, [CreatedOn] [datetime] NOT NULL,
[ModifiedBy] [nvarchar](256) NOT NULL, [ModifiedBy] [nvarchar](256) NOT NULL,
[ModifiedOn] [datetime] NOT NULL, [ModifiedOn] [datetime] NOT NULL,
[DeletedBy] [nvarchar](256) NULL,
[DeletedOn] [datetime] NULL,
[IsDeleted][bit] NOT NULL,
CONSTRAINT [PK_PageModule] PRIMARY KEY CLUSTERED CONSTRAINT [PK_PageModule] PRIMARY KEY CLUSTERED
( (
[PageModuleId] ASC [PageModuleId] ASC
@ -97,7 +100,7 @@ CREATE TABLE [dbo].[User](
[ModifiedOn] [datetime] NOT NULL, [ModifiedOn] [datetime] NOT NULL,
[DeletedBy] [nvarchar](256) NULL, [DeletedBy] [nvarchar](256) NULL,
[DeletedOn] [datetime] NULL, [DeletedOn] [datetime] NULL,
[IsDeleted][bit] NOT NULL [IsDeleted][bit] NOT NULL,
CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED
( (
[UserId] ASC [UserId] ASC

View File

@ -16,6 +16,9 @@ namespace Oqtane.Models
public string ModifiedBy { get; set; } public string ModifiedBy { get; set; }
public DateTime ModifiedOn { get; set; } public DateTime ModifiedOn { get; set; }
[NotMapped]
public bool IsDeleted { get; set; }
[NotMapped] [NotMapped]
public string Permissions { get; set; } public string Permissions { get; set; }

View File

@ -2,7 +2,7 @@
namespace Oqtane.Models namespace Oqtane.Models
{ {
public class PageModule : IAuditable public class PageModule : IAuditable, IDeletable
{ {
public int PageModuleId { get; set; } public int PageModuleId { get; set; }
public int PageId { get; set; } public int PageId { get; set; }
@ -16,6 +16,9 @@ namespace Oqtane.Models
public DateTime CreatedOn { get; set; } public DateTime CreatedOn { get; set; }
public string ModifiedBy { get; set; } public string ModifiedBy { get; set; }
public DateTime ModifiedOn { get; set; } public DateTime ModifiedOn { get; set; }
public string DeletedBy { get; set; }
public DateTime? DeletedOn { get; set; }
public bool IsDeleted { get; set; }
public Module Module { get; set; } public Module Module { get; set; }

View File

@ -22,18 +22,8 @@ Security
- Logging - Logging
- Need support for JwT tokens for external client access to API - Need support for JwT tokens for external client access to API
Design
- Need modern Admin UI theme
- Need to cleanly separate site.css
Admin Admin
- Need ability to soft delete core entities - Need ability to soft delete core entities
- Drag and Drop modules
Upgrade
- Need ability to upgrade application seamlessly
- integrated store/catalog of extensions
- auto update - provide url to check for updates, perhaps even download in background - core and extensions
Database Database
- Need ability to run on SQLite - Need ability to run on SQLite
@ -49,6 +39,14 @@ At this point Oqtane offers a minimum of desired functionality and is not recomm
# Example Screenshots # Example Screenshots
Install Wizard:
![Installer](https://github.com/oqtane/framework/blob/master/installer.png?raw=true "Installer")
Default view after installation:
![Home](https://github.com/oqtane/framework/blob/master/screenshot0.png?raw=true "Home")
A seamless login flow utilizing .NET Core Identity services: A seamless login flow utilizing .NET Core Identity services:
![Login](https://github.com/oqtane/framework/blob/master/screenshot1.png?raw=true "Login") ![Login](https://github.com/oqtane/framework/blob/master/screenshot1.png?raw=true "Login")