diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/CmsKitWebUnifiedModule.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/CmsKitWebUnifiedModule.cs index 801cc2dd41..0343a3bc58 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/CmsKitWebUnifiedModule.cs +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/CmsKitWebUnifiedModule.cs @@ -36,7 +36,6 @@ using Volo.Abp.Threading; using Volo.Abp.VirtualFileSystem; using Volo.CmsKit.Admin.Web; using Volo.CmsKit.Comments; -using Volo.CmsKit.Contents; using Volo.CmsKit.EntityFrameworkCore; using Volo.CmsKit.MediaDescriptors; using Volo.CmsKit.MultiTenancy; @@ -45,6 +44,7 @@ using Volo.CmsKit.Ratings; using Volo.CmsKit.Reactions; using Volo.CmsKit.Tags; using Volo.CmsKit.Web; +using Volo.CmsKit.Web.Contents; namespace Volo.CmsKit; diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/IContentAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/IContentAdminAppService.cs deleted file mode 100644 index 28a1e7d992..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/IContentAdminAppService.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; - -namespace Volo.CmsKit.Admin.Contents; -public interface IContentAdminAppService : IApplicationService -{ - Task> GetWidgetsAsync(); -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo.CmsKit.Admin.Application.csproj b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo.CmsKit.Admin.Application.csproj index 684446b1f0..09faad6247 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo.CmsKit.Admin.Application.csproj +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo.CmsKit.Admin.Application.csproj @@ -13,4 +13,8 @@ + + + + diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Contents/ContentAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Contents/ContentAdminAppService.cs deleted file mode 100644 index 8d06586e29..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Contents/ContentAdminAppService.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Linq; -using System.Threading.Tasks; -using Microsoft.Extensions.Options; -using Volo.Abp.Application.Dtos; -using Volo.CmsKit.Contents; - -namespace Volo.CmsKit.Admin.Contents; - -public class ContentAdminAppService : CmsKitAdminAppServiceBase, IContentAdminAppService -{ - private readonly CmsKitContentWidgetOptions _options; - - public ContentAdminAppService(IOptions options) - { - _options = options.Value; - } - - public virtual Task> GetWidgetsAsync() - { - return Task.FromResult(new ListResultDto() - { - Items = _options.WidgetConfigs - .Select(n => - new ContentWidgetDto - { - Key = n.Key, - Details = new WidgetDetailDto() { EditorComponentName = n.Value.EditorComponentName, Name = n.Value.Name }, - - }).ToList() - }); - } -} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/ContentAdminClientProxy.Generated.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/ContentAdminClientProxy.Generated.cs deleted file mode 100644 index 30c6052af3..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/ContentAdminClientProxy.Generated.cs +++ /dev/null @@ -1,22 +0,0 @@ -// This file is automatically generated by ABP framework to use MVC Controllers from CSharp -using System; -using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Http.Client; -using Volo.Abp.Http.Modeling; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Http.Client.ClientProxying; -using Volo.CmsKit.Admin.Contents; - -// ReSharper disable once CheckNamespace -namespace Volo.CmsKit.Admin.Contents.ClientProxies; - -[Dependency(ReplaceServices = true)] -[ExposeServices(typeof(IContentAdminAppService), typeof(ContentAdminClientProxy))] -public partial class ContentAdminClientProxy : ClientProxyBase, IContentAdminAppService -{ - public virtual async Task> GetWidgetsAsync() - { - return await RequestAsync>(nameof(GetWidgetsAsync)); - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/ContentAdminClientProxy.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/ContentAdminClientProxy.cs deleted file mode 100644 index d2caea5777..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/ContentAdminClientProxy.cs +++ /dev/null @@ -1,7 +0,0 @@ -// This file is part of ContentAdminClientProxy, you can customize it here -// ReSharper disable once CheckNamespace -namespace Volo.CmsKit.Admin.Contents.ClientProxies; - -public partial class ContentAdminClientProxy -{ -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/cms-kit-admin-generate-proxy.json b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/cms-kit-admin-generate-proxy.json index 32a833e884..8a9e38e4f9 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/cms-kit-admin-generate-proxy.json +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/cms-kit-admin-generate-proxy.json @@ -1191,35 +1191,6 @@ } } }, - "Volo.CmsKit.Admin.Contents.ContentAdminController": { - "controllerName": "ContentAdmin", - "controllerGroupName": "ContentAdmin", - "isRemoteService": true, - "apiVersion": null, - "type": "Volo.CmsKit.Admin.Contents.ContentAdminController", - "interfaces": [ - { - "type": "Volo.CmsKit.Admin.Contents.IContentAdminAppService" - } - ], - "actions": { - "GetWidgetsAsync": { - "uniqueName": "GetWidgetsAsync", - "name": "GetWidgetsAsync", - "httpMethod": "GET", - "url": "api/cms-kit-admin/contents", - "supportedVersions": [], - "parametersOnMethod": [], - "parameters": [], - "returnValue": { - "type": "Volo.Abp.Application.Dtos.ListResultDto", - "typeSimple": "Volo.Abp.Application.Dtos.ListResultDto" - }, - "allowAnonymous": null, - "implementFrom": "Volo.CmsKit.Admin.Contents.IContentAdminAppService" - } - } - }, "Volo.CmsKit.Admin.Comments.CommentAdminController": { "controllerName": "CommentAdmin", "controllerGroupName": "CommentAdmin", diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Contents/ContentAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Contents/ContentAdminController.cs deleted file mode 100644 index 83bfcde600..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Contents/ContentAdminController.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp; -using Volo.Abp.Application.Dtos; - -namespace Volo.CmsKit.Admin.Contents; - -[RemoteService(Name = CmsKitAdminRemoteServiceConsts.RemoteServiceName)] -[Area(CmsKitAdminRemoteServiceConsts.ModuleName)] -[Route("api/cms-kit-admin/contents")] -public class ContentAdminController : CmsKitAdminController, IContentAdminAppService -{ - protected IContentAdminAppService ContentAdminAppService { get; } - - public ContentAdminController(IContentAdminAppService contentAdminAppService) - { - ContentAdminAppService = contentAdminAppService; - } - - [HttpGet] - public virtual Task> GetWidgetsAsync() - { - return ContentAdminAppService.GetWidgetsAsync(); - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/AddWidgetModal.cshtml.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/AddWidgetModal.cshtml.cs index 5b1e8e5ea7..135e9d9257 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/AddWidgetModal.cshtml.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/AddWidgetModal.cshtml.cs @@ -3,38 +3,48 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.Extensions.Options; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; using Volo.CmsKit.Admin.Contents; using Volo.CmsKit.Contents; +using Volo.CmsKit.Web.Contents; namespace Volo.CmsKit.Admin.Web.Pages.CmsKit.Contents; public class AddWidgetModal : AbpPageModel { - protected IContentAdminAppService ContentAdminAppService { get; } [BindProperty] public ContentViewModel ViewModel { get; set; } public List Widgets { get; set; } = new(); - public AddWidgetModal(IContentAdminAppService contentAdminAppService) + private readonly CmsKitContentWidgetOptions _options; + + public AddWidgetModal(IOptions options) { - ContentAdminAppService = contentAdminAppService; + _options = options.Value; } public async Task OnGetAsync() { - var widgets = await ContentAdminAppService.GetWidgetsAsync(); + var widgets = _options.WidgetConfigs + .Select(n => + new ContentWidgetDto + { + Key = n.Key, + Details = new WidgetDetailDto() { EditorComponentName = n.Value.EditorComponentName, Name = n.Value.Name }, + + }).ToList(); + ViewModel = new ContentViewModel() { - Details = widgets.Items.Select(p => p.Details).ToList() + Details = widgets.Select(p => p.Details).ToList() }; Widgets = new List() { new(string.Empty, string.Empty) }; Widgets.AddRange(widgets - .Items .Select(w => new SelectListItem(w.Key, w.Details.Name)) .ToList()); } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/wwwroot/client-proxies/cms-kit-admin-proxy.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/wwwroot/client-proxies/cms-kit-admin-proxy.js index 94017ec7e2..3a61ef6a78 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/wwwroot/client-proxies/cms-kit-admin-proxy.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/wwwroot/client-proxies/cms-kit-admin-proxy.js @@ -247,21 +247,6 @@ })(); - // controller volo.cmsKit.admin.contents.contentAdmin - - (function(){ - - abp.utils.createNamespace(window, 'volo.cmsKit.admin.contents.contentAdmin'); - - volo.cmsKit.admin.contents.contentAdmin.getWidgets = function(ajaxParams) { - return abp.ajax($.extend(true, { - url: abp.appPath + 'api/cms-kit-admin/contents', - type: 'GET' - }, ajaxParams)); - }; - - })(); - // controller volo.cmsKit.admin.comments.commentAdmin (function(){ diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/BlogPostCommonDto.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/BlogPostCommonDto.cs index c2b2373d9c..a7bc27d713 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/BlogPostCommonDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/BlogPostCommonDto.cs @@ -1,12 +1,11 @@ using System; -using System.Collections.Generic; using Volo.Abp.Application.Dtos; using Volo.CmsKit.Users; namespace Volo.CmsKit.Contents; [Serializable] -public class BlogPostCommonDto : AuditedEntityDto, IContent +public class BlogPostCommonDto : AuditedEntityDto { public Guid BlogId { get; set; } @@ -16,8 +15,6 @@ public class BlogPostCommonDto : AuditedEntityDto, IContent public string ShortDescription { get; set; } - public List ContentFragments { get; set; } - public string Content { get; set; } public Guid? CoverImageMediaId { get; set; } diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/IContentAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/IContentAppService.cs deleted file mode 100644 index ec2b9bcf42..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/IContentAppService.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using Volo.Abp.Application.Services; - -namespace Volo.CmsKit.Contents; - -public interface IContentAppService : IApplicationService -{ - Task> ParseAsync(string content); -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/PageDto.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/PageDto.cs index 0b573be372..d495c5de20 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/PageDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/PageDto.cs @@ -5,7 +5,7 @@ using Volo.Abp.Application.Dtos; namespace Volo.CmsKit.Contents; [Serializable] -public class PageDto : EntityDto, IContent +public class PageDto : EntityDto { public string Title { get; set; } @@ -13,8 +13,6 @@ public class PageDto : EntityDto, IContent public string Content { get; set; } - public List ContentFragments { get; set; } - public string Script { get; set; } public string Style { get; set; } diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentAppService.cs deleted file mode 100644 index a227f31e18..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentAppService.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using Volo.Abp.GlobalFeatures; -using Volo.CmsKit.GlobalFeatures; - -namespace Volo.CmsKit.Contents; - -[RequiresGlobalFeature(typeof(PagesFeature))] -public class ContentAppService : CmsKitAppServiceBase, IContentAppService -{ - protected ContentParser ContentParser { get; } - - public ContentAppService(ContentParser contentParser) - { - ContentParser = contentParser; - } - - public async Task> ParseAsync(string content) - { - return await ContentParser.ParseAsync(content); - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/ContentPreview/ContentPreviewViewComponent.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/ContentPreview/ContentPreviewViewComponent.cs index 987c404e31..2251f6d0cd 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/ContentPreview/ContentPreviewViewComponent.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/ContentPreview/ContentPreviewViewComponent.cs @@ -6,21 +6,22 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc; using Volo.CmsKit.Contents; +using Volo.CmsKit.Web.Contents; namespace Volo.CmsKit.Web.Pages.CmsKit.Components.ContentPreview; public class ContentPreviewViewComponent : AbpViewComponent { - protected IContentAppService ContentAppService { get; } + protected ContentParser ContentParser { get; } - public ContentPreviewViewComponent(IContentAppService contentAppService) + public ContentPreviewViewComponent(ContentParser contentParser) { - ContentAppService = contentAppService; + ContentParser = contentParser; } public virtual async Task InvokeAsync(string content) { - var fragments = await ContentAppService.ParseAsync(content); + var fragments = await ContentParser.ParseAsync(content); return View("~/Pages/CmsKit/Components/ContentPreview/Default.cshtml", new DefaultContentDto { diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/CmsKitContentWidgetOptions.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/CmsKitContentWidgetOptions.cs similarity index 92% rename from modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/CmsKitContentWidgetOptions.cs rename to modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/CmsKitContentWidgetOptions.cs index 34eb41d3a0..ad643f7770 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/CmsKitContentWidgetOptions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/CmsKitContentWidgetOptions.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Volo.CmsKit.Contents; +namespace Volo.CmsKit.Web.Contents; public class CmsKitContentWidgetOptions { diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentParser.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentParser.cs similarity index 98% rename from modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentParser.cs rename to modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentParser.cs index aea5cc2a82..290222a376 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentParser.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentParser.cs @@ -5,9 +5,10 @@ using System.Threading.Tasks; using Microsoft.Extensions.Options; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; +using Volo.CmsKit.Contents; using static Volo.CmsKit.Contents.ContentConsts; -namespace Volo.CmsKit.Contents; +namespace Volo.CmsKit.Web.Contents; public class ContentParser : ITransientDependency { diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentWidgetConfig.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentWidgetConfig.cs similarity index 87% rename from modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentWidgetConfig.cs rename to modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentWidgetConfig.cs index e14c1888ac..69be0703fa 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentWidgetConfig.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentWidgetConfig.cs @@ -1,4 +1,4 @@ -namespace Volo.CmsKit.Contents; +namespace Volo.CmsKit.Web.Contents; public class ContentWidgetConfig { diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs index 87e851431d..5041406bd0 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs @@ -6,6 +6,7 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; using Volo.CmsKit.Blogs; + using Volo.CmsKit.Contents; using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; @@ -20,16 +21,13 @@ public class BlogPostPublicAppService : CmsKitPublicAppServiceBase, IBlogPostPub protected IBlogRepository BlogRepository { get; } protected IBlogPostRepository BlogPostRepository { get; } - protected ContentParser ContentParser { get; } public BlogPostPublicAppService( IBlogRepository blogRepository, - IBlogPostRepository blogPostRepository, - ContentParser contentParser) + IBlogPostRepository blogPostRepository) { BlogRepository = blogRepository; BlogPostRepository = blogPostRepository; - ContentParser = contentParser; } public virtual async Task GetAsync( @@ -39,10 +37,7 @@ public class BlogPostPublicAppService : CmsKitPublicAppServiceBase, IBlogPostPub var blogPost = await BlogPostRepository.GetBySlugAsync(blog.Id, blogPostSlug); - var blogPostDto = ObjectMapper.Map(blogPost); - blogPostDto.ContentFragments = await ContentParser.ParseAsync(blogPost.Content); - - return blogPostDto; + return ObjectMapper.Map(blogPost); } public virtual async Task> GetListAsync([NotNull] string blogSlug, BlogPostGetListInput input) diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs index f20a181e9b..c93adcd5a7 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs @@ -13,12 +13,10 @@ namespace Volo.CmsKit.Public.Pages; public class PagePublicAppService : CmsKitPublicAppServiceBase, IPagePublicAppService { protected IPageRepository PageRepository { get; } - protected ContentParser ContentParser { get; } - public PagePublicAppService(IPageRepository pageRepository, ContentParser contentParser) + public PagePublicAppService(IPageRepository pageRepository) { PageRepository = pageRepository; - ContentParser = contentParser; } public virtual async Task FindBySlugAsync(string slug) @@ -30,8 +28,6 @@ public class PagePublicAppService : CmsKitPublicAppServiceBase, IPagePublicAppSe return null; } - var pageDto = ObjectMapper.Map(page); - pageDto.ContentFragments = await ContentParser.ParseAsync(page.Content); - return pageDto; + return ObjectMapper.Map(page); } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs index bd0c6d5e6c..92620743ff 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs @@ -30,11 +30,9 @@ public class PublicApplicationAutoMapperProfile : Profile CreateMap(); - CreateMap() - .Ignore(x => x.ContentFragments); - - CreateMap() - .Ignore(x => x.ContentFragments); + CreateMap(); + + CreateMap(); CreateMap(); diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml index fe9227f194..d5dc5a0be8 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml @@ -9,9 +9,9 @@ @using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.ReactionSelection @using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Rating @using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Tags +@using Volo.CmsKit.Web.Renderers @using Volo.Abp.AspNetCore.Mvc.UI.Packages.HighlightJs @using Volo.CmsKit.Contents -@using Volo.CmsKit.Web.Renderers @inherits CmsKitPublicPageBase @@ -21,7 +21,7 @@ @{ - string dummyImageSource = "https://dummyimage.com/1280x720/a3a3a3/fff.png?text=" + Model.BlogPost.Title; + string dummyImageSource = "https://dummyimage.com/1280x720/a3a3a3/fff.png?text=" + Model.ViewModel.Title; var isScrollIndexEnabled = GlobalFeatureManager.Instance.IsEnabled() && Model.BlogPostScrollIndexFeature?.IsEnabled == true; } @@ -32,14 +32,13 @@ } - } -@section scripts{ + @section scripts{ @if (isScrollIndexEnabled) { @@ -55,41 +54,51 @@ } -
-
- - - - -
-

@Model.BlogPost.Title

-

- - @@@Model.BlogPost.Author?.UserName - - @Model.BlogPost.CreationTime -

- @await Component.InvokeAsync("ContentFragment", new { contentDto = Model.BlogPost }) -

- @if (Model.BlogPost.LastModificationTime != null) +

+
+ + + + +
+

@Model.ViewModel.Title

+

+ + @@@Model.ViewModel.Author?.UserName + + @Model.ViewModel.CreationTime +

+ @foreach (var contentFragment in Model.ViewModel.ContentFragments) { - @L["LastModification"].Value : @Model.BlogPost.LastModificationTime + if (contentFragment.Type == ContentConsts.Markdown) + { + @Html.Raw(await MarkdownRenderer.RenderAsync(contentFragment.GetProperty("Content"), allowHtmlTags: true, preventXSS: true)) + } + else if (contentFragment.Type == ContentConsts.Widget) + { + @await Component.InvokeAsync(contentFragment.GetProperty("Type"), contentFragment.ExtraProperties.ConvertToDynamicObject()) + } } -

-
+

+ @if (Model.ViewModel.LastModificationTime != null) + { + @L["LastModification"].Value : @Model.ViewModel.LastModificationTime + } +

+
- @if (GlobalFeatureManager.Instance.IsEnabled()) - { - if (Model.TagsFeature?.IsEnabled == true) + @if (GlobalFeatureManager.Instance.IsEnabled()) { - @await Component.InvokeAsync(typeof(TagViewComponent), new + if (Model.TagsFeature?.IsEnabled == true) { - entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, - entityId = Model.BlogPost.Id.ToString(), - urlFormat = $"/blogs/{Model.BlogSlug}?tagId={{TagId}}" - }) + @await Component.InvokeAsync(typeof(TagViewComponent), new + { + entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, + entityId = Model.ViewModel.Id.ToString(), + urlFormat = $"/blogs/{Model.BlogSlug}?tagId={{TagId}}" + }) + } } - }
@@ -100,10 +109,10 @@ if (Model.ReactionsFeature?.IsEnabled == true) { @await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), new - { - entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, - entityId = Model.BlogPost.Id.ToString() - }) + { + entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, + entityId = Model.ViewModel.Id.ToString() + }) } } @@ -113,10 +122,10 @@ if (Model.RatingsFeature?.IsEnabled == true) { @await Component.InvokeAsync(typeof(RatingViewComponent), new - { - entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, - entityId = Model.BlogPost.Id.ToString() - }) + { + entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, + entityId = Model.ViewModel.Id.ToString() + }) } } @@ -124,7 +133,6 @@
- @if (isScrollIndexEnabled) {
@@ -132,7 +140,7 @@
@L["InThisDocument"]
- +
@@ -153,7 +161,7 @@ @await Component.InvokeAsync(typeof(DefaultBlogPostCommentViewComponent), new { entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, - entityId = Model.BlogPost.Id.ToString() + entityId = Model.ViewModel.Id.ToString() }) } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml.cs index e1d9a3b0f7..87630f9bd0 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml.cs @@ -1,10 +1,12 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp.GlobalFeatures; +using Volo.Abp.ObjectMapping; using Volo.CmsKit.Blogs; using Volo.CmsKit.Contents; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Public.Blogs; +using Volo.CmsKit.Web.Contents; namespace Volo.CmsKit.Public.Web.Pages.Public.CmsKit.Blogs; @@ -16,7 +18,7 @@ public class BlogPostModel : CmsKitPublicPageModelBase [BindProperty(SupportsGet = true)] public string BlogPostSlug { get; set; } - public BlogPostCommonDto BlogPost { get; private set; } + public BlogPostViewModel ViewModel { get; private set; } public BlogFeatureDto CommentsFeature { get; private set; } @@ -25,48 +27,61 @@ public class BlogPostModel : CmsKitPublicPageModelBase public BlogFeatureDto RatingsFeature { get; private set; } public BlogFeatureDto TagsFeature { get; private set; } - + public BlogFeatureDto BlogPostScrollIndexFeature { get; private set; } protected IBlogPostPublicAppService BlogPostPublicAppService { get; } protected IBlogFeatureAppService BlogFeatureAppService { get; } + protected ContentParser ContentParser { get; } + public BlogPostModel( IBlogPostPublicAppService blogPostPublicAppService, - IBlogFeatureAppService blogFeaturePublicAppService) + IBlogFeatureAppService blogFeaturePublicAppService, + ContentParser contentParser) { BlogPostPublicAppService = blogPostPublicAppService; BlogFeatureAppService = blogFeaturePublicAppService; + ContentParser = contentParser; } - public virtual async Task OnGetAsync() + public virtual async Task OnGetAsync() { - BlogPost = await BlogPostPublicAppService.GetAsync(BlogSlug, BlogPostSlug); + var blogPostPublicDto = await BlogPostPublicAppService.GetAsync(BlogSlug, BlogPostSlug); + ViewModel = ObjectMapper.Map(blogPostPublicDto); + if (ViewModel == null) + { + return NotFound(); + } + + ViewModel.ContentFragments = await ContentParser.ParseAsync(blogPostPublicDto.Content); if (GlobalFeatureManager.Instance.IsEnabled()) { - CommentsFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, GlobalFeatures.CommentsFeature.Name); + CommentsFeature = await BlogFeatureAppService.GetOrDefaultAsync(ViewModel.BlogId, GlobalFeatures.CommentsFeature.Name); } if (GlobalFeatureManager.Instance.IsEnabled()) { - ReactionsFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, GlobalFeatures.ReactionsFeature.Name); + ReactionsFeature = await BlogFeatureAppService.GetOrDefaultAsync(ViewModel.BlogId, GlobalFeatures.ReactionsFeature.Name); } if (GlobalFeatureManager.Instance.IsEnabled()) { - RatingsFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, GlobalFeatures.RatingsFeature.Name); + RatingsFeature = await BlogFeatureAppService.GetOrDefaultAsync(ViewModel.BlogId, GlobalFeatures.RatingsFeature.Name); } if (GlobalFeatureManager.Instance.IsEnabled()) { - TagsFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, GlobalFeatures.TagsFeature.Name); + TagsFeature = await BlogFeatureAppService.GetOrDefaultAsync(ViewModel.BlogId, GlobalFeatures.TagsFeature.Name); } if (GlobalFeatureManager.Instance.IsEnabled()) { - BlogPostScrollIndexFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, GlobalFeatures.BlogPostScrollIndexFeature.Name); + BlogPostScrollIndexFeature = await BlogFeatureAppService.GetOrDefaultAsync(ViewModel.BlogId, GlobalFeatures.BlogPostScrollIndexFeature.Name); } + + return Page(); } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPostViewModel.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPostViewModel.cs new file mode 100644 index 0000000000..789d2687fc --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPostViewModel.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using AutoMapper; +using Volo.Abp.Application.Dtos; +using Volo.CmsKit.Contents; +using Volo.CmsKit.Users; + +namespace Volo.CmsKit.Public.Web.Pages.Public.CmsKit.Blogs; + +[AutoMap(typeof(BlogPostCommonDto), ReverseMap = true)] +public class BlogPostViewModel : AuditedEntityDto +{ + public Guid BlogId { get; set; } + + public string Title { get; set; } + + public string Slug { get; set; } + + public string ShortDescription { get; set; } + + public string Content { get; set; } + + public List ContentFragments { get; set; } + + public Guid? CoverImageMediaId { get; set; } + + public CmsUserDto Author { get; set; } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml index 250303177b..e14733695a 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml @@ -5,27 +5,39 @@ @using Volo.Abp.Data @using Volo.Abp.AspNetCore.Mvc.UI.Packages.HighlightJs; @using Volo.Abp.AspNetCore.Mvc.UI.Widgets; - +@using Volo.CmsKit.Web.Renderers @model Volo.CmsKit.Public.Web.Pages.Public.CmsKit.Pages.IndexModel +@inject IMarkdownToHtmlRenderer MarkdownRenderer + @section styles{ } @section scripts{ } - @await Component.InvokeAsync("ContentFragment", new { contentDto = Model.PageDto }) + @foreach (ContentFragment contentFragment in Model.ViewModel.ContentFragments) + { + if (contentFragment.Type == ContentConsts.Markdown) + { + @Html.Raw(await MarkdownRenderer.RenderAsync(contentFragment.GetProperty("Content"), allowHtmlTags: true, preventXSS: true)) + } + else if (contentFragment.Type == ContentConsts.Widget) + { + @await Component.InvokeAsync(contentFragment.GetProperty("Type"), contentFragment.ExtraProperties.ConvertToDynamicObject()) + } + } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml.cs index 7ae92d7016..18eb184742 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Mvc; using Volo.CmsKit.Contents; using Volo.CmsKit.Public.Pages; +using Volo.CmsKit.Web.Contents; using Volo.CmsKit.Web.Pages; namespace Volo.CmsKit.Public.Web.Pages.Public.CmsKit.Pages; @@ -13,21 +14,26 @@ public class IndexModel : CommonPageModel protected IPagePublicAppService PagePublicAppService { get; } - public PageDto PageDto { get; private set; } + protected ContentParser ContentParser { get; } - public IndexModel(IPagePublicAppService pagePublicAppService) + public PageViewModel ViewModel { get; private set; } + + public IndexModel(IPagePublicAppService pagePublicAppService, ContentParser contentParser) { PagePublicAppService = pagePublicAppService; + ContentParser = contentParser; } - public async Task OnGetAsync() + public virtual async Task OnGetAsync() { - PageDto = await PagePublicAppService.FindBySlugAsync(Slug); - - if (PageDto == null) + var pageDto = await PagePublicAppService.FindBySlugAsync(Slug); + ViewModel = ObjectMapper.Map(pageDto); + if (ViewModel == null) { return NotFound(); } + + ViewModel.ContentFragments = await ContentParser.ParseAsync(pageDto.Content); return Page(); } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/PageViewModel.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/PageViewModel.cs index 5e5df3e917..3195826093 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/PageViewModel.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/PageViewModel.cs @@ -1,9 +1,12 @@ using System; using System.Collections.Generic; +using AutoMapper; using Volo.CmsKit.Contents; +using Volo.CmsKit.Public.Pages; namespace Volo.CmsKit.Public.Web.Pages.Public.CmsKit.Pages; +[AutoMap(typeof(PageDto), ReverseMap = true)] public class PageViewModel { public Guid Id { get; set; } @@ -11,4 +14,8 @@ public class PageViewModel public string Title { get; set; } public List ContentFragments { get; set; } + + public string Script { get; set; } + + public string Style { get; set; } } \ No newline at end of file diff --git a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Contents/ContentAdminAppService_Tests.cs b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Contents/ContentAdminAppService_Tests.cs deleted file mode 100644 index f338d3d7d1..0000000000 --- a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Contents/ContentAdminAppService_Tests.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Linq; -using System.Threading.Tasks; -using Shouldly; -using Volo.CmsKit.Admin.Contents; -using Xunit; - -namespace Volo.CmsKit.Contents; - -public class ContentAdminAppService_Tests : CmsKitApplicationTestBase -{ - private readonly IContentAdminAppService _contentAdminAppService; - - public ContentAdminAppService_Tests() - { - _contentAdminAppService = GetRequiredService(); - } - - [Fact] - public async Task ShouldGet_PagedListAsync() - { - var widgets = await _contentAdminAppService.GetWidgetsAsync(); - - widgets.Items.Count.ShouldBe(0); - widgets.Items.Any().ShouldBeFalse(); - } - -} diff --git a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Contents/ContentParser_Test.cs b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Contents/ContentParser_Test.cs deleted file mode 100644 index b08a127111..0000000000 --- a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Contents/ContentParser_Test.cs +++ /dev/null @@ -1,138 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using Microsoft.Extensions.Options; -using Shouldly; -using Xunit; - -namespace Volo.CmsKit.Contents; -public class ContentParser_Test : CmsKitDomainTestBase -{ - private readonly CmsKitTestData testData; - private readonly IOptions _options; - private ContentParser contentParser; - - public ContentParser_Test() - { - testData = GetRequiredService(); - _options = GetRequiredService>(); - } - - [Fact] - public async Task ParseAsync_ShouldWorkWithDifferentWidgetTypes() - { - _options.Value.AddWidget(testData.PollName, testData.WidgetName, string.Empty); - _options.Value.AddWidget("ImageGallery", "ImageGallery", string.Empty); - contentParser = new ContentParser(_options); - - var content = @"**ABP Framework** is completely open source and developed in a community-driven manner. - [Widget Type=""Poll"" Code=""poll-name""] - Thanks _for_ *your * feedback. - [Widget GalleryName=""Xyz"" Type=""ImageGallery"" Source=""GoogleDrive""]"; - - var widgets = await contentParser.ParseAsync(content); - - widgets.ShouldNotBeNull(); - widgets.Count.ShouldBe(4); - widgets[1].ExtraProperties.Count.ShouldBe(2); - widgets[3].ExtraProperties.Count.ShouldBe(3); - } - - [Fact] - public async Task ParseAsync_ShouldWorkWithoutConfigOptions() - { - var content = @"**ABP Framework** is completely open source and developed in a community-driven manner. - [Widget Type= ""Poll"" Code =""poll-name""] - Thanks _for_ *your * feedback."; - - contentParser = new ContentParser(_options); - var widgets = await contentParser.ParseAsync(content); - - widgets.ShouldNotBeNull(); - widgets.Count.ShouldBe(1);//Ignored Widget - } - - [Fact] - public async Task ParseAsync_ShouldWorkWithWrongConfigOptions() - { - _options.Value.AddWidget(testData.WidgetName, testData.PollName, string.Empty); - contentParser = new ContentParser(_options); - - var content = @"**ABP Framework** is completely open source and developed in a community-driven manner. - [Widget Type= ""Poll"" Code =""poll-name""] - Thanks _for_ *your * feedback."; - - var widgets = await contentParser.ParseAsync(content); - - widgets.ShouldNotBeNull(); - widgets.Count.ShouldBe(2); - } - - [Fact] - public async Task ParseAsync_ShouldWorkWithWrongWidgetType() - { - _options.Value.AddWidget(testData.PollName, testData.WidgetName, string.Empty); - contentParser = new ContentParser(_options); - - var content = @"**ABP Framework** is completely open source and developed in a community-driven manner. - [Widget Wrong Type= ""Poll"" Code =""poll-name""] - Thanks _for_ *your * feedback."; - - var widgets = await contentParser.ParseAsync(content); - - widgets.ShouldNotBeNull(); - widgets.Count.ShouldBe(2); - } - - [Fact] - public async Task ParseAsync_ShouldWorkWithWrongPollName() - { - _options.Value.AddWidget(testData.PollName, testData.WidgetName, string.Empty); - contentParser = new ContentParser(_options); - - var content = @"**ABP Framework** is completely open source and developed in a community-driven manner. - [Widget Type= ""Poll"" PollWrongName =""poll-name""] - Thanks _for_ *your * feedback."; - - var widgets = await contentParser.ParseAsync(content); - - widgets.ShouldNotBeNull(); - widgets.Count.ShouldBe(3); - } - - [Theory] - [MemberData(nameof(ExampleData))] - public async Task ParseAsync_ShouldWorkProperlyWithCorrectInputs(string content, int expectedLine) - { - _options.Value.AddWidget(testData.PollName, testData.WidgetName, string.Empty); - contentParser = new ContentParser(_options); - - var widgets = await contentParser.ParseAsync(content); - - widgets.ShouldNotBeNull(); - widgets.Count.ShouldBe(expectedLine); - } - - public static IEnumerable ExampleData => - new List - { - new object[] { @"**ABP Framework** is completely open source and developed in a community-driven manner. - [Widget Type=""Poll"" Code=""poll-name""] - Thanks _for_ *your * feedback.", 3}, - - new object[] { @"**ABP Framework** is completely open source and developed in a community-driven manner. - [Widget Type=""Poll"" Code=""poll-name""] - Thanks _for_ *your * feedback. - [Widget Type=""Poll"" Code=""poll-name1""]", 4 }, - - new object[] { @"**ABP Framework** is completely open source and developed in a community-driven manner. - Thanks _for_ *your * feedback. - [Widget Type=""Poll"" Code=""poll-name""]", 2 }, - - new object[] { @"[Widget Type=""Poll"" Code=""poll-name""] gg [Widget Type=""Poll"" Code=""poll-name1""]**ABP Framework** is completely open source and developed in a community-driven manner. - Thanks _for_ *your * feedback. - Thanks _for_ *your * feedback.", 4}, - - new object[] { @"Thanks _for_ *your * feedback. - Thanks _for_ *your * feedback.", 1} - }; -} diff --git a/modules/docs/test/Volo.Docs.Admin.Application.Tests/Volo/Docs/DocumentAdminAppService_Tests.cs b/modules/docs/test/Volo.Docs.Admin.Application.Tests/Volo/Docs/DocumentAdminAppService_Tests.cs index 858c3560f5..18736fbb06 100644 --- a/modules/docs/test/Volo.Docs.Admin.Application.Tests/Volo/Docs/DocumentAdminAppService_Tests.cs +++ b/modules/docs/test/Volo.Docs.Admin.Application.Tests/Volo/Docs/DocumentAdminAppService_Tests.cs @@ -59,9 +59,9 @@ namespace Volo.Docs var filterItems = await _documentAdminAppService.GetFilterItemsAsync(); filterItems.ShouldNotBeEmpty(); - filterItems.ShouldContain(p => p.ProjectId == _testData.PorjectId); - filterItems.ShouldContain(p => p.Version == "2.0.0" && p.ProjectId == _testData.PorjectId); - filterItems.ShouldContain(p => p.LanguageCode == "en" && p.ProjectId == _testData.PorjectId); + filterItems.ShouldContain(p => p.ProjectId == _testData.ProjectId); + filterItems.ShouldContain(p => p.Version == "2.0.0" && p.ProjectId == _testData.ProjectId); + filterItems.ShouldContain(p => p.LanguageCode == "en" && p.ProjectId == _testData.ProjectId); filterItems.ShouldContain(p => p.Format == "md"); }