From 0d1aa4f6becf469eec61ffcd569ec3a2799ceb6f Mon Sep 17 00:00:00 2001 From: Anatolii Grynchuk Date: Tue, 12 May 2026 21:37:38 +0300 Subject: [PATCH 1/2] chore: update package versions and refactor TransactionBehavior - Upgrade EF Core packages to 10.0.x and HrynCo.DAL.Abstract to 1.0.10 - Refactor TransactionBehavior to simplify transaction handling logic --- Directory.Packages.props | 12 ++++++------ .../Behaviors/TransactionBehavior.cs | 16 ++++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index a3174ae..ebb6ee0 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,10 +4,10 @@ - - - - + + + + @@ -29,7 +29,7 @@ - + @@ -39,4 +39,4 @@ - \ No newline at end of file + diff --git a/HrynCo.NotificationService.Services/Behaviors/TransactionBehavior.cs b/HrynCo.NotificationService.Services/Behaviors/TransactionBehavior.cs index 1939570..87290a3 100644 --- a/HrynCo.NotificationService.Services/Behaviors/TransactionBehavior.cs +++ b/HrynCo.NotificationService.Services/Behaviors/TransactionBehavior.cs @@ -18,11 +18,15 @@ public class TransactionBehavior : IPipelineBehavior Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) => _profiler.MeasureExecutionAsync( - () => _unitOfWork.ExecuteInTransactionAsync(async () => + async () => { - TResponse response = await next(); - await _unitOfWork.SaveChangesAsync(cancellationToken); - return response; - }), + TResponse? response = default; + await _unitOfWork.ExecuteInTransactionAsync(async () => + { + response = await next(); + }); + + return response!; + }, typeof(TRequest).Name); -} \ No newline at end of file +} -- 2.52.0 From 9490718c043b6f60331ff1ec07d17ef35aaa6619 Mon Sep 17 00:00:00 2001 From: Anatolii Grynchuk Date: Tue, 12 May 2026 21:56:50 +0300 Subject: [PATCH 2/2] feat: add real-time email template preview with variable interpolation - Introduce preview panel to edit form for rendering subject, HTML, and text with sample values. - Add support for real-time updates using JavaScript. - Include supporting styles for preview panel in admin CSS. - Add optional `Scripts` section rendering to `_EditorLayout`. - Create `.env.Development` for better development environment configuration. --- .../Views/AdminTemplates/Edit.cshtml | 200 ++++++++++++++++++ .../Views/Shared/_EditorLayout.cshtml | 1 + .../wwwroot/css/admin.css | 103 +++++++++ docker/environments/.env.Development | 9 + 4 files changed, 313 insertions(+) create mode 100644 docker/environments/.env.Development diff --git a/HrynCo.NotificationService.Web/Views/AdminTemplates/Edit.cshtml b/HrynCo.NotificationService.Web/Views/AdminTemplates/Edit.cshtml index dc24870..891e163 100644 --- a/HrynCo.NotificationService.Web/Views/AdminTemplates/Edit.cshtml +++ b/HrynCo.NotificationService.Web/Views/AdminTemplates/Edit.cshtml @@ -64,6 +64,35 @@
JSON array of {"name":"...", "required":true|false}
+
+
+
+
Preview
+
Rendered with sample values from the variable list.
+
+ Ready +
+ +
+
+
Sample values
+
+
Change these values to see the rendered output update immediately.
+
+ +
+
Rendered subject
+
+ +
Rendered HTML
+ + +
Rendered text
+

+            
+
+
+ @section FormActions {