Browse Source

Merge branch 'dev' into Replace-all-date-range-inputs-to-daterange-picker-MVC]-#13793

pull/14017/head
Salih 4 years ago
parent
commit
d88e4383d5
  1. 4
      .github/workflows/labeler.yml
  2. 8
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs
  3. 12
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/NuGet/CommercialPackages.cs
  4. 2
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/CmsKitWebUnifiedModule.cs
  5. 9
      modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/IContentAdminAppService.cs
  6. 4
      modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo.CmsKit.Admin.Application.csproj
  7. 32
      modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Contents/ContentAdminAppService.cs
  8. 22
      modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/ContentAdminClientProxy.Generated.cs
  9. 7
      modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/ContentAdminClientProxy.cs
  10. 29
      modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/cms-kit-admin-generate-proxy.json
  11. 25
      modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Contents/ContentAdminController.cs
  12. 22
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/AddWidgetModal.cshtml.cs
  13. 15
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/wwwroot/client-proxies/cms-kit-admin-proxy.js
  14. 5
      modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/BlogPostCommonDto.cs
  15. 10
      modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/IContentAppService.cs
  16. 4
      modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/PageDto.cs
  17. 22
      modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentAppService.cs
  18. 9
      modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/ContentPreview/ContentPreviewViewComponent.cs
  19. 2
      modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/CmsKitContentWidgetOptions.cs
  20. 3
      modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentParser.cs
  21. 2
      modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentWidgetConfig.cs
  22. 11
      modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs
  23. 8
      modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs
  24. 8
      modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs
  25. 96
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml
  26. 35
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml.cs
  27. 28
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPostViewModel.cs
  28. 20
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml
  29. 18
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml.cs
  30. 7
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/PageViewModel.cs
  31. 27
      modules/cms-kit/test/Volo.CmsKit.Application.Tests/Contents/ContentAdminAppService_Tests.cs
  32. 138
      modules/cms-kit/test/Volo.CmsKit.Application.Tests/Contents/ContentParser_Test.cs
  33. 2
      modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/DocumentDto.cs
  34. 11
      modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/DocumentInfoDto.cs
  35. 2
      modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/IDocumentAdminAppService.cs
  36. 2
      modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/IProjectAdminAppService.cs
  37. 9
      modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/ProjectWithoutDetailsDto.cs
  38. 5
      modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationAutoMapperProfile.cs
  39. 8
      modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Documents/DocumentAdminAppService.cs
  40. 6
      modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs
  41. 6
      modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/DocumentsAdminClientProxy.Generated.cs
  42. 6
      modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/ProjectsAdminClientProxy.Generated.cs
  43. 34
      modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/docs-admin-generate-proxy.json
  44. 7
      modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/DocumentsAdminController.cs
  45. 8
      modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/ProjectsAdminController.cs
  46. 95
      modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml
  47. 16
      modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml.cs
  48. 107
      modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js
  49. 14
      modules/docs/src/Volo.Docs.Admin.Web/wwwroot/client-proxies/docs-admin-proxy.js
  50. 11
      modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/DocumentInfo.cs
  51. 2
      modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/DocumentWithoutContent.cs
  52. 1
      modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/IDocumentRepository.cs
  53. 1
      modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/IProjectRepository.cs
  54. 9
      modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/ProjectWithoutDetails.cs
  55. 62
      modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/Documents/EFCoreDocumentRepository.cs
  56. 11
      modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/Projects/EfCoreProjectRepository.cs
  57. 87
      modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/docs-generate-proxy.json
  58. 68
      modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/Documents/MongoDocumentRepository.cs
  59. 11
      modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/Projects/MongoProjectRepository.cs
  60. 32
      modules/docs/test/Volo.Docs.Admin.Application.Tests/Volo/Docs/DocumentAdminAppService_Tests.cs
  61. 10
      modules/docs/test/Volo.Docs.Admin.Application.Tests/Volo/Docs/ProjectAdminAppService_Tests.cs
  62. 2
      modules/docs/test/Volo.Docs.Application.Tests/Volo/Docs/ApplicationService_Tests.cs
  63. 6
      modules/docs/test/Volo.Docs.Domain.Tests/Volo/Docs/GithubDocumentSource_Tests.cs
  64. 2
      modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocsTestData.cs
  65. 2
      modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocsTestDataBuilder.cs
  66. 4
      modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocumentRepository_Tests.cs
  67. 7
      modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor.cs
  68. 7
      modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor.cs
  69. 2
      modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor.cs
  70. 7
      modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor.cs
  71. 7
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Data/OpenIddictDataSeedContributor.cs
  72. 7
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Data/OpenIddictDataSeedContributor.cs
  73. 7
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/OpenIddict/OpenIddictDataSeedContributor.cs
  74. 7
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/OpenIddict/OpenIddictDataSeedContributor.cs

4
.github/workflows/labeler.yml

@ -2,8 +2,12 @@ name: Pull request labeler
on:
schedule:
- cron: '0 12 */1 * *'
permissions:
contents: read
jobs:
labeler:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: paulfantom/periodic-labeler@master

8
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs

@ -74,9 +74,9 @@ public class AuthService : IAuthService, ITransientDependency
{
var configuration = new IdentityClientConfiguration(
CliUrls.AccountAbpIo,
"role email abpio abpio_www abpio_commercial offline_access",
"abpio offline_access",
"abp-cli",
"1q2w3e*",
null,
OidcConstants.GrantTypes.Password,
userName,
password
@ -96,9 +96,9 @@ public class AuthService : IAuthService, ITransientDependency
{
var configuration = new IdentityClientConfiguration(
CliUrls.AccountAbpIo,
"role email abpio abpio_www abpio_commercial openid offline_access",
"abpio offline_access",
"abp-cli",
"1q2w3e*",
null,
OidcConstants.GrantTypes.DeviceCode
);

12
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/NuGet/CommercialPackages.cs

@ -14,6 +14,16 @@ internal static class CommercialPackages
public static bool IsCommercial(string packageId)
{
return Packages.Contains(packageId.ToLowerInvariant());
return Packages.Contains(packageId.ToLowerInvariant()) || IsLeptonXPackage(packageId);
}
private static bool IsLeptonXPackage(string packageId)
{
return !IsLeptonXLitePackage(packageId) && packageId.Contains("LeptonX");
}
private static bool IsLeptonXLitePackage(string packageId)
{
return packageId.Contains("LeptonXLite");
}
}

2
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;

9
modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/IContentAdminAppService.cs

@ -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<ListResultDto<ContentWidgetDto>> GetWidgetsAsync();
}

4
modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo.CmsKit.Admin.Application.csproj

@ -13,4 +13,8 @@
<ProjectReference Include="..\Volo.CmsKit.Common.Application\Volo.CmsKit.Common.Application.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Volo\CmsKit\Admin\Contents\" />
</ItemGroup>
</Project>

32
modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Contents/ContentAdminAppService.cs

@ -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<CmsKitContentWidgetOptions> options)
{
_options = options.Value;
}
public virtual Task<ListResultDto<ContentWidgetDto>> GetWidgetsAsync()
{
return Task.FromResult(new ListResultDto<ContentWidgetDto>()
{
Items = _options.WidgetConfigs
.Select(n =>
new ContentWidgetDto
{
Key = n.Key,
Details = new WidgetDetailDto() { EditorComponentName = n.Value.EditorComponentName, Name = n.Value.Name },
}).ToList()
});
}
}

22
modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/ContentAdminClientProxy.Generated.cs

@ -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>, IContentAdminAppService
{
public virtual async Task<ListResultDto<ContentWidgetDto>> GetWidgetsAsync()
{
return await RequestAsync<ListResultDto<ContentWidgetDto>>(nameof(GetWidgetsAsync));
}
}

7
modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/ContentAdminClientProxy.cs

@ -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
{
}

29
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<Volo.CmsKit.Admin.Contents.ContentWidgetDto>",
"typeSimple": "Volo.Abp.Application.Dtos.ListResultDto<Volo.CmsKit.Admin.Contents.ContentWidgetDto>"
},
"allowAnonymous": null,
"implementFrom": "Volo.CmsKit.Admin.Contents.IContentAdminAppService"
}
}
},
"Volo.CmsKit.Admin.Comments.CommentAdminController": {
"controllerName": "CommentAdmin",
"controllerGroupName": "CommentAdmin",

25
modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Contents/ContentAdminController.cs

@ -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<ListResultDto<ContentWidgetDto>> GetWidgetsAsync()
{
return ContentAdminAppService.GetWidgetsAsync();
}
}

