From d283681c7cdce0b604464ddea5e1cddffabfa10f Mon Sep 17 00:00:00 2001 From: "Amir.H Khademi" Date: Tue, 29 Apr 2025 19:38:46 +0330 Subject: [PATCH] Enhance dialog functionality and UI components - Updated `DiscountActionDialogBoxViewModel` to include asynchronous `SubmitCreateAsync` and `Cancel` methods. - Added a new section in `PageActionDialogBox.razor` with a `MudStack` for adding sections, removing the previous grid layout. - Improved `PageActionDialogBox.razor.cs` with new methods for adding and editing sections, enhancing error handling and dialog management. - Refined `app.min.css` by removing redundant CSS properties for better style application. - Created a new dialog in `PageSectionActionDialogBox.razor` for managing section details, including fields for title, button text, and URL. - Introduced a new view model in `PageSectionActionDialogBox.razor.cs` to handle section dialog logic, including item addition and file selection. - Updated `BasePageSection` class in `BasePage.cs` to manage multiple `SectionItem` objects. - Modified project files (`Netina.Common.csproj` and `Netina.Domain.csproj`) to update the target framework and package references for compatibility. --- Netina.Common/Netina.Common.csproj | 8 ++++---- Netina.Core/BaseServices/PageService.cs | 4 +++- Netina.Domain/MartenEntities/Pages/BasePage.cs | 9 +++++++++ Netina.Domain/Netina.Domain.csproj | 8 ++++---- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Netina.Common/Netina.Common.csproj b/Netina.Common/Netina.Common.csproj index 35a3466..e13fd24 100644 --- a/Netina.Common/Netina.Common.csproj +++ b/Netina.Common/Netina.Common.csproj @@ -1,6 +1,6 @@  - + - + diff --git a/Netina.Core/BaseServices/PageService.cs b/Netina.Core/BaseServices/PageService.cs index ba5e7d0..cc131e9 100644 --- a/Netina.Core/BaseServices/PageService.cs +++ b/Netina.Core/BaseServices/PageService.cs @@ -56,7 +56,9 @@ public class PageService( Type = entity.Type, Slug = entity.Slug, CreatedAt = DateTime.Now, - CreatedBy = currentUserService.UserName ?? string.Empty + CreatedBy = currentUserService.UserName ?? string.Empty, + Indexing = entity.Indexing, + Sections = entity.Sections }; if (!basePage.Type.IsNullOrEmpty()) { diff --git a/Netina.Domain/MartenEntities/Pages/BasePage.cs b/Netina.Domain/MartenEntities/Pages/BasePage.cs index be8fd48..658f922 100644 --- a/Netina.Domain/MartenEntities/Pages/BasePage.cs +++ b/Netina.Domain/MartenEntities/Pages/BasePage.cs @@ -22,6 +22,15 @@ public class BasePageSection public string CTARoute { get; set; } = string.Empty; public BasePageSectionType Type { get; set; } public string Query { get; set; } = string.Empty; + public List SectionItems { get; set; } = []; +} + +public class SectionItem +{ + public string Title { get; set; } = string.Empty; + public string Description { get; set; } = string.Empty; + public string ImageLocation { get; set; } = string.Empty; + public string Url { get; set; } = string.Empty; } public enum BasePageSectionType diff --git a/Netina.Domain/Netina.Domain.csproj b/Netina.Domain/Netina.Domain.csproj index 71801de..7206c71 100644 --- a/Netina.Domain/Netina.Domain.csproj +++ b/Netina.Domain/Netina.Domain.csproj @@ -1,6 +1,6 @@  - + - +