✨ Enhance page management and dialog functionality
- `PageActionDialogBox.razor`: Add form fields and data grid Added fields for section title, button title, address, description, type, and query. Added button and data grid for sections. - `PageActionDialogBox.razor.cs`: Add `InitializeAsync` method Added using directives, `InitializeAsync` method, `IsEditing` flag, and `PageId` property. - `PagesManagementPage.razor`: Add edit button for pages Added edit button to trigger `EditPageAsync` method for each page. - `PagesManagementPage.razor.cs`: Refactor for constructor injection Refactored to use constructor injection. Added `EditPageAsync` method and updated `RemovePageAsync` method. - `IPageRestApi.cs`: Change return type of `ReadById` method Updated return type from `BasePageSDto` to `BasePageLDto`. Changes made by Amir.H Khademimaster
parent
6da620690d
commit
5dc92f63e7
|
@ -38,7 +38,7 @@ public class PageController : ICarterModule
|
||||||
.HasApiVersion(1.0)
|
.HasApiVersion(1.0)
|
||||||
.RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser().RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManagePages));
|
.RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser().RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManagePages));
|
||||||
|
|
||||||
group.MapPost("", UpdatePageAsync)
|
group.MapPut("", UpdatePageAsync)
|
||||||
.WithDisplayName("Update Page")
|
.WithDisplayName("Update Page")
|
||||||
.HasApiVersion(1.0)
|
.HasApiVersion(1.0)
|
||||||
.RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser().RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManagePages));
|
.RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser().RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManagePages));
|
||||||
|
|
|
@ -26,7 +26,6 @@ public class PageService(
|
||||||
if (page == null)
|
if (page == null)
|
||||||
throw new AppException("Page not found", ApiResultStatusCode.NotFound);
|
throw new AppException("Page not found", ApiResultStatusCode.NotFound);
|
||||||
|
|
||||||
var entityType = Assembly.GetAssembly(typeof(DomainConfig))?.GetType(page.Type);
|
|
||||||
var dto = page.Adapt<BasePageLDto>();
|
var dto = page.Adapt<BasePageLDto>();
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
|
|
|
@ -10,6 +10,7 @@ public class BasePageLDto : BaseDto<BasePageLDto, BasePage>
|
||||||
public bool IsHtmlBasePage { get; set; }
|
public bool IsHtmlBasePage { get; set; }
|
||||||
public string Slug { get; set; } = string.Empty;
|
public string Slug { get; set; } = string.Empty;
|
||||||
public string Data { get; set; } = string.Empty;
|
public string Data { get; set; } = string.Empty;
|
||||||
|
public string Type { get; set; } = string.Empty;
|
||||||
public DateTime ModifiedAt { get; set; }
|
public DateTime ModifiedAt { get; set; }
|
||||||
public bool Indexing { get; set; }
|
public bool Indexing { get; set; }
|
||||||
public List<BasePageSection> Sections { get; set; } = new();
|
public List<BasePageSection> Sections { get; set; } = new();
|
||||||
|
|
Loading…
Reference in New Issue