22
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<SelectListItem> Widgets { get; set; } = new();
public AddWidgetModal(IContentAdminAppService contentAdminAppService)
private readonly CmsKitContentWidgetOptions _options;
public AddWidgetModal(IOptions<CmsKitContentWidgetOptions> 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<SelectListItem>() { new(string.Empty, string.Empty) };
Widgets.AddRange(widgets
.Items
.Select(w => new SelectListItem(w.Key, w.Details.Name))
.ToList());
}

15
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(){

5
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<Guid>, IContent
public class BlogPostCommonDto : AuditedEntityDto<Guid>
{
public Guid BlogId { get; set; }
@ -16,8 +15,6 @@ public class BlogPostCommonDto : AuditedEntityDto<Guid>, IContent
public string ShortDescription { get; set; }
public List<ContentFragment> ContentFragments { get; set; }
public string Content { get; set; }
public Guid? CoverImageMediaId { get; set; }

10
modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/IContentAppService.cs

@ -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<List<ContentFragment>> ParseAsync(string content);
}

4
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<Guid>, IContent
public class PageDto : EntityDto<Guid>
{
public string Title { get; set; }
@ -13,8 +13,6 @@ public class PageDto : EntityDto<Guid>, IContent
public string Content { get; set; }
public List<ContentFragment> ContentFragments { get; set; }
public string Script { get; set; }
public string Style { get; set; }

22
modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentAppService.cs

@ -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<List<ContentFragment>> ParseAsync(string content)
{
return await ContentParser.ParseAsync(content);
}
}

9
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<IViewComponentResult> 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
{

2
modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/CmsKitContentWidgetOptions.cs → 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
{

3
modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentParser.cs → 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
{

2
modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentWidgetConfig.cs → 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
{

11
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<BlogPostCommonDto> GetAsync(
@ -39,10 +37,7 @@ public class BlogPostPublicAppService : CmsKitPublicAppServiceBase, IBlogPostPub
var blogPost = await BlogPostRepository.GetBySlugAsync(blog.Id, blogPostSlug);
var blogPostDto = ObjectMapper.Map<BlogPost, BlogPostCommonDto>(blogPost);
blogPostDto.ContentFragments = await ContentParser.ParseAsync(blogPost.Content);
return blogPostDto;
return ObjectMapper.Map<BlogPost, BlogPostCommonDto>(blogPost);
}
public virtual async Task<PagedResultDto<BlogPostCommonDto>> GetListAsync([NotNull] string blogSlug, BlogPostGetListInput input)

8
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<PageDto> FindBySlugAsync(string slug)
@ -30,8 +28,6 @@ public class PagePublicAppService : CmsKitPublicAppServiceBase, IPagePublicAppSe
return null;
}
var pageDto = ObjectMapper.Map<Page, PageDto>(page);
pageDto.ContentFragments = await ContentParser.ParseAsync(page.Content);
return pageDto;
return ObjectMapper.Map<Page, PageDto>(page);
}
}

8
modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs

@ -30,11 +30,9 @@ public class PublicApplicationAutoMapperProfile : Profile
CreateMap<Rating, RatingDto>();
CreateMap<Page, PageDto>()
.Ignore(x => x.ContentFragments);
CreateMap<BlogPost, BlogPostCommonDto>()
.Ignore(x => x.ContentFragments);
CreateMap<Page, PageDto>();
CreateMap<BlogPost, BlogPostCommonDto>();
CreateMap<MenuItem, MenuItemDto>();

96
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<BlogPostScrollIndexFeature>() && Model.BlogPostScrollIndexFeature?.IsEnabled == true;
}
@ -32,14 +32,13 @@
<abp-style src="/Pages/Public/CmsKit/Blogs/bootstrap-toc.css" />
</abp-abp-style-bundle>
}
<abp-abp-style-bundle>
<abp-style src="/Pages/Public/CmsKit/Blogs/blogPost.css" />
<abp-style type="typeof(HighlightJsStyleContributor)" />
</abp-abp-style-bundle>
}
@section scripts{
@section scripts{
@if (isScrollIndexEnabled)
{
<abp-script-bundle>
@ -55,41 +54,51 @@
}
<div class="row">
<div @Html.Raw(isScrollIndexEnabled ? "class=\"col-md-10 col-sm-12\"" : "class=\"col-md-12\"")>
<abp-card class="mb-4">
<img src="/api/cms-kit/media/@Model.BlogPost.CoverImageMediaId" class="card-img-top" onerror="this.src='@dummyImageSource'" />
<abp-card-body>
<abp-row>
<div class="col-lg-8 col-md-10 mx-auto pb-4">
<h1 class="mt-lg-4 mt-md-3">@Model.BlogPost.Title</h1>
<p class="mb-lg-5 mb-md-3">
<a href="/blogs/@Model.BlogSlug?authorId=@Model.BlogPost.Author.Id">
<span class="font-weight-bold">@@@Model.BlogPost.Author?.UserName</span>
</a>
<small style="opacity:.65;">@Model.BlogPost.CreationTime</small>
</p>
@await Component.InvokeAsync("ContentFragment", new { contentDto = Model.BlogPost })
<p class="mb-3">
@if (Model.BlogPost.LastModificationTime != null)
<div class="row">
<div @Html.Raw(isScrollIndexEnabled ? "class=\"col-md-10 col-sm-12\"" : "class=\"col-md-12\"")>
<abp-card class="mb-4">
<img src="/api/cms-kit/media/@Model.ViewModel.CoverImageMediaId" class="card-img-top" onerror="this.src='@dummyImageSource'" />
<abp-card-body>
<abp-row>
<div class="col-lg-8 col-md-10 mx-auto pb-4">
<h1 class="mt-lg-4 mt-md-3">@Model.ViewModel.Title</h1>
<p class="mb-lg-5 mb-md-3">
<a href="/blogs/@Model.BlogSlug?authorId=@Model.ViewModel.Author.Id">
<span class="font-weight-bold">@@@Model.ViewModel.Author?.UserName</span>
</a>
<small style="opacity:.65;">@Model.ViewModel.CreationTime</small>
</p>
@foreach (var contentFragment in Model.ViewModel.ContentFragments)
{
<small style="opacity:.65;">@L["LastModification"].Value : @Model.BlogPost.LastModificationTime</small>
if (contentFragment.Type == ContentConsts.Markdown)
{
@Html.Raw(await MarkdownRenderer.RenderAsync(contentFragment.GetProperty<string>("Content"), allowHtmlTags: true, preventXSS: true))
}
else if (contentFragment.Type == ContentConsts.Widget)
{
@await Component.InvokeAsync(contentFragment.GetProperty<string>("Type"), contentFragment.ExtraProperties.ConvertToDynamicObject())
}
}
</p>
<hr />
<p class="mb-3">
@if (Model.ViewModel.LastModificationTime != null)
{
<small style="opacity:.65;">@L["LastModification"].Value : @Model.ViewModel.LastModificationTime</small>
}
</p>
<hr />
@if (GlobalFeatureManager.Instance.IsEnabled<TagsFeature>())
{
if (Model.TagsFeature?.IsEnabled == true)
@if (GlobalFeatureManager.Instance.IsEnabled<TagsFeature>())
{
@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}}"
})
}
}
}
</div>
</abp-row>
@ -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()
})
}
}
</abp-column>
@ -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()
})
}
}
</abp-column>
@ -124,7 +133,6 @@
</abp-card-body>
</abp-card>
</div>
@if (isScrollIndexEnabled)
{
<div class="col-md-2 d-sm-none d-md-block">
@ -132,7 +140,7 @@
<h5>@L["InThisDocument"]</h5>
<nav id="blog-post-sticky-index" class="navbar index-scroll pt-0">
</nav>
<div class="row">
<div class="col p-0 py-3">
<a href="#" class="scroll-top-btn">
@ -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()
})
}
}

