From ab8a1e7324e26a9ec42339d160c5312acfed4b55 Mon Sep 17 00:00:00 2001 From: Mike Casas Date: Thu, 18 Jun 2020 06:13:15 -0400 Subject: [PATCH 01/11] Step 1. --- Oqtane.Server/Controllers/UserController.cs | 2 ++ Oqtane.Server/Oqtane.Server.csproj | 4 ++++ Oqtane.Server/Scripts/Notification.01.00.01.00.sql | 9 +++++++++ Oqtane.Shared/Models/Notification.cs | 1 + 4 files changed, 16 insertions(+) create mode 100644 Oqtane.Server/Scripts/Notification.01.00.01.00.sql diff --git a/Oqtane.Server/Controllers/UserController.cs b/Oqtane.Server/Controllers/UserController.cs index 6fb3c93b..d850f9ae 100644 --- a/Oqtane.Server/Controllers/UserController.cs +++ b/Oqtane.Server/Controllers/UserController.cs @@ -157,6 +157,7 @@ namespace Oqtane.Controllers notification.CreatedOn = DateTime.UtcNow; notification.IsDelivered = false; notification.DeliveredOn = null; + notification.SendOn = DateTime.UtcNow; _notifications.AddNotification(notification); } @@ -385,6 +386,7 @@ namespace Oqtane.Controllers notification.CreatedOn = DateTime.UtcNow; notification.IsDelivered = false; notification.DeliveredOn = null; + notification.SendOn = DateTime.UtcNow; _notifications.AddNotification(notification); _logger.Log(LogLevel.Information, this, LogFunction.Security, "Password Reset Notification Sent For {Username}", user.Username); } diff --git a/Oqtane.Server/Oqtane.Server.csproj b/Oqtane.Server/Oqtane.Server.csproj index 0db9ece5..6c2af753 100644 --- a/Oqtane.Server/Oqtane.Server.csproj +++ b/Oqtane.Server/Oqtane.Server.csproj @@ -22,10 +22,14 @@ + + + + diff --git a/Oqtane.Server/Scripts/Notification.01.00.01.00.sql b/Oqtane.Server/Scripts/Notification.01.00.01.00.sql new file mode 100644 index 00000000..3acdbf29 --- /dev/null +++ b/Oqtane.Server/Scripts/Notification.01.00.01.00.sql @@ -0,0 +1,9 @@ +/* + +Version 1.0.1 Notification migration script + +*/ + +ALTER TABLE [dbo].[Notification] ADD + [SendOn] [datetime] NULL +GO \ No newline at end of file diff --git a/Oqtane.Shared/Models/Notification.cs b/Oqtane.Shared/Models/Notification.cs index aeb7235d..7ccdbd9d 100644 --- a/Oqtane.Shared/Models/Notification.cs +++ b/Oqtane.Shared/Models/Notification.cs @@ -22,6 +22,7 @@ namespace Oqtane.Models public string DeletedBy { get; set; } public DateTime? DeletedOn { get; set; } public bool IsDeleted { get; set; } + public DateTime? SendOn { get; set; } } } From ee5553ad8a3d908bccafb81c8a7316639e351a4d Mon Sep 17 00:00:00 2001 From: Mike Casas Date: Thu, 18 Jun 2020 07:35:40 -0400 Subject: [PATCH 02/11] Step 2. --- Oqtane.Client/Modules/Admin/UserProfile/Add.razor | 3 ++- Oqtane.Client/Modules/Admin/UserProfile/View.razor | 3 ++- Oqtane.Server/Repository/NotificationRepository.cs | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Oqtane.Client/Modules/Admin/UserProfile/Add.razor b/Oqtane.Client/Modules/Admin/UserProfile/Add.razor index c413ec91..b19bae1d 100644 --- a/Oqtane.Client/Modules/Admin/UserProfile/Add.razor +++ b/Oqtane.Client/Modules/Admin/UserProfile/Add.razor @@ -65,7 +65,8 @@ notification.ParentId = null; notification.CreatedOn = DateTime.UtcNow; notification.IsDelivered = false; - notification.DeliveredOn = null; + notification.DeliveredOn = null; + notification.SendOn = DateTime.UtcNow; notification = await NotificationService.AddNotificationAsync(notification); await logger.LogInformation("Notification Created {Notification}", notification); NavigationManager.NavigateTo(NavigateUrl()); diff --git a/Oqtane.Client/Modules/Admin/UserProfile/View.razor b/Oqtane.Client/Modules/Admin/UserProfile/View.razor index 2e48fcb1..32dde145 100644 --- a/Oqtane.Client/Modules/Admin/UserProfile/View.razor +++ b/Oqtane.Client/Modules/Admin/UserProfile/View.razor @@ -191,7 +191,8 @@ notification.ParentId = notificationid; notification.CreatedOn = DateTime.UtcNow; notification.IsDelivered = false; - notification.DeliveredOn = null; + notification.DeliveredOn = null; + notification.SendOn = DateTime.UtcNow; notification = await NotificationService.AddNotificationAsync(notification); await logger.LogInformation("Notification Created {Notification}", notification); NavigationManager.NavigateTo(NavigateUrl()); diff --git a/Oqtane.Server/Repository/NotificationRepository.cs b/Oqtane.Server/Repository/NotificationRepository.cs index 4e6550d2..45730d84 100644 --- a/Oqtane.Server/Repository/NotificationRepository.cs +++ b/Oqtane.Server/Repository/NotificationRepository.cs @@ -21,6 +21,7 @@ namespace Oqtane.Repository return _db.Notification .Where(item => item.SiteId == siteId) .Where(item => item.IsDelivered == false) + .Where(item => item.SendOn < System.DateTime.UtcNow) .ToList(); } From 40571bfb6eb937d8188f0171bf7b4b341b0b8477 Mon Sep 17 00:00:00 2001 From: Mike Casas Date: Thu, 18 Jun 2020 08:40:43 -0400 Subject: [PATCH 03/11] Bug Fix. Not sure why the email address was not being added to the notification. --- Oqtane.Server/Controllers/UserController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Oqtane.Server/Controllers/UserController.cs b/Oqtane.Server/Controllers/UserController.cs index d850f9ae..d27694b4 100644 --- a/Oqtane.Server/Controllers/UserController.cs +++ b/Oqtane.Server/Controllers/UserController.cs @@ -148,7 +148,7 @@ namespace Oqtane.Controllers notification.SiteId = user.SiteId; notification.FromUserId = null; notification.ToUserId = newUser.UserId; - notification.ToEmail = ""; + notification.ToEmail = newUser.Email; notification.Subject = "User Account Verification"; string token = await _identityUserManager.GenerateEmailConfirmationTokenAsync(identityuser); string url = HttpContext.Request.Scheme + "://" + _tenants.GetAlias().Name + "/login?name=" + user.Username + "&token=" + WebUtility.UrlEncode(token); From 7d896709305249a688831cbdef75ef65b5a1e00c Mon Sep 17 00:00:00 2001 From: Mike Casas Date: Thu, 18 Jun 2020 12:58:30 -0400 Subject: [PATCH 04/11] Fixed the sql script file name and added update for null values. --- .../{Notification.01.00.01.00.sql => Tenant.01.00.01.01.sql} | 3 +++ 1 file changed, 3 insertions(+) rename Oqtane.Server/Scripts/{Notification.01.00.01.00.sql => Tenant.01.00.01.01.sql} (61%) diff --git a/Oqtane.Server/Scripts/Notification.01.00.01.00.sql b/Oqtane.Server/Scripts/Tenant.01.00.01.01.sql similarity index 61% rename from Oqtane.Server/Scripts/Notification.01.00.01.00.sql rename to Oqtane.Server/Scripts/Tenant.01.00.01.01.sql index 3acdbf29..76af104c 100644 --- a/Oqtane.Server/Scripts/Notification.01.00.01.00.sql +++ b/Oqtane.Server/Scripts/Tenant.01.00.01.01.sql @@ -6,4 +6,7 @@ Version 1.0.1 Notification migration script ALTER TABLE [dbo].[Notification] ADD [SendOn] [datetime] NULL +GO + +UPDATE [dbo].[Notification] SET SendOn = CreatedOn WHERE SendOn IS NULL GO \ No newline at end of file From 20b83c88090e55e472a26f750b332293db359f04 Mon Sep 17 00:00:00 2001 From: Mike Casas Date: Thu, 18 Jun 2020 13:09:57 -0400 Subject: [PATCH 05/11] Updated csproj. --- Oqtane.Server/Oqtane.Server.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Oqtane.Server/Oqtane.Server.csproj b/Oqtane.Server/Oqtane.Server.csproj index 6c2af753..7ae38416 100644 --- a/Oqtane.Server/Oqtane.Server.csproj +++ b/Oqtane.Server/Oqtane.Server.csproj @@ -23,13 +23,13 @@ - + - + From 882412b8ffe68fd4e98c25e396dd0ff72bc49a0f Mon Sep 17 00:00:00 2001 From: Cody Date: Thu, 18 Jun 2020 22:22:16 -0700 Subject: [PATCH 06/11] button/input columns style="width: 1px" --- Oqtane.Client/Modules/Admin/Files/Index.razor | 2 +- Oqtane.Client/Modules/Admin/Jobs/Index.razor | 8 ++++---- Oqtane.Client/Modules/Admin/Logs/Index.razor | 2 +- .../Modules/Admin/ModuleDefinitions/Add.razor | 2 +- .../Admin/ModuleDefinitions/Index.razor | 6 +++--- Oqtane.Client/Modules/Admin/Pages/Index.razor | 4 ++-- .../Modules/Admin/Profiles/Index.razor | 4 ++-- .../Modules/Admin/RecycleBin/Index.razor | 8 ++++---- Oqtane.Client/Modules/Admin/Roles/Index.razor | 6 +++--- Oqtane.Client/Modules/Admin/Sites/Index.razor | 4 ++-- .../Modules/Admin/Tenants/Index.razor | 4 ++-- Oqtane.Client/Modules/Admin/Themes/Add.razor | 2 +- .../Modules/Admin/Themes/Index.razor | 9 +++++---- .../Modules/Admin/UserProfile/Index.razor | 4 ++-- .../Modules/Admin/UserProfile/View.razor | 8 ++++---- Oqtane.Client/Modules/Admin/Users/Index.razor | 6 +++--- .../Modules/Controls/PermissionGrid.razor | 19 ++++++++++--------- 17 files changed, 50 insertions(+), 48 deletions(-) diff --git a/Oqtane.Client/Modules/Admin/Files/Index.razor b/Oqtane.Client/Modules/Admin/Files/Index.razor index d92e0994..1c5f5783 100644 --- a/Oqtane.Client/Modules/Admin/Files/Index.razor +++ b/Oqtane.Client/Modules/Admin/Files/Index.razor @@ -28,7 +28,7 @@
-   +   Name Modified Type diff --git a/Oqtane.Client/Modules/Admin/Jobs/Index.razor b/Oqtane.Client/Modules/Admin/Jobs/Index.razor index f15c50df..6ba8c69b 100644 --- a/Oqtane.Client/Modules/Admin/Jobs/Index.razor +++ b/Oqtane.Client/Modules/Admin/Jobs/Index.razor @@ -15,14 +15,14 @@ else
-   -   -   +   +   +   Name Status Frequency Next Execution -   +  
diff --git a/Oqtane.Client/Modules/Admin/Logs/Index.razor b/Oqtane.Client/Modules/Admin/Logs/Index.razor index 730c6d13..3fcb0fb5 100644 --- a/Oqtane.Client/Modules/Admin/Logs/Index.razor +++ b/Oqtane.Client/Modules/Admin/Logs/Index.razor @@ -49,7 +49,7 @@ else {
-   +   Date Level Feature diff --git a/Oqtane.Client/Modules/Admin/ModuleDefinitions/Add.razor b/Oqtane.Client/Modules/Admin/ModuleDefinitions/Add.razor index 4d13338e..72dde55c 100644 --- a/Oqtane.Client/Modules/Admin/ModuleDefinitions/Add.razor +++ b/Oqtane.Client/Modules/Admin/ModuleDefinitions/Add.razor @@ -16,7 +16,7 @@
Name Version - +
@context.Name diff --git a/Oqtane.Client/Modules/Admin/ModuleDefinitions/Index.razor b/Oqtane.Client/Modules/Admin/ModuleDefinitions/Index.razor index 88590d5e..fab64a64 100644 --- a/Oqtane.Client/Modules/Admin/ModuleDefinitions/Index.razor +++ b/Oqtane.Client/Modules/Admin/ModuleDefinitions/Index.razor @@ -14,11 +14,11 @@ else
-   -   +   +   Name Version -   +  
diff --git a/Oqtane.Client/Modules/Admin/Pages/Index.razor b/Oqtane.Client/Modules/Admin/Pages/Index.razor index b53f3811..02d1d14c 100644 --- a/Oqtane.Client/Modules/Admin/Pages/Index.razor +++ b/Oqtane.Client/Modules/Admin/Pages/Index.razor @@ -9,8 +9,8 @@
-   -   +   +   Name
diff --git a/Oqtane.Client/Modules/Admin/Profiles/Index.razor b/Oqtane.Client/Modules/Admin/Profiles/Index.razor index e3cefdaa..36df1731 100644 --- a/Oqtane.Client/Modules/Admin/Profiles/Index.razor +++ b/Oqtane.Client/Modules/Admin/Profiles/Index.razor @@ -12,8 +12,8 @@ else
-   -   +   +   Name
diff --git a/Oqtane.Client/Modules/Admin/RecycleBin/Index.razor b/Oqtane.Client/Modules/Admin/RecycleBin/Index.razor index d3955307..220f5ffe 100644 --- a/Oqtane.Client/Modules/Admin/RecycleBin/Index.razor +++ b/Oqtane.Client/Modules/Admin/RecycleBin/Index.razor @@ -16,8 +16,8 @@ {
-   -   +   +   Name Deleted By Deleted On @@ -42,8 +42,8 @@ {
-   -   +   +   Page Module Deleted By diff --git a/Oqtane.Client/Modules/Admin/Roles/Index.razor b/Oqtane.Client/Modules/Admin/Roles/Index.razor index 881a9348..a41998d4 100644 --- a/Oqtane.Client/Modules/Admin/Roles/Index.razor +++ b/Oqtane.Client/Modules/Admin/Roles/Index.razor @@ -12,9 +12,9 @@ else
-   -   -   +   +   +   Name
diff --git a/Oqtane.Client/Modules/Admin/Sites/Index.razor b/Oqtane.Client/Modules/Admin/Sites/Index.razor index d8b79632..8d82492d 100644 --- a/Oqtane.Client/Modules/Admin/Sites/Index.razor +++ b/Oqtane.Client/Modules/Admin/Sites/Index.razor @@ -14,8 +14,8 @@ else
-   -   +   +   Name
diff --git a/Oqtane.Client/Modules/Admin/Tenants/Index.razor b/Oqtane.Client/Modules/Admin/Tenants/Index.razor index ead272dc..1ce7c686 100644 --- a/Oqtane.Client/Modules/Admin/Tenants/Index.razor +++ b/Oqtane.Client/Modules/Admin/Tenants/Index.razor @@ -11,8 +11,8 @@ else {
-   -   +   +   Name
diff --git a/Oqtane.Client/Modules/Admin/Themes/Add.razor b/Oqtane.Client/Modules/Admin/Themes/Add.razor index 327a7d3a..bc280dff 100644 --- a/Oqtane.Client/Modules/Admin/Themes/Add.razor +++ b/Oqtane.Client/Modules/Admin/Themes/Add.razor @@ -16,7 +16,7 @@
Name Version - +
@context.Name diff --git a/Oqtane.Client/Modules/Admin/Themes/Index.razor b/Oqtane.Client/Modules/Admin/Themes/Index.razor index d2e6b2e9..f3945afb 100644 --- a/Oqtane.Client/Modules/Admin/Themes/Index.razor +++ b/Oqtane.Client/Modules/Admin/Themes/Index.razor @@ -15,10 +15,10 @@ else
-   -   - Name - Version +   +   + Name + Version  
@@ -37,6 +37,7 @@ else } +
} diff --git a/Oqtane.Client/Modules/Admin/UserProfile/Index.razor b/Oqtane.Client/Modules/Admin/UserProfile/Index.razor index 82ff8309..9823ad6a 100644 --- a/Oqtane.Client/Modules/Admin/UserProfile/Index.razor +++ b/Oqtane.Client/Modules/Admin/UserProfile/Index.razor @@ -111,8 +111,8 @@ else {
-   -   +   +   From Subject Received diff --git a/Oqtane.Client/Modules/Admin/UserProfile/View.razor b/Oqtane.Client/Modules/Admin/UserProfile/View.razor index 2e48fcb1..ea3382f2 100644 --- a/Oqtane.Client/Modules/Admin/UserProfile/View.razor +++ b/Oqtane.Client/Modules/Admin/UserProfile/View.razor @@ -33,7 +33,7 @@ -} + } @if (title == "To") { @@ -51,7 +51,7 @@ -} + } @if (title == "From") { @@ -62,7 +62,7 @@