From f91fec24f62df7f86be58d6a416c35fd5bc6837a Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Tue, 24 Sep 2019 17:31:42 -0400 Subject: [PATCH 1/7] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 195c8091..6235ed1e 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ Oqtane uses Blazor, a new web framework for .NET Core that lets you build intera **To get started with Oqtane:** - 1. Oqtane is currently compatible with **[.NET Core 3.0 RC 1 SDK (3.0.100-rc1-014190)](https://dotnet.microsoft.com/download/dotnet-core/3.0)**. + 1. Oqtane is currently compatible with **[.NET Core 3.0)](https://dotnet.microsoft.com/download/dotnet-core/3.0)**. - 2. Install the latest **Preview** edition of [Visual Studio 2019](https://visualstudio.com/preview) with the **ASP.NET and web development** workload. Installing the latest **Preview** edition will also install the latest preview of .NET Core 3. + 2. Install the latest **Preview** edition of [Visual Studio 2019](https://visualstudio.com/preview) with the **ASP.NET and web development** workload. Installing the latest **Preview** edition will also install the latest preview of .NET Core 3.0. 3. Download or Clone the Oqtane source code to your local system. Open the **Oqtane.sln** solution file. If you want to develop using **server-side** Blazor ( which includes a full debugging experience in Visual Studio ) you should choose to Build the solution using the default Debug configuration. If you want to develop using **client-side** Blazor ( WebAssembly ) you should first choose the "Wasm" configuration option in the Visual Studio toolbar and then Build. From c4335f5b7ab6034d9a681186ecf5c7ee63e7a3d1 Mon Sep 17 00:00:00 2001 From: Emanuele Filardo Date: Wed, 25 Sep 2019 11:18:32 +0200 Subject: [PATCH 2/7] typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6235ed1e..88dcf23b 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Oqtane uses Blazor, a new web framework for .NET Core that lets you build intera **To get started with Oqtane:** - 1. Oqtane is currently compatible with **[.NET Core 3.0)](https://dotnet.microsoft.com/download/dotnet-core/3.0)**. + 1. Oqtane is currently compatible with **[.NET Core 3.0](https://dotnet.microsoft.com/download/dotnet-core/3.0)**. 2. Install the latest **Preview** edition of [Visual Studio 2019](https://visualstudio.com/preview) with the **ASP.NET and web development** workload. Installing the latest **Preview** edition will also install the latest preview of .NET Core 3.0. From 0679078553cb847bc04410d028f1fde11f88ccde Mon Sep 17 00:00:00 2001 From: Emanuele Filardo Date: Wed, 25 Sep 2019 11:23:52 +0200 Subject: [PATCH 3/7] remove VS and .NET Preview --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 88dcf23b..04e3d579 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Oqtane uses Blazor, a new web framework for .NET Core that lets you build intera 1. Oqtane is currently compatible with **[.NET Core 3.0](https://dotnet.microsoft.com/download/dotnet-core/3.0)**. - 2. Install the latest **Preview** edition of [Visual Studio 2019](https://visualstudio.com/preview) with the **ASP.NET and web development** workload. Installing the latest **Preview** edition will also install the latest preview of .NET Core 3.0. + 2. Install the latest edition of [Visual Studio 2019](https://visualstudio.com/vs/) with the **ASP.NET and web development** workload. Installing the latest edition will also install the latest version of .NET Core 3.0. 3. Download or Clone the Oqtane source code to your local system. Open the **Oqtane.sln** solution file. If you want to develop using **server-side** Blazor ( which includes a full debugging experience in Visual Studio ) you should choose to Build the solution using the default Debug configuration. If you want to develop using **client-side** Blazor ( WebAssembly ) you should first choose the "Wasm" configuration option in the Visual Studio toolbar and then Build. From 4ccca043cf8097f6baa138ff662967446bf25409 Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Fri, 27 Sep 2019 10:22:44 -0400 Subject: [PATCH 4/7] Update README.md --- README.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/README.md b/README.md index 04e3d579..5c44003e 100644 --- a/README.md +++ b/README.md @@ -20,21 +20,15 @@ This project is a work in progress and the schedule for implementing the items i Security - Logging +- Need support for JwT tokens for external client access to API Design - Need modern Admin UI theme - Need to cleanly separate site.css -- CSS registration for modules and skins - -Packaging -- Need ability to package/install Modules -- Need ability to package/install Themes Admin - Need fully functional administrative modules for all core entities ( user, role, site, etc… ) -- Need ability to create a new Site and auto provision Admin pages/modules - Need ability to soft delete core entities -- Re-ordering of modules in panes - Drag and Drop modules Upgrade @@ -42,9 +36,6 @@ Upgrade - integrated store/catalog of extensions - auto update - provide url to check for updates, perhaps even download in background - core and extensions -Multi-Tenant -- Need ability to provision a new tenant DB - Database - Need ability to run on SQLite From 6ade59cc09cd7171d79e5efc75c779e49c30a6a0 Mon Sep 17 00:00:00 2001 From: Emanuele Filardo Date: Thu, 19 Sep 2019 16:52:47 +0200 Subject: [PATCH 5/7] Add basic support for SoftDeletable --- Oqtane.Server/Repository/Context/DBContextBase.cs | 14 ++++++++++++++ Oqtane.Shared/Models/ISoftDeletable.cs | 11 +++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Oqtane.Shared/Models/ISoftDeletable.cs diff --git a/Oqtane.Server/Repository/Context/DBContextBase.cs b/Oqtane.Server/Repository/Context/DBContextBase.cs index 8fb37ffb..587f078e 100644 --- a/Oqtane.Server/Repository/Context/DBContextBase.cs +++ b/Oqtane.Server/Repository/Context/DBContextBase.cs @@ -70,6 +70,20 @@ namespace Oqtane.Repository item.CurrentValues[nameof(IAuditable.ModifiedBy)] = username; item.CurrentValues[nameof(IAuditable.ModifiedOn)] = date; } + + if (item.Entity is ISoftDeletable softDeleted) + { + if ((bool)item.CurrentValues[nameof(ISoftDeletable.IsSoftDeleted)]) + { + item.CurrentValues[nameof(ISoftDeletable.DeletedBy)] = username; + item.CurrentValues[nameof(ISoftDeletable.DeletedOn)] = date; + } + else + { + item.CurrentValues[nameof(ISoftDeletable.DeletedBy)] = null; + item.CurrentValues[nameof(ISoftDeletable.DeletedOn)] = null; + } + } } return base.SaveChanges(); diff --git a/Oqtane.Shared/Models/ISoftDeletable.cs b/Oqtane.Shared/Models/ISoftDeletable.cs new file mode 100644 index 00000000..a0c1f370 --- /dev/null +++ b/Oqtane.Shared/Models/ISoftDeletable.cs @@ -0,0 +1,11 @@ +using System; + +namespace Oqtane.Models +{ + public interface ISoftDeletable + { + string DeletedBy { get; set; } + DateTime? DeletedOn { get; set; } + bool IsSoftDeleted { get; set; } + } +} From 182a156bd8db76189bc9a744cd169026a488f3af Mon Sep 17 00:00:00 2001 From: Emanuele Filardo Date: Fri, 20 Sep 2019 17:51:13 +0200 Subject: [PATCH 6/7] Improved to skip new Added entities and if softdelete properties are unmodified --- Oqtane.Server/Repository/Context/DBContextBase.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Oqtane.Server/Repository/Context/DBContextBase.cs b/Oqtane.Server/Repository/Context/DBContextBase.cs index 587f078e..20e3254e 100644 --- a/Oqtane.Server/Repository/Context/DBContextBase.cs +++ b/Oqtane.Server/Repository/Context/DBContextBase.cs @@ -71,14 +71,16 @@ namespace Oqtane.Repository item.CurrentValues[nameof(IAuditable.ModifiedOn)] = date; } - if (item.Entity is ISoftDeletable softDeleted) + if (item.Entity is ISoftDeletable softDeleted && item.State != EntityState.Added) { - if ((bool)item.CurrentValues[nameof(ISoftDeletable.IsSoftDeleted)]) + if ((bool)item.CurrentValues[nameof(ISoftDeletable.IsSoftDeleted)] + && !item.GetDatabaseValues().GetValue(nameof(ISoftDeletable.IsSoftDeleted))) { item.CurrentValues[nameof(ISoftDeletable.DeletedBy)] = username; item.CurrentValues[nameof(ISoftDeletable.DeletedOn)] = date; } - else + else if (!(bool)item.CurrentValues[nameof(ISoftDeletable.IsSoftDeleted)] + && item.GetDatabaseValues().GetValue(nameof(ISoftDeletable.IsSoftDeleted))) { item.CurrentValues[nameof(ISoftDeletable.DeletedBy)] = null; item.CurrentValues[nameof(ISoftDeletable.DeletedOn)] = null; From 4792ea697b3319e7a2105043889d6705d8ee419c Mon Sep 17 00:00:00 2001 From: Emanuele Filardo Date: Fri, 27 Sep 2019 18:50:25 +0200 Subject: [PATCH 7/7] Rename Interface in IDeletable and property in IsDeleted --- .../Repository/Context/DBContextBase.cs | 19 ++++++++++--------- .../IDeletable.cs} | 6 +++--- 2 files changed, 13 insertions(+), 12 deletions(-) rename Oqtane.Shared/{Models/ISoftDeletable.cs => Shared/IDeletable.cs} (53%) diff --git a/Oqtane.Server/Repository/Context/DBContextBase.cs b/Oqtane.Server/Repository/Context/DBContextBase.cs index 20e3254e..25956f19 100644 --- a/Oqtane.Server/Repository/Context/DBContextBase.cs +++ b/Oqtane.Server/Repository/Context/DBContextBase.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Oqtane.Models; +using Oqtane.Shared; using System; using System.Linq; @@ -71,19 +72,19 @@ namespace Oqtane.Repository item.CurrentValues[nameof(IAuditable.ModifiedOn)] = date; } - if (item.Entity is ISoftDeletable softDeleted && item.State != EntityState.Added) + if (item.Entity is IDeletable deleted && item.State != EntityState.Added) { - if ((bool)item.CurrentValues[nameof(ISoftDeletable.IsSoftDeleted)] - && !item.GetDatabaseValues().GetValue(nameof(ISoftDeletable.IsSoftDeleted))) + if ((bool)item.CurrentValues[nameof(IDeletable.IsDeleted)] + && !item.GetDatabaseValues().GetValue(nameof(IDeletable.IsDeleted))) { - item.CurrentValues[nameof(ISoftDeletable.DeletedBy)] = username; - item.CurrentValues[nameof(ISoftDeletable.DeletedOn)] = date; + item.CurrentValues[nameof(IDeletable.DeletedBy)] = username; + item.CurrentValues[nameof(IDeletable.DeletedOn)] = date; } - else if (!(bool)item.CurrentValues[nameof(ISoftDeletable.IsSoftDeleted)] - && item.GetDatabaseValues().GetValue(nameof(ISoftDeletable.IsSoftDeleted))) + else if (!(bool)item.CurrentValues[nameof(IDeletable.IsDeleted)] + && item.GetDatabaseValues().GetValue(nameof(IDeletable.IsDeleted))) { - item.CurrentValues[nameof(ISoftDeletable.DeletedBy)] = null; - item.CurrentValues[nameof(ISoftDeletable.DeletedOn)] = null; + item.CurrentValues[nameof(IDeletable.DeletedBy)] = null; + item.CurrentValues[nameof(IDeletable.DeletedOn)] = null; } } } diff --git a/Oqtane.Shared/Models/ISoftDeletable.cs b/Oqtane.Shared/Shared/IDeletable.cs similarity index 53% rename from Oqtane.Shared/Models/ISoftDeletable.cs rename to Oqtane.Shared/Shared/IDeletable.cs index a0c1f370..6198dcde 100644 --- a/Oqtane.Shared/Models/ISoftDeletable.cs +++ b/Oqtane.Shared/Shared/IDeletable.cs @@ -1,11 +1,11 @@ using System; -namespace Oqtane.Models +namespace Oqtane.Shared { - public interface ISoftDeletable + public interface IDeletable { string DeletedBy { get; set; } DateTime? DeletedOn { get; set; } - bool IsSoftDeleted { get; set; } + bool IsDeleted { get; set; } } }