35
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<IActionResult> OnGetAsync()
{
BlogPost = await BlogPostPublicAppService.GetAsync(BlogSlug, BlogPostSlug);
var blogPostPublicDto = await BlogPostPublicAppService.GetAsync(BlogSlug, BlogPostSlug);
ViewModel = ObjectMapper.Map<BlogPostCommonDto, BlogPostViewModel>(blogPostPublicDto);
if (ViewModel == null)
{
return NotFound();
}
ViewModel.ContentFragments = await ContentParser.ParseAsync(blogPostPublicDto.Content);
if (GlobalFeatureManager.Instance.IsEnabled<CommentsFeature>())
{
CommentsFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, GlobalFeatures.CommentsFeature.Name);
CommentsFeature = await BlogFeatureAppService.GetOrDefaultAsync(ViewModel.BlogId, GlobalFeatures.CommentsFeature.Name);
}
if (GlobalFeatureManager.Instance.IsEnabled<ReactionsFeature>())
{
ReactionsFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, GlobalFeatures.ReactionsFeature.Name);
ReactionsFeature = await BlogFeatureAppService.GetOrDefaultAsync(ViewModel.BlogId, GlobalFeatures.ReactionsFeature.Name);
}
if (GlobalFeatureManager.Instance.IsEnabled<RatingsFeature>())
{
RatingsFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, GlobalFeatures.RatingsFeature.Name);
RatingsFeature = await BlogFeatureAppService.GetOrDefaultAsync(ViewModel.BlogId, GlobalFeatures.RatingsFeature.Name);
}
if (GlobalFeatureManager.Instance.IsEnabled<TagsFeature>())
{
TagsFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, GlobalFeatures.TagsFeature.Name);
TagsFeature = await BlogFeatureAppService.GetOrDefaultAsync(ViewModel.BlogId, GlobalFeatures.TagsFeature.Name);
}
if (GlobalFeatureManager.Instance.IsEnabled<BlogPostScrollIndexFeature>())
{
BlogPostScrollIndexFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, GlobalFeatures.BlogPostScrollIndexFeature.Name);
BlogPostScrollIndexFeature = await BlogFeatureAppService.GetOrDefaultAsync(ViewModel.BlogId, GlobalFeatures.BlogPostScrollIndexFeature.Name);
}
return Page();
}
}

28
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<Guid>
{
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<ContentFragment> ContentFragments { get; set; }
public Guid? CoverImageMediaId { get; set; }
public CmsUserDto Author { get; set; }
}

20
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{
<abp-style src="/Pages/Public/CmsKit/Pages/index.css" />
<style>
@Html.Raw(Model.PageDto.Style)
@Html.Raw(Model.ViewModel.Style)
</style>
}
@section scripts{
<script>
@Html.Raw(Model.PageDto.Script)
@Html.Raw(Model.ViewModel.Script)
</script>
}
<abp-card>
<abp-card-body>
@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<string>("Content"), allowHtmlTags: true, preventXSS: true))
}
else if (contentFragment.Type == ContentConsts.Widget)
{
@await Component.InvokeAsync(contentFragment.GetProperty<string>("Type"), contentFragment.ExtraProperties.ConvertToDynamicObject())
}
}
</abp-card-body>
</abp-card>

18
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<IActionResult> OnGetAsync()
public virtual async Task<IActionResult> OnGetAsync()
{
PageDto = await PagePublicAppService.FindBySlugAsync(Slug);
if (PageDto == null)
var pageDto = await PagePublicAppService.FindBySlugAsync(Slug);
ViewModel = ObjectMapper.Map<PageDto, PageViewModel>(pageDto);
if (ViewModel == null)
{
return NotFound();
}
ViewModel.ContentFragments = await ContentParser.ParseAsync(pageDto.Content);
return Page();
}

7
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<ContentFragment> ContentFragments { get; set; }
public string Script { get; set; }
public string Style { get; set; }
}

27
modules/cms-kit/test/Volo.CmsKit.Application.Tests/Contents/ContentAdminAppService_Tests.cs

@ -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<IContentAdminAppService>();
}
[Fact]
public async Task ShouldGet_PagedListAsync()
{
var widgets = await _contentAdminAppService.GetWidgetsAsync();
widgets.Items.Count.ShouldBe(0);
widgets.Items.Any().ShouldBeFalse();
}
}

138
modules/cms-kit/test/Volo.CmsKit.Application.Tests/Contents/ContentParser_Test.cs

@ -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<CmsKitContentWidgetOptions> _options;
private ContentParser contentParser;
public ContentParser_Test()
{
testData = GetRequiredService<CmsKitTestData>();
_options = GetRequiredService<IOptions<CmsKitContentWidgetOptions>>();
}
[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<object[]> ExampleData =>
new List<object[]>
{
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}
};
}

2
modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/DocumentDto.cs

@ -8,6 +8,8 @@ namespace Volo.Docs.Admin.Documents
public class DocumentDto : EntityDto<Guid>
{
public virtual Guid ProjectId { get; set; }
public virtual string ProjectName { get; set; }
public virtual string Name { get; set; }

11
modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/DocumentInfoDto.cs

@ -0,0 +1,11 @@
using System;
namespace Volo.Docs.Admin.Documents;
public class DocumentInfoDto
{
public string Version { get; set; }
public string Format { get; set; }
public string LanguageCode { get; set; }
public Guid ProjectId { get; set; }
}

2
modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/IDocumentAdminAppService.cs

@ -19,5 +19,7 @@ namespace Volo.Docs.Admin.Documents
Task RemoveFromCacheAsync(Guid documentId);
Task ReindexAsync(Guid documentId);
Task<List<DocumentInfoDto>> GetFilterItemsAsync();
}
}

2
modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/IProjectAdminAppService.cs

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
@ -20,5 +21,6 @@ namespace Volo.Docs.Admin.Projects
Task ReindexAsync(ReindexInput input);
Task ReindexAllAsync();
Task<List<ProjectWithoutDetailsDto>> GetListWithoutDetailsAsync();
}
}

9
modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/ProjectWithoutDetailsDto.cs

@ -0,0 +1,9 @@
using System;
namespace Volo.Docs.Admin.Projects;
public class ProjectWithoutDetailsDto
{
public Guid Id { get; set; }
public string Name { get; set; }
}

5
modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationAutoMapperProfile.cs

@ -1,4 +1,5 @@
using AutoMapper;
using Volo.Abp.AutoMapper;
using Volo.Docs.Admin.Documents;
using Volo.Docs.Admin.Projects;
using Volo.Docs.Documents;
@ -11,8 +12,10 @@ namespace Volo.Docs.Admin
public DocsAdminApplicationAutoMapperProfile()
{
CreateMap<Project, ProjectDto>();
CreateMap<Document, DocumentDto>();
CreateMap<Document, DocumentDto>().Ignore(x => x.ProjectName);
CreateMap<DocumentWithoutContent, DocumentDto>();
CreateMap<ProjectWithoutDetails, ProjectWithoutDetailsDto>();
CreateMap<DocumentInfo, DocumentInfoDto>();
}
}
}

8
modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Documents/DocumentAdminAppService.cs

@ -5,7 +5,6 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.Logging;
using Volo.Abp;
using Volo.Abp.Uow;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Caching;
@ -217,6 +216,13 @@ namespace Volo.Docs.Admin.Documents
await _elasticSearchService.AddOrUpdateAsync(document);
}
public async Task<List<DocumentInfoDto>> GetFilterItemsAsync()
{
var documents = await _documentRepository.GetUniqueListDocumentInfoAsync();
return ObjectMapper.Map<List<DocumentInfo>, List<DocumentInfoDto>>(documents);
}
private async Task UpdateDocumentUpdateInfoCache(Document document)
{
var cacheKey = $"DocumentUpdateInfo{document.ProjectId}#{document.Name}#{document.LanguageCode}#{document.Version}";

6
modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs

@ -156,5 +156,11 @@ namespace Volo.Docs.Admin.Projects
await ReindexProjectAsync(project.Id);
}
}
public async Task<List<ProjectWithoutDetailsDto>> GetListWithoutDetailsAsync()
{
var projects = await _projectRepository.GetListWithoutDetailsAsync();
return ObjectMapper.Map<List<ProjectWithoutDetails>, List<ProjectWithoutDetailsDto>>(projects);
}
}
}

6
modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/DocumentsAdminClientProxy.Generated.cs

@ -7,6 +7,7 @@ using Volo.Abp.Http.Modeling;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http.Client.ClientProxying;
using Volo.Docs.Admin.Documents;
using System.Collections.Generic;
// ReSharper disable once CheckNamespace
namespace Volo.Docs.Admin.ClientProxies;
@ -62,4 +63,9 @@ public partial class DocumentsAdminClientProxy : ClientProxyBase<IDocumentAdminA
{ typeof(Guid), documentId }
});
}
public virtual async Task<List<DocumentInfoDto>> GetFilterItemsAsync()
{
return await RequestAsync<List<DocumentInfoDto>>(nameof(GetFilterItemsAsync));
}
}

6
modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/ProjectsAdminClientProxy.Generated.cs

@ -7,6 +7,7 @@ using Volo.Abp.Http.Modeling;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http.Client.ClientProxying;
using Volo.Docs.Admin.Projects;
using System.Collections.Generic;
// ReSharper disable once CheckNamespace
namespace Volo.Docs.Admin.ClientProxies;
@ -61,6 +62,11 @@ public partial class ProjectsAdminClientProxy : ClientProxyBase<IProjectAdminApp
await RequestAsync(nameof(ReindexAllAsync));
}
public virtual async Task<List<ProjectWithoutDetailsDto>> GetListWithoutDetailsAsync()
{
return await RequestAsync<List<ProjectWithoutDetailsDto>>(nameof(GetListWithoutDetailsAsync));
}
public virtual async Task ReindexAsync(ReindexInput input)
{
await RequestAsync(nameof(ReindexAsync), new ClientProxyRequestTypeValue

34
modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/docs-admin-generate-proxy.json

@ -7,6 +7,8 @@
"Volo.Docs.Admin.DocumentsAdminController": {
"controllerName": "DocumentsAdmin",
"controllerGroupName": "DocumentsAdmin",
"isRemoteService": true,
"apiVersion": null,
"type": "Volo.Docs.Admin.DocumentsAdminController",
"interfaces": [
{
@ -427,12 +429,29 @@
},
"allowAnonymous": null,
"implementFrom": "Volo.Docs.Admin.Documents.IDocumentAdminAppService"
},
"GetFilterItemsAsync": {
"uniqueName": "GetFilterItemsAsync",
"name": "GetFilterItemsAsync",
"httpMethod": "GET",
"url": "api/docs/admin/documents/GetFilterItems",
"supportedVersions": [],
"parametersOnMethod": [],
"parameters": [],
"returnValue": {
"type": "System.Collections.Generic.List<Volo.Docs.Admin.Documents.DocumentInfoDto>",
"typeSimple": "[Volo.Docs.Admin.Documents.DocumentInfoDto]"
},
"allowAnonymous": null,
"implementFrom": "Volo.Docs.Admin.Documents.IDocumentAdminAppService"
}
}
},
"Volo.Docs.Admin.ProjectsAdminController": {
"controllerName": "ProjectsAdmin",
"controllerGroupName": "ProjectsAdmin",
"isRemoteService": true,
"apiVersion": null,
"type": "Volo.Docs.Admin.ProjectsAdminController",
"interfaces": [
{
@ -684,6 +703,21 @@
"allowAnonymous": null,
"implementFrom": "Volo.Docs.Admin.Projects.IProjectAdminAppService"
},
"GetListWithoutDetailsAsync": {
"uniqueName": "GetListWithoutDetailsAsync",
"name": "GetListWithoutDetailsAsync",
"httpMethod": "GET",
"url": "api/docs/admin/projects/GetListProjectWithoutDetailsAsync",
"supportedVersions": [],
"parametersOnMethod": [],
"parameters": [],
"returnValue": {
"type": "System.Collections.Generic.List<Volo.Docs.Admin.Projects.ProjectWithoutDetailsDto>",
"typeSimple": "[Volo.Docs.Admin.Projects.ProjectWithoutDetailsDto]"
},
"allowAnonymous": null,
"implementFrom": "Volo.Docs.Admin.Projects.IProjectAdminAppService"
},
"ReindexAsyncByInput": {
"uniqueName": "ReindexAsyncByInput",
"name": "ReindexAsync",

7
modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/DocumentsAdminController.cs

@ -63,5 +63,12 @@ namespace Volo.Docs.Admin
{
await _documentAdminAppService.ReindexAsync(documentId);
}
[HttpGet]
[Route("GetFilterItems")]
public async Task<List<DocumentInfoDto>> GetFilterItemsAsync()
{
return await _documentAdminAppService.GetFilterItemsAsync();
}
}
}

8
modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/ProjectsAdminController.cs

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
@ -61,6 +62,13 @@ namespace Volo.Docs.Admin
return _projectAppService.ReindexAllAsync();
}
[HttpGet]
[Route("GetListProjectWithoutDetailsAsync")]
public Task<List<ProjectWithoutDetailsDto>> GetListWithoutDetailsAsync()
{
return _projectAppService.GetListWithoutDetailsAsync();
}
[HttpPost]
[Route("Reindex")]
public Task ReindexAsync(ReindexInput input)

95
modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml

@ -34,50 +34,70 @@
<abp-row>
<abp-column size="_4">
<abp-column size="Auto">
<div class="input-group mb-2">
<div class="input-group-text">@L["Project"].Value</div>
<input type="text"
id="ProjectId"
name="ProjectId"
class="form-control">
<select
id="ProjectId"
name="ProjectId"
class="form-select">
<option></option>
@foreach (var project in Model.Projects)
{
<option value="@project.Id">@project.Name</option>
}
</select>
</div>
</abp-column>
<abp-column size="_4">
<abp-column size="Auto">
<div class="input-group mb-2">
<div class="input-group-text">@L["Name"].Value</div>
<div class="input-group-text">@L["Version"].Value</div>
<input type="text"
id="Name"
name="Name"
class="form-control">
<select
id="Version"
name="Version"
class="form-select">
<option></option>
@* @foreach (var version in Model.FilterItems.Versions) *@
@* { *@
@* <option value="@version.Version" style="display: none;" data-project-id="@version.ProjectId" data-language-code="@version.LanguageCode">@version.Version</option> *@
@* } *@
</select>
</div>
</abp-column>
<abp-column size="_2">
<abp-column size="Auto">
<div class="input-group mb-2">
<div class="input-group-text">@L["Version"].Value</div>
<div class="input-group-text">@L["Name"].Value</div>
<input type="text"
id="Version"
name="Version"
id="Name"
name="Name"
class="form-control">
</div>
</abp-column>
<abp-column size="_3">
<abp-column size="Auto">
<div class="input-group mb-2">
<div class="input-group-text">@L["LanguageCode"].Value</div>
<input type="text"
id="LanguageCode"
name="LanguageCode"
class="form-control">
<select
id="LanguageCode"
name="LanguageCode"
class="form-select">
<option></option>
@* @foreach (var language in Model.FilterItems.Versions) *@
@* { *@
@* <option value="@language.LanguageCode" style="display: none;" data-project-id="@language.ProjectId" d>@language.LanguageCode</option> *@
@* } *@
</select>
</div>
</abp-column>
<abp-column size="Auto">
<abp-button button-type="Primary" icon="search" id="SearchButton" style="line-height: 25px;" text="@L["Search"].Value"></abp-button>
</abp-column>
<abp-row class="mt-3 mb-3">
<abp-column size-md="_12">
<a href="javascript:;" id="AdvancedFilterSectionToggler" class="text-decoration-none">@L["AdvancedFilters"]</a>
@ -85,7 +105,7 @@
</abp-row>
<abp-row id="AdvancedFilterSection" style="display: none;">
<abp-column size="_4">
<abp-column size="Auto">
<div class="input-group mb-2">
<div class="input-group-text">@L["CreationTime"].Value</div>
@ -103,7 +123,7 @@
</div>
</abp-column>
<abp-column size="_4">
<abp-column size="Auto">
<div class="input-group mb-2">
<div class="input-group-text">@L["LastUpdateTime"].Value</div>
<input type="text"
@ -111,8 +131,9 @@
name="LastUpdatedTimeMin"
class="form-control daterangesinglepicker"
placeholder="@L["StartDate"].Value">
<span>-</span>
<input type="text"
id="LastUpdatedTimeMax"
name="LastUpdatedTimeMax"
placeholder="@L["EndDate"].Value"
@ -120,7 +141,7 @@
</div>
</abp-column>
<abp-column size="_4">
<abp-column size="Auto">
<div class="input-group mb-2">
<div class="input-group-text">@L["LastCachedTime"].Value</div>
@ -138,21 +159,22 @@
</div>
</abp-column>
<abp-column size="_2">
<abp-column size="Auto">
<div class="input-group mb-2">
<div class="input-group-text">@L["Format"].Value</div>
<input type="text"
id="Format"
name="Format"
class="form-control">
<select
id="Format"
name="Format"
class="form-select">
</select>
</div>
</abp-column>
<abp-column size="_2">
<abp-column size="Auto">
</abp-column>
<abp-column size="_5">
<abp-column size="Auto">
<div class="input-group mb-2">
<div class="input-group-text">@L["LastSignificantUpdateTime"].Value</div>
@ -171,10 +193,6 @@
</abp-column>
</abp-row>
<div class="col-auto">
<abp-button button-type="Primary" icon="search" id="SearchButton" style="line-height: 25px;" text="@L["Search"].Value"></abp-button>
</div>
</abp-row>
</form>
</abp-card-header>
@ -183,6 +201,7 @@
<thead>
<tr>
<th>@L["Actions"]</th>
<th>@L["ProjectName"]</th>
<th>@L["Name"]</th>
<th>@L["Version"]</th>
<th>@L["LanguageCode"]</th>

16
modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml.cs

@ -1,14 +1,24 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Docs.Admin.Projects;
namespace Volo.Docs.Admin.Pages.Docs.Admin.Documents;
[Authorize(DocsAdminPermissions.Projects.Default)]
public class IndexModel : DocsAdminPageModel
{
public virtual Task<IActionResult> OnGet()
private readonly IProjectAdminAppService _projectAdminAppService;
public List<ProjectWithoutDetailsDto> Projects { get; set; }
public IndexModel(IProjectAdminAppService projectAdminAppService)
{
_projectAdminAppService = projectAdminAppService;
}
public virtual async Task<IActionResult> OnGet()
{
return Task.FromResult<IActionResult>(Page());
Projects = await _projectAdminAppService.GetListWithoutDetailsAsync();
return Page();
}
}
}

107
modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js

@ -10,6 +10,7 @@ $(function () {
return date.toISOString();
};
$('.daterangesinglepicker').daterangepicker({
"singleDatePicker": true,
"showDropdowns": true,
@ -30,6 +31,108 @@ $(function () {
$(this).val('');
});
var comboboxItems = [];
service.getFilterItems()
.then(function (result) {
comboboxItems = result;
fillOptions();
}).catch(function (error) {
abp.message.error(error);
});
var $projectId = $('#ProjectId');
$projectId.on('change', function () {
fillOptions();
});
var comboboxs = {
version: $('#Version'),
languageCode: $('#LanguageCode'),
format: $('#Format')
};
for (var key in comboboxs) {
comboboxs[key].on('change', function () {
fillOptions();
});
}
var selectedItem = getSelectedItem();
function emptyComboboxs() {
for (var key in comboboxs) {
comboboxs[key].empty();
}
}
function getSelectedItem() {
var item = {};
for (var key in comboboxs) {
item[key] = comboboxs[key].val();
}
return item;
}
function SetComboboxsValues(item) {
for (var key in comboboxs) {
comboboxs[key].val(item[key]);
}
}
function addComboboxsEmptyItem() {
for (var key in comboboxs) {
comboboxs[key].append($('<option/>').val('').text(''));
}
}
function fillOptions() {
selectedItem = getSelectedItem();
var selectedProjectId = $projectId.val();
emptyComboboxs();
addComboboxsEmptyItem();
var selectedProjectItems = comboboxItems.filter((item) => !selectedProjectId || item.projectId === selectedProjectId);
for (var key in selectedItem) {
var item = selectedProjectItems.find((item) => item[key] === selectedItem[key]);
if (item) {
selectedItem[key] = item[key];
}else {
selectedItem[key] = '';
}
}
selectedProjectItems.forEach(function (item) {
for (var key in comboboxs) {
appendComboboxItem(comboboxs[key], item, key);
}
});
SetComboboxsValues(selectedItem);
}
function appendComboboxItem($combobox, item , key) {
$.each(item, function (index, value) {
if(index !== key) {
if(selectedItem[index] && selectedItem[index] !== value) {
return ;
}}
});
if($combobox.find('option[value="' + item[key] + '"]').length === 0){
$combobox.append($('<option/>').val(item[key]).text(item[key]));
}
}
var getFilter = function () {
return {
projectId: $('#ProjectId').val(),
@ -103,6 +206,10 @@ $(function () {
],
},
},
{
target: 0,
data: 'projectName',
},
{
target: 1,
data: 'name',

14
modules/docs/src/Volo.Docs.Admin.Web/wwwroot/client-proxies/docs-admin-proxy.js

@ -61,6 +61,13 @@
}, ajaxParams));
};
volo.docs.admin.documentsAdmin.getFilterItems = function(ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/docs/admin/documents/GetFilterItems',
type: 'GET'
}, ajaxParams));
};
})();
// controller volo.docs.admin.projectsAdmin
@ -115,6 +122,13 @@
}, ajaxParams));
};
volo.docs.admin.projectsAdmin.getListWithoutDetails = function(ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/docs/admin/projects/GetListProjectWithoutDetailsAsync',
type: 'GET'
}, ajaxParams));
};
volo.docs.admin.projectsAdmin.reindex = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/docs/admin/projects/Reindex',

11
modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/DocumentInfo.cs

@ -0,0 +1,11 @@
using System;
namespace Volo.Docs.Documents;
public class DocumentInfo
{
public string Version { get; set; }
public string Format { get; set; }
public string LanguageCode { get; set; }
public Guid ProjectId { get; set; }
}

2
modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/DocumentWithoutContent.cs

@ -7,6 +7,8 @@ namespace Volo.Docs.Documents
public Guid Id { get; set; }
public virtual Guid ProjectId { get; set; }
public virtual string ProjectName { get; set; }
public virtual string Name { get; set; }

1
modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/IDocumentRepository.cs

@ -9,6 +9,7 @@ namespace Volo.Docs.Documents
public interface IDocumentRepository : IBasicRepository<Document>
{
Task<List<DocumentWithoutDetails>> GetListWithoutDetailsByProjectId(Guid projectId, CancellationToken cancellationToken = default);
Task<List<DocumentInfo>> GetUniqueListDocumentInfoAsync(CancellationToken cancellationToken = default);
Task<List<Document>> GetListByProjectId(Guid projectId, CancellationToken cancellationToken = default);

1
modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/IProjectRepository.cs

@ -9,6 +9,7 @@ namespace Volo.Docs.Projects
public interface IProjectRepository : IBasicRepository<Project, Guid>
{
Task<List<Project>> GetListAsync(string sorting, int maxResultCount, int skipCount, CancellationToken cancellationToken = default);
Task<List<ProjectWithoutDetails>> GetListWithoutDetailsAsync(CancellationToken cancellationToken = default);
Task<Project> GetByShortNameAsync(string shortName, CancellationToken cancellationToken = default);

9
modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/ProjectWithoutDetails.cs

@ -0,0 +1,9 @@
using System;
namespace Volo.Docs.Projects;
public class ProjectWithoutDetails
{
public Guid Id { get; set; }
public string Name { get; set; }
}

62
modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/Documents/EFCoreDocumentRepository.cs

@ -32,6 +32,23 @@ namespace Volo.Docs.Documents
.ToListAsync(GetCancellationToken(cancellationToken));
}
public async Task<List<DocumentInfo>> GetUniqueListDocumentInfoAsync(CancellationToken cancellationToken = default)
{
return await (await GetDbSetAsync())
.Select(x=> new DocumentInfo
{
ProjectId = x.ProjectId,
Version = x.Version,
LanguageCode = x.LanguageCode,
Format = x.Format,
})
.Distinct()
.OrderByDescending(x=>x.Version)
.ToListAsync(GetCancellationToken(cancellationToken));
}
public async Task<List<Document>> GetListByProjectId(Guid projectId,
CancellationToken cancellationToken = default)
{
@ -67,23 +84,21 @@ namespace Volo.Docs.Documents
int skipCount = 0,
CancellationToken cancellationToken = default)
{
var query = ApplyFilterForGetAll(
var query =await ApplyFilterForGetAll(
await GetDbSetAsync(),
projectId: projectId,
name: name,
version: version,
languageCode: languageCode,
format: format,
fileName: fileName,
format: format,
creationTimeMin: creationTimeMin,
creationTimeMax: creationTimeMax,
lastUpdatedTimeMin: lastUpdatedTimeMin,
lastUpdatedTimeMax: lastUpdatedTimeMax,
lastSignificantUpdateTimeMin: lastSignificantUpdateTimeMin,
lastSignificantUpdateTimeMax: lastSignificantUpdateTimeMax,
lastCachedTimeMin: lastCachedTimeMin,
lastCachedTimeMax: lastCachedTimeMax
);
lastCachedTimeMin: lastCachedTimeMin, lastCachedTimeMax: lastCachedTimeMax);
query = query.OrderBy(string.IsNullOrWhiteSpace(sorting) ? nameof(Document.Name) : sorting);
return await query.PageBy(skipCount, maxResultCount).ToListAsync(GetCancellationToken(cancellationToken));
@ -109,23 +124,21 @@ namespace Volo.Docs.Documents
int skipCount = 0,
CancellationToken cancellationToken = default)
{
var query = ApplyFilterForGetAll(
var query = await ApplyFilterForGetAll(
await GetDbSetAsync(),
projectId: projectId,
name: name,
version: version,
languageCode: languageCode,
format: format,
fileName: fileName,
format: format,
creationTimeMin: creationTimeMin,
creationTimeMax: creationTimeMax,
lastUpdatedTimeMin: lastUpdatedTimeMin,
lastUpdatedTimeMax: lastUpdatedTimeMax,
lastSignificantUpdateTimeMin: lastSignificantUpdateTimeMin,
lastSignificantUpdateTimeMax: lastSignificantUpdateTimeMax,
lastCachedTimeMin: lastCachedTimeMin,
lastCachedTimeMax: lastCachedTimeMax
);
lastCachedTimeMin: lastCachedTimeMin, lastCachedTimeMax: lastCachedTimeMax);
return await query.LongCountAsync(GetCancellationToken(cancellationToken));
}
@ -153,7 +166,7 @@ namespace Volo.Docs.Documents
return await (await GetDbSetAsync()).Where(x => x.Id == id).SingleAsync(cancellationToken: GetCancellationToken(cancellationToken));
}
protected virtual IQueryable<DocumentWithoutContent> ApplyFilterForGetAll(
protected virtual async Task<IQueryable<DocumentWithoutContent>> ApplyFilterForGetAll(
IQueryable<Document> query,
Guid? projectId,
string name,
@ -200,19 +213,24 @@ namespace Volo.Docs.Documents
d => d.LastCachedTime.Date >= lastCachedTimeMin.Value.Date)
.WhereIf(lastCachedTimeMax.HasValue,
d => d.LastCachedTime.Date <= lastCachedTimeMax.Value.Date)
.Join( (await GetDbContextAsync()).Projects,
d => d.ProjectId,
p => p.Id,
(d, p) => new { d, p })
.Select(x => new DocumentWithoutContent
{
Id = x.Id,
ProjectId = x.ProjectId,
Name = x.Name,
Version = x.Version,
LanguageCode = x.LanguageCode,
FileName = x.FileName,
Format = x.Format,
CreationTime = x.CreationTime,
LastUpdatedTime = x.LastUpdatedTime,
LastSignificantUpdateTime = x.LastSignificantUpdateTime,
LastCachedTime = x.LastCachedTime
Id = x.d.Id,
ProjectId = x.d.ProjectId,
ProjectName = x.p.Name,
Name = x.d.Name,
Version = x.d.Version,
LanguageCode = x.d.LanguageCode,
FileName = x.d.FileName,
Format = x.d.Format,
CreationTime = x.d.CreationTime,
LastUpdatedTime = x.d.LastUpdatedTime,
LastSignificantUpdateTime = x.d.LastSignificantUpdateTime,
LastCachedTime = x.d.LastCachedTime
});
}
}

11
modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/Projects/EfCoreProjectRepository.cs

@ -28,6 +28,17 @@ namespace Volo.Docs.Projects
return projects;
}
public async Task<List<ProjectWithoutDetails>> GetListWithoutDetailsAsync(CancellationToken cancellationToken = default)
{
return await (await GetDbSetAsync())
.Select(x=> new ProjectWithoutDetails() {
Id = x.Id,
Name = x.Name,
})
.OrderBy(x=>x.Name)
.ToListAsync(GetCancellationToken(cancellationToken));
}
public async Task<Project> GetByShortNameAsync(string shortName, CancellationToken cancellationToken = default)
{
var normalizeShortName = NormalizeShortName(shortName);

87
modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/docs-generate-proxy.json

@ -7,6 +7,8 @@
"Volo.Docs.Projects.DocsProjectController": {
"controllerName": "DocsProject",
"controllerGroupName": "Project",
"isRemoteService": true,
"apiVersion": null,
"type": "Volo.Docs.Projects.DocsProjectController",
"interfaces": [
{
@ -222,6 +224,8 @@
"Volo.Docs.Documents.DocsDocumentController": {
"controllerName": "DocsDocument",
"controllerGroupName": "Document",
"isRemoteService": true,
"apiVersion": null,
"type": "Volo.Docs.Documents.DocsDocumentController",
"interfaces": [
{
@ -648,6 +652,89 @@
"implementFrom": "Volo.Docs.Documents.IDocumentAppService"
}
}
},
"Volo.Docs.Areas.Documents.DocumentResourceController": {
"controllerName": "DocumentResource",
"controllerGroupName": "DocumentResource",
"isRemoteService": true,
"apiVersion": null,
"type": "Volo.Docs.Areas.Documents.DocumentResourceController",
"interfaces": [],
"actions": {
"GetResourceByInput": {
"uniqueName": "GetResourceByInput",
"name": "GetResource",
"httpMethod": "GET",
"url": "document-resources",
"supportedVersions": [],
"parametersOnMethod": [
{
"name": "input",
"typeAsString": "Volo.Docs.Documents.GetDocumentResourceInput, Volo.Docs.Application.Contracts",
"type": "Volo.Docs.Documents.GetDocumentResourceInput",
"typeSimple": "Volo.Docs.Documents.GetDocumentResourceInput",
"isOptional": false,
"defaultValue": null
}
],
"parameters": [
{
"nameOnMethod": "input",
"name": "ProjectId",
"jsonName": null,
"type": "System.Guid",
"typeSimple": "string",
"isOptional": false,
"defaultValue": null,
"constraintTypes": null,
"bindingSourceId": "ModelBinding",
"descriptorName": "input"
},
{
"nameOnMethod": "input",
"name": "Name",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isOptional": false,
"defaultValue": null,
"constraintTypes": null,
"bindingSourceId": "ModelBinding",
"descriptorName": "input"
},
{
"nameOnMethod": "input",
"name": "Version",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isOptional": false,
"defaultValue": null,
"constraintTypes": null,
"bindingSourceId": "ModelBinding",
"descriptorName": "input"
},
{
"nameOnMethod": "input",
"name": "LanguageCode",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isOptional": false,
"defaultValue": null,
"constraintTypes": null,
"bindingSourceId": "ModelBinding",
"descriptorName": "input"
}
],
"returnValue": {
"type": "Microsoft.AspNetCore.Mvc.FileResult",
"typeSimple": "Microsoft.AspNetCore.Mvc.FileResult"
},
"allowAnonymous": null,
"implementFrom": "Volo.Docs.Areas.Documents.DocumentResourceController"
}
}
}
}
}

68
modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/Documents/MongoDocumentRepository.cs

@ -34,6 +34,20 @@ namespace Volo.Docs.Documents
.ToListAsync(GetCancellationToken(cancellationToken));
}
public async Task<List<DocumentInfo>> GetUniqueListDocumentInfoAsync(CancellationToken cancellationToken = default)
{
return await (await GetMongoQueryableAsync(cancellationToken))
.Select(x=> new DocumentInfo {
ProjectId = x.ProjectId,
Version = x.Version,
LanguageCode = x.LanguageCode,
Format = x.Format
})
.Distinct()
.OrderByDescending(x=>x.Version)
.ToListAsync(GetCancellationToken(cancellationToken));
}
public async Task<List<Document>> GetListByProjectId(Guid projectId, CancellationToken cancellationToken = default)
{
return await (await GetMongoQueryableAsync(cancellationToken)).Where(d => d.ProjectId == projectId).ToListAsync(GetCancellationToken(cancellationToken));
@ -88,22 +102,21 @@ namespace Volo.Docs.Documents
{
return await
ApplyFilterForGetAll(
(await ApplyFilterForGetAll(
await GetMongoQueryableAsync(cancellationToken),
projectId: projectId,
name: name,
version: version,
languageCode: languageCode,
format: format,
fileName: fileName,
format: format,
creationTimeMin: creationTimeMin,
creationTimeMax: creationTimeMax,
lastUpdatedTimeMin: lastUpdatedTimeMin,
lastUpdatedTimeMax: lastUpdatedTimeMax,
lastSignificantUpdateTimeMin: lastSignificantUpdateTimeMin,
lastSignificantUpdateTimeMax: lastSignificantUpdateTimeMax,
lastCachedTimeMin: lastCachedTimeMin,
lastCachedTimeMax: lastCachedTimeMax)
lastCachedTimeMin: lastCachedTimeMin, lastCachedTimeMax: lastCachedTimeMax))
.OrderBy(string.IsNullOrWhiteSpace(sorting) ? "name asc" : sorting).As<IMongoQueryable<DocumentWithoutContent>>()
.PageBy<DocumentWithoutContent, IMongoQueryable<DocumentWithoutContent>>(skipCount, maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken));
@ -132,22 +145,21 @@ namespace Volo.Docs.Documents
return await
ApplyFilterForGetAll(
(await ApplyFilterForGetAll(
await GetMongoQueryableAsync(cancellationToken),
projectId: projectId,
name: name,
version: version,
languageCode: languageCode,
format: format,
fileName: fileName,
format: format,
creationTimeMin: creationTimeMin,
creationTimeMax: creationTimeMax,
lastUpdatedTimeMin: lastUpdatedTimeMin,
lastUpdatedTimeMax: lastUpdatedTimeMax,
lastSignificantUpdateTimeMin: lastSignificantUpdateTimeMin,
lastSignificantUpdateTimeMax: lastSignificantUpdateTimeMax,
lastCachedTimeMin: lastCachedTimeMin,
lastCachedTimeMax: lastCachedTimeMax)
lastCachedTimeMin: lastCachedTimeMin, lastCachedTimeMax: lastCachedTimeMax))
.OrderBy(string.IsNullOrWhiteSpace(sorting) ? "name asc" : sorting).As<IMongoQueryable<Document>>()
.PageBy<Document, IMongoQueryable<Document>>(skipCount, maxResultCount)
.LongCountAsync(GetCancellationToken(cancellationToken));
@ -157,8 +169,8 @@ namespace Volo.Docs.Documents
{
return await (await GetMongoQueryableAsync(cancellationToken)).Where(x => x.Id == id).SingleAsync(GetCancellationToken(cancellationToken));
}
protected virtual IMongoQueryable<DocumentWithoutContent> ApplyFilterForGetAll(
protected virtual async Task<IMongoQueryable<DocumentWithoutContent>> ApplyFilterForGetAll(
IMongoQueryable<Document> query,
Guid? projectId,
string name,
@ -200,6 +212,11 @@ namespace Volo.Docs.Documents
{
query = query.Where(d => d.FileName != null && d.FileName.Contains(fileName));
}
if (format != null)
{
query = query.Where(d => d.Format != null && d.Format == format);
}
if (creationTimeMin.HasValue)
{
@ -240,20 +257,25 @@ namespace Volo.Docs.Documents
{
query = query.Where(d => d.LastCachedTime.Date <= lastCachedTimeMax.Value.Date);
}
return query.Select(x => new DocumentWithoutContent
var join = query.Join(
(await GetDbContextAsync(cancellationToken)).Projects,
d => d.ProjectId,
p => p.Id,
(d, p) => new { Document = d, Project = p });
return join.Select(x => new DocumentWithoutContent
{
Id = x.Id,
ProjectId = x.ProjectId,
Name = x.Name,
Version = x.Version,
LanguageCode = x.LanguageCode,
FileName = x.FileName,
Format = x.Format,
CreationTime = x.CreationTime,
LastUpdatedTime = x.LastUpdatedTime,
LastSignificantUpdateTime = x.LastSignificantUpdateTime,
LastCachedTime = x.LastCachedTime
Id = x.Document.Id,
ProjectId = x.Document.ProjectId,
ProjectName = x.Project.Name,
Name = x.Document.Name,
Version = x.Document.Version,
LanguageCode = x.Document.LanguageCode,
FileName = x.Document.FileName,
Format = x.Document.Format,
CreationTime = x.Document.CreationTime,
LastUpdatedTime = x.Document.LastUpdatedTime,
LastSignificantUpdateTime = x.Document.LastSignificantUpdateTime,
LastCachedTime = x.Document.LastCachedTime
});
}
}

11
modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/Projects/MongoProjectRepository.cs

@ -29,6 +29,17 @@ namespace Volo.Docs.Projects
return projects;
}
public async Task<List<ProjectWithoutDetails>> GetListWithoutDetailsAsync(CancellationToken cancellationToken = default)
{
return await (await GetMongoQueryableAsync(cancellationToken))
.Select(x=> new ProjectWithoutDetails {
Id = x.Id,
Name = x.Name,
})
.OrderBy(x=>x.Name)
.ToListAsync(GetCancellationToken(cancellationToken));
}
public async Task<Project> GetByShortNameAsync(string shortName, CancellationToken cancellationToken = default)
{
var normalizeShortName = NormalizeShortName(shortName);

32
modules/docs/test/Volo.Docs.Admin.Application.Tests/Volo/Docs/DocumentAdminAppService_Tests.cs

@ -1,4 +1,5 @@
using System.Threading.Tasks;
using System.Linq;
using System.Threading.Tasks;
using Shouldly;
using Volo.Docs.Admin.Documents;
using Volo.Docs.Documents;
@ -22,34 +23,47 @@ namespace Volo.Docs
[Fact]
public async Task PullAsync()
{
(await _documentRepository.FindAsync(_testData.PorjectId, "Part-I.md", "en", "1.0.0")).ShouldBeNull();
(await _documentRepository.FindAsync(_testData.ProjectId, "Part-I.md", "en", "1.0.0")).ShouldBeNull();
await _documentAdminAppService.PullAsync(new PullDocumentInput
{
ProjectId = _testData.PorjectId,
ProjectId = _testData.ProjectId,
Name = "Part-I.md",
LanguageCode = "en",
Version = "1.0.0"
});
(await _documentRepository.FindAsync(_testData.PorjectId, "Part-I.md", "en", "1.0.0")).ShouldNotBeNull();
(await _documentRepository.FindAsync(_testData.ProjectId, "Part-I.md", "en", "1.0.0")).ShouldNotBeNull();
}
[Fact]
public async Task PullAllAsync()
{
(await _documentRepository.FindAsync(_testData.PorjectId, "Part-I.md", "en", "1.0.0")).ShouldBeNull();
(await _documentRepository.FindAsync(_testData.PorjectId, "Part-II.md", "en", "1.0.0")).ShouldBeNull();
(await _documentRepository.FindAsync(_testData.ProjectId, "Part-I.md", "en", "1.0.0")).ShouldBeNull();
(await _documentRepository.FindAsync(_testData.ProjectId, "Part-II.md", "en", "1.0.0")).ShouldBeNull();
await _documentAdminAppService.PullAllAsync(new PullAllDocumentInput
{
ProjectId = _testData.PorjectId,
ProjectId = _testData.ProjectId,
LanguageCode = "en",
Version = "1.0.0"
});
(await _documentRepository.FindAsync(_testData.PorjectId, "Part-I.md", "en", "1.0.0")).ShouldNotBeNull();
(await _documentRepository.FindAsync(_testData.PorjectId, "Part-II.md", "en", "1.0.0")).ShouldNotBeNull();
(await _documentRepository.FindAsync(_testData.ProjectId, "Part-I.md", "en", "1.0.0")).ShouldNotBeNull();
(await _documentRepository.FindAsync(_testData.ProjectId, "Part-II.md", "en", "1.0.0")).ShouldNotBeNull();
}
[Fact]
public async Task GetFilterItemsAsync()
{
var filterItems = await _documentAdminAppService.GetFilterItemsAsync();
filterItems.ShouldNotBeEmpty();
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");
}
}
}

10
modules/docs/test/Volo.Docs.Admin.Application.Tests/Volo/Docs/ProjectAdminAppService_Tests.cs

@ -34,9 +34,9 @@ namespace Volo.Docs
[Fact]
public async Task GetAsync()
{
var project = await _projectAdminAppService.GetAsync(_testData.PorjectId);
var project = await _projectAdminAppService.GetAsync(_testData.ProjectId);
project.ShouldNotBeNull();
project.Id.ShouldBe(_testData.PorjectId);
project.Id.ShouldBe(_testData.ProjectId);
}
[Fact]
@ -96,7 +96,7 @@ namespace Volo.Docs
};
updateProjectDto.ExtraProperties.Add("test", "test");
var projectDto = await _projectAdminAppService.UpdateAsync(_testData.PorjectId, updateProjectDto);
var projectDto = await _projectAdminAppService.UpdateAsync(_testData.ProjectId, updateProjectDto);
projectDto.ShouldNotBeNull();
@ -114,9 +114,9 @@ namespace Volo.Docs
[Fact]
public async Task DeleteAsync()
{
(await _projectRepository.GetAsync(_testData.PorjectId)).ShouldNotBeNull();
(await _projectRepository.GetAsync(_testData.ProjectId)).ShouldNotBeNull();
await _projectAdminAppService.DeleteAsync(_testData.PorjectId);
await _projectAdminAppService.DeleteAsync(_testData.ProjectId);
(await _projectRepository.GetListAsync()).ShouldBeEmpty();
}

2
modules/docs/test/Volo.Docs.Application.Tests/Volo/Docs/ApplicationService_Tests.cs

@ -22,7 +22,7 @@ namespace Volo.Docs
var projects = await _projectAppService.GetListAsync();
projects.ShouldNotBeNull();
projects.Items.Count.ShouldBe(1);
projects.Items.ShouldContain(x => x.Id == _testData.PorjectId);
projects.Items.ShouldContain(x => x.Id == _testData.ProjectId);
}
[Fact]

6
modules/docs/test/Volo.Docs.Domain.Tests/Volo/Docs/GithubDocumentSource_Tests.cs

@ -25,7 +25,7 @@ namespace Volo.Docs
{
var source = _documentSourceFactory.Create(GithubDocumentSource.Type);
var project = await _projectRepository.FindAsync(_testData.PorjectId);
var project = await _projectRepository.FindAsync(_testData.ProjectId);
project.ShouldNotBeNull();
var document = await source.GetDocumentAsync(project, "index2", "en", "0.123.0");
@ -42,7 +42,7 @@ namespace Volo.Docs
{
var source = _documentSourceFactory.Create(GithubDocumentSource.Type);
var project = await _projectRepository.FindAsync(_testData.PorjectId);
var project = await _projectRepository.FindAsync(_testData.ProjectId);
project.ShouldNotBeNull();
var document = await source.GetVersionsAsync(project);
@ -57,7 +57,7 @@ namespace Volo.Docs
{
var source = _documentSourceFactory.Create(GithubDocumentSource.Type);
var project = await _projectRepository.FindAsync(_testData.PorjectId);
var project = await _projectRepository.FindAsync(_testData.ProjectId);
project.ShouldNotBeNull();
var documentResource = await source.GetResource(project, "index.md", "en", "0.123.0");

2
modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocsTestData.cs

@ -5,6 +5,6 @@ namespace Volo.Docs
{
public class DocsTestData : ISingletonDependency
{
public Guid PorjectId { get; } = Guid.NewGuid();
public Guid ProjectId { get; } = Guid.NewGuid();
}
}

2
modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocsTestDataBuilder.cs

@ -27,7 +27,7 @@ namespace Volo.Docs
public async Task BuildAsync()
{
var project = new Project(
_testData.PorjectId,
_testData.ProjectId,
"ABP vNext",
"ABP",
GithubDocumentSource.Type,

4
modules/docs/test/Volo.Docs.TestBase/Volo/Docs/DocumentRepository_Tests.cs

@ -21,7 +21,7 @@ namespace Volo.Docs
[Fact]
public async Task FindAsync()
{
var document = await DocumentRepository.FindAsync(DocsTestData.PorjectId, "CLI.md", "en", "2.0.0");
var document = await DocumentRepository.FindAsync(DocsTestData.ProjectId, "CLI.md", "en", "2.0.0");
document.ShouldNotBeNull();
}
@ -30,7 +30,7 @@ namespace Volo.Docs
{
(await DocumentRepository.GetListAsync()).ShouldNotBeEmpty();
await DocumentRepository.DeleteAsync(DocsTestData.PorjectId, "CLI.md", "en", "2.0.0");
await DocumentRepository.DeleteAsync(DocsTestData.ProjectId, "CLI.md", "en", "2.0.0");
(await DocumentRepository.GetListAsync()).ShouldBeEmpty();
}

7
modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor.cs

@ -39,6 +39,13 @@ public partial class RoleManagement
ManagePermissionsPolicyName = IdentityPermissions.Roles.ManagePermissions;
}
protected override ValueTask SetBreadcrumbItemsAsync()
{
BreadcrumbItems.Add(new BlazoriseUI.BreadcrumbItem(L["Menu:IdentityManagement"].Value));
BreadcrumbItems.Add(new BlazoriseUI.BreadcrumbItem(L["Roles"].Value));
return base.SetBreadcrumbItemsAsync();
}
protected override ValueTask SetEntityActionsAsync()
{
EntityActions

7
modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor.cs

@ -66,6 +66,13 @@ public partial class UserManagement
}
}
protected override ValueTask SetBreadcrumbItemsAsync()
{
BreadcrumbItems.Add(new BlazoriseUI.BreadcrumbItem(L["Menu:IdentityManagement"].Value));
BreadcrumbItems.Add(new BlazoriseUI.BreadcrumbItem(L["Users"].Value));
return base.SetBreadcrumbItemsAsync();
}
protected virtual async Task OnSearchTextChanged(string value)
{
GetListInput.Filter = value;

2
modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor.cs

@ -31,6 +31,8 @@ public partial class SettingManagement
protected async override Task OnInitializedAsync()
{
BreadcrumbItems.Add(new BreadcrumbItem(@L["Settings"]));
SettingComponentCreationContext = new SettingComponentCreationContext(ServiceProvider);
foreach (var contributor in Options.Contributors)

7
modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor.cs

@ -40,6 +40,13 @@ public partial class TenantManagement
ManageFeaturesPolicyName = TenantManagementPermissions.Tenants.ManageFeatures;
}
protected override ValueTask SetBreadcrumbItemsAsync()
{
BreadcrumbItems.Add(new BlazoriseUI.BreadcrumbItem(L["Menu:TenantManagement"]));
BreadcrumbItems.Add(new BlazoriseUI.BreadcrumbItem(L["Tenants"]));
return base.SetBreadcrumbItemsAsync();
}
protected override async Task SetPermissionsAsync()
{
await base.SetPermissionsAsync();

7
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Data/OpenIddictDataSeedContributor.cs

@ -198,6 +198,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep
{
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Token);
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Revocation);
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Introspection);
}
if (grantType == OpenIddictConstants.GrantTypes.ClientCredentials)
@ -220,6 +221,12 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep
application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.RefreshToken);
}
if (grantType == OpenIddictConstants.GrantTypes.DeviceCode)
{
application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.DeviceCode);
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Device);
}
if (grantType == OpenIddictConstants.GrantTypes.Implicit)
{
application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.IdToken);

7
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Data/OpenIddictDataSeedContributor.cs

@ -198,6 +198,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep
{
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Token);
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Revocation);
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Introspection);
}
if (grantType == OpenIddictConstants.GrantTypes.ClientCredentials)
@ -220,6 +221,12 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep
application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.RefreshToken);
}
if (grantType == OpenIddictConstants.GrantTypes.DeviceCode)
{
application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.DeviceCode);
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Device);
}
if (grantType == OpenIddictConstants.GrantTypes.Implicit)
{
application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.IdToken);

7
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/OpenIddict/OpenIddictDataSeedContributor.cs

@ -281,6 +281,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep
{
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Token);
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Revocation);
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Introspection);
}
if (grantType == OpenIddictConstants.GrantTypes.ClientCredentials)
@ -303,6 +304,12 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep
application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.RefreshToken);
}
if (grantType == OpenIddictConstants.GrantTypes.DeviceCode)
{
application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.DeviceCode);
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Device);
}
if (grantType == OpenIddictConstants.GrantTypes.Implicit)
{
application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.IdToken);

7
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/OpenIddict/OpenIddictDataSeedContributor.cs

@ -250,6 +250,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep
{
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Token);
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Revocation);
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Introspection);
}
if (grantType == OpenIddictConstants.GrantTypes.ClientCredentials)
@ -272,6 +273,12 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep
application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.RefreshToken);
}
if (grantType == OpenIddictConstants.GrantTypes.DeviceCode)
{
application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.DeviceCode);
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Device);
}
if (grantType == OpenIddictConstants.GrantTypes.Implicit)
{
application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.IdToken);

Loading…
Cancel
Save