Browse Source

Merge branch 'dev' into cotur/cms-kit/comments

pull/7757/head
Ahmet 6 years ago
parent
commit
e77d6e7617
  1. 4
      docs/en/UI/Angular/Multi-Tenancy.md
  2. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj
  3. 2
      framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo.Abp.EntityFrameworkCore.Oracle.csproj
  4. 59
      framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/AbpDbContextConfigurationContextOracleExtensions.cs
  5. 60
      framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/AbpDbContextOptionsOracleExtensions.cs
  6. 42
      framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/Oracle/AbpEntityFrameworkCoreOracleModule.cs
  7. 2
      framework/src/Volo.Abp.Minify/Volo.Abp.Minify.csproj
  8. 2
      framework/src/Volo.Abp.Swashbuckle/Volo.Abp.Swashbuckle.csproj
  9. 5
      modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/RegisterDto.cs
  10. 3
      modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs
  11. 1
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/Volo.CmsKit.Web.Unified.csproj
  12. 2
      modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Contents/ContentAdminAppService.cs
  13. 6
      modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs
  14. 55
      modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/EntityTagAdminAppService.cs
  15. 2
      modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/TagAdminAppService.cs
  16. 18
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/Content.cs
  17. 9
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentManager.cs
  18. 32
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/Page.cs
  19. 1
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/CmsKitTagOptions.cs
  20. 15
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/DefaultTagDefinitionStore.cs
  21. 6
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTag.cs
  22. 25
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTagManager.cs
  23. 21
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/Tag.cs
  24. 3
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/TagEntityTypeDefiniton.cs
  25. 62
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/TagManager.cs
  26. 8
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Contents/EfCoreContentRepository.cs
  27. 25
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Pages/EfCorePageRepository.cs
  28. 24
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreEntityTagRepository.cs
  29. 2
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs
  30. 8
      modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Contents/MongoContentRepository.cs
  31. 2
      modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/IPagePublicAppService.cs
  32. 6
      modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Contents/ContentPublicAppService.cs
  33. 27
      modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PageAppService.cs
  34. 28
      modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs
  35. 13
      modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Pages/PagesPublicController.cs
  36. 4
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Controllers/PageController.cs
  37. 4
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/DefaultPageViewComponent.cs
  38. 4
      modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PagePublicAppService_Tests.cs
  39. 9
      modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml
  40. 7
      modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs
  41. 9
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDataSeedContributor.cs
  42. 2
      modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/AbpIdentityServerMongoDbContext.cs
  43. 2
      modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/IAbpIdentityServerMongoDbContext.cs
  44. 2
      modules/setting-management/src/Volo.Abp.SettingManagement.Application.Contracts/Volo/Abp/SettingManagement/SettingManagementPermissionDefinitionProvider.cs
  45. 2
      modules/setting-management/src/Volo.Abp.SettingManagement.Application.Contracts/Volo/Abp/SettingManagement/SettingManagementPermissions.cs
  46. 2
      modules/setting-management/src/Volo.Abp.SettingManagement.Application/Volo/Abp/SettingManagement/EmailSettingsAppService.cs
  47. 2
      modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/AbpSettingManagementBlazorModule.cs
  48. 2
      modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs
  49. 6
      modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Settings/EmailSettingPageContributor.cs
  50. 4
      modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/de-DE.json
  51. 4
      modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/en.json
  52. 4
      modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/es.json
  53. 4
      modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/tr.json
  54. 4
      modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/zh-Hans.json
  55. 2
      modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs
  56. 8
      modules/setting-management/src/Volo.Abp.SettingManagement.Web/Settings/EmailSettingPageContributor.cs
  57. 2
      nupkg/common.ps1
  58. 6
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/Data/MyProjectNameDbMigrationService.cs
  59. 1
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs
  60. 11
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json
  61. 1
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyCompanyName.MyProjectName.HttpApi.HostWithIds.csproj
  62. 1
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs
  63. 11
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json
  64. 11
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/appsettings.json
  65. 11
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/appsettings.json
  66. 1
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs
  67. 1
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyCompanyName.MyProjectName.Web.Unified.csproj

4
docs/en/UI/Angular/Multi-Tenancy.md

@ -91,10 +91,10 @@ export const environment = {
> **Important Note:** The `application.baseUrl` and the `{0}` placeholder in the value of the `baseUrl` property are required to be able to get tenant from running URL. Other placeholders in API URLs are optional. > **Important Note:** The `application.baseUrl` and the `{0}` placeholder in the value of the `baseUrl` property are required to be able to get tenant from running URL. Other placeholders in API URLs are optional.
After the configuration above, if your app runs on the `mytenant1.mydomain.com`, the app will get tenant name as **mytenant1** and replace the environment object in `ConfigState` on app initialization as follows: After the configuration above, if your app runs on the `mytenant1.mydomain.com`, the app will get tenant name as **mytenant1** and replace the environment object in `EnvironmentService` on app initialization as follows:
```js ```js
// environment object in ConfigState // environment object in EnvironmentService
{ {
//... //...

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj

@ -15,7 +15,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="NUglify" Version="1.11.4" /> <PackageReference Include="NUglify" Version="1.13.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

2
framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo.Abp.EntityFrameworkCore.Oracle.csproj

@ -19,7 +19,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<!--<PackageReference Include="Oracle.EntityFrameworkCore" Version="3.19.80" />--> <PackageReference Include="Oracle.EntityFrameworkCore" Version="5.21.1" />
</ItemGroup> </ItemGroup>
</Project> </Project>

59
framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/AbpDbContextConfigurationContextOracleExtensions.cs

@ -1,26 +1,33 @@
// using JetBrains.Annotations; using JetBrains.Annotations;
// using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
// using System; using System;
// using Oracle.EntityFrameworkCore.Infrastructure; using Oracle.EntityFrameworkCore.Infrastructure;
// using Volo.Abp.EntityFrameworkCore.DependencyInjection; using Volo.Abp.EntityFrameworkCore.DependencyInjection;
//
// namespace Volo.Abp.EntityFrameworkCore namespace Volo.Abp.EntityFrameworkCore
// { {
// public static class AbpDbContextConfigurationContextOracleExtensions public static class AbpDbContextConfigurationContextOracleExtensions
// { {
// public static DbContextOptionsBuilder UseOracle( public static DbContextOptionsBuilder UseOracle(
// [NotNull] this AbpDbContextConfigurationContext context, [NotNull] this AbpDbContextConfigurationContext context,
// [CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null) [CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null)
// { {
// TODO: UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery); if (context.ExistingConnection != null)
// if (context.ExistingConnection != null) {
// { return context.DbContextOptions.UseOracle(context.ExistingConnection, optionsBuilder =>
// return context.DbContextOptions.UseOracle(context.ExistingConnection, oracleOptionsAction); {
// } optionsBuilder.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery);
// else oracleOptionsAction?.Invoke(optionsBuilder);
// { });
// return context.DbContextOptions.UseOracle(context.ConnectionString, oracleOptionsAction); }
// } else
// } {
// } return context.DbContextOptions.UseOracle(context.ConnectionString, optionsBuilder =>
// } {
optionsBuilder.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery);
oracleOptionsAction?.Invoke(optionsBuilder);
});
}
}
}
}

60
framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/AbpDbContextOptionsOracleExtensions.cs

@ -1,30 +1,30 @@
// using JetBrains.Annotations; using JetBrains.Annotations;
// using System; using System;
// using Oracle.EntityFrameworkCore.Infrastructure; using Oracle.EntityFrameworkCore.Infrastructure;
//
// namespace Volo.Abp.EntityFrameworkCore namespace Volo.Abp.EntityFrameworkCore
// { {
// public static class AbpDbContextOptionsOracleExtensions public static class AbpDbContextOptionsOracleExtensions
// { {
// public static void UseOracle( public static void UseOracle(
// [NotNull] this AbpDbContextOptions options, [NotNull] this AbpDbContextOptions options,
// [CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null) [CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null)
// { {
// options.Configure(context => options.Configure(context =>
// { {
// context.UseOracle(oracleOptionsAction); context.UseOracle(oracleOptionsAction);
// }); });
// } }
//
// public static void UseOracle<TDbContext>( public static void UseOracle<TDbContext>(
// [NotNull] this AbpDbContextOptions options, [NotNull] this AbpDbContextOptions options,
// [CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null) [CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null)
// where TDbContext : AbpDbContext<TDbContext> where TDbContext : AbpDbContext<TDbContext>
// { {
// options.Configure<TDbContext>(context => options.Configure<TDbContext>(context =>
// { {
// context.UseOracle(oracleOptionsAction); context.UseOracle(oracleOptionsAction);
// }); });
// } }
// } }
// } }

42
framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/Oracle/AbpEntityFrameworkCoreOracleModule.cs

@ -1,22 +1,20 @@
// using Volo.Abp.Guids; using Volo.Abp.Guids;
// using Volo.Abp.Modularity; using Volo.Abp.Modularity;
//
// namespace Volo.Abp.EntityFrameworkCore.Oracle namespace Volo.Abp.EntityFrameworkCore.Oracle
// { {
// [DependsOn( [DependsOn(typeof(AbpEntityFrameworkCoreModule))]
// typeof(AbpEntityFrameworkCoreModule) public class AbpEntityFrameworkCoreOracleModule : AbpModule
// )] {
// public class AbpEntityFrameworkCoreOracleModule : AbpModule public override void ConfigureServices(ServiceConfigurationContext context)
// { {
// public override void ConfigureServices(ServiceConfigurationContext context) Configure<AbpSequentialGuidGeneratorOptions>(options =>
// { {
// Configure<AbpSequentialGuidGeneratorOptions>(options => if (options.DefaultSequentialGuidType == null)
// { {
// if (options.DefaultSequentialGuidType == null) options.DefaultSequentialGuidType = SequentialGuidType.SequentialAsBinary;
// { }
// options.DefaultSequentialGuidType = SequentialGuidType.SequentialAsBinary; });
// } }
// }); }
// } }
// }
// }

2
framework/src/Volo.Abp.Minify/Volo.Abp.Minify.csproj

@ -19,7 +19,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="NUglify" Version="1.11.4" /> <PackageReference Include="NUglify" Version="1.13.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
framework/src/Volo.Abp.Swashbuckle/Volo.Abp.Swashbuckle.csproj

@ -15,7 +15,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="6.0.5" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

5
modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/RegisterDto.cs

@ -1,11 +1,12 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Volo.Abp.Auditing; using Volo.Abp.Auditing;
using Volo.Abp.Identity; using Volo.Abp.Identity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Validation; using Volo.Abp.Validation;
namespace Volo.Abp.Account namespace Volo.Abp.Account
{ {
public class RegisterDto public class RegisterDto : ExtensibleObject
{ {
[Required] [Required]
[DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxUserNameLength))] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxUserNameLength))]
@ -25,4 +26,4 @@ namespace Volo.Abp.Account
[Required] [Required]
public string AppName { get; set; } public string AppName { get; set; }
} }
} }

3
modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs

@ -6,6 +6,7 @@ using Volo.Abp.Account.Localization;
using Volo.Abp.Account.Settings; using Volo.Abp.Account.Settings;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Volo.Abp.Identity; using Volo.Abp.Identity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Settings; using Volo.Abp.Settings;
namespace Volo.Abp.Account namespace Volo.Abp.Account
@ -42,6 +43,8 @@ namespace Volo.Abp.Account
var user = new IdentityUser(GuidGenerator.Create(), input.UserName, input.EmailAddress, CurrentTenant.Id); var user = new IdentityUser(GuidGenerator.Create(), input.UserName, input.EmailAddress, CurrentTenant.Id);
input.MapExtraPropertiesTo(user);
(await UserManager.CreateAsync(user, input.Password)).CheckErrors(); (await UserManager.CreateAsync(user, input.Password)).CheckErrors();
await UserManager.SetEmailAsync(user,input.EmailAddress); await UserManager.SetEmailAsync(user,input.EmailAddress);

1
modules/cms-kit/host/Volo.CmsKit.Web.Unified/Volo.CmsKit.Web.Unified.csproj

@ -10,7 +10,6 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" /> <PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="$(MicrosoftPackageVersion)" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="$(MicrosoftPackageVersion)" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" /> <ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" /> <ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />

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

@ -56,7 +56,7 @@ namespace Volo.CmsKit.Admin.Contents
return MapToGetOutputDto(entity); return MapToGetOutputDto(entity);
} }
public async Task<ContentDto> GetAsync( public virtual async Task<ContentDto> GetAsync(
[NotNull] string entityType, [NotNull] string entityType,
[NotNull] string entityId) [NotNull] string entityId)
{ {

6
modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs

@ -14,7 +14,7 @@ namespace Volo.CmsKit.Admin.Pages
[Authorize(CmsKitAdminPermissions.Pages.Default)] [Authorize(CmsKitAdminPermissions.Pages.Default)]
public class PageAdminAppService : CmsKitAdminAppServiceBase, IPageAdminAppService public class PageAdminAppService : CmsKitAdminAppServiceBase, IPageAdminAppService
{ {
protected readonly IPageRepository PageRepository; protected IPageRepository PageRepository { get; }
public PageAdminAppService(IPageRepository pageRepository) public PageAdminAppService(IPageRepository pageRepository)
{ {
@ -66,8 +66,8 @@ namespace Volo.CmsKit.Admin.Pages
await CheckPageUrlAsync(input.Url); await CheckPageUrlAsync(input.Url);
} }
page.Title = input.Title; page.SetTitle(input.Title);
page.Url = input.Url; page.SetUrl(input.Url);
page.Description = input.Description; page.Description = input.Description;
await PageRepository.UpdateAsync(page); await PageRepository.UpdateAsync(page);

55
modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/EntityTagAdminAppService.cs

@ -1,19 +1,17 @@
using System; using System.Linq;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.CmsKit.Admin.Tags;
using Volo.CmsKit.Tags; using Volo.CmsKit.Tags;
namespace Volo.CmsKit.Admin.Tags namespace Volo.CmsKit.Admin.Tags
{ {
public class EntityTagAdminAppService : CmsKitAdminAppServiceBase, IEntityTagAdminAppService public class EntityTagAdminAppService : CmsKitAdminAppServiceBase, IEntityTagAdminAppService
{ {
protected readonly ITagDefinitionStore _tagDefinitionStore; protected ITagDefinitionStore TagDefinitionStore { get; }
protected readonly IEntityTagManager _entityTagManager; protected IEntityTagManager EntityTagManager { get; }
protected readonly ITagManager _tagManager; protected ITagManager TagManager { get; }
protected readonly ITagRepository _tagRepository; protected ITagRepository TagRepository { get; }
protected readonly IEntityTagRepository _entityTagRepository; protected IEntityTagRepository EntityTagRepository { get; }
public EntityTagAdminAppService( public EntityTagAdminAppService(
ITagDefinitionStore tagDefinitionStore, ITagDefinitionStore tagDefinitionStore,
@ -22,60 +20,61 @@ namespace Volo.CmsKit.Admin.Tags
ITagRepository tagRepository, ITagRepository tagRepository,
IEntityTagRepository entityTagRepository) IEntityTagRepository entityTagRepository)
{ {
_tagDefinitionStore = tagDefinitionStore; TagDefinitionStore = tagDefinitionStore;
_entityTagManager = entityTagManager; EntityTagManager = entityTagManager;
_tagManager = tagManager; TagManager = tagManager;
_tagRepository = tagRepository; TagRepository = tagRepository;
_entityTagRepository = entityTagRepository; EntityTagRepository = entityTagRepository;
} }
public async Task AddTagToEntityAsync(EntityTagCreateDto input) public virtual async Task AddTagToEntityAsync(EntityTagCreateDto input)
{ {
var definition = await _tagDefinitionStore.GetTagEntityTypeDefinitionsAsync(input.EntityType); var definition = await TagDefinitionStore.GetTagEntityTypeDefinitionsAsync(input.EntityType);
await CheckPolicyAsync(definition.CreatePolicy); await CheckPolicyAsync(definition.CreatePolicy);
var tag = await _tagManager.GetOrAddAsync(input.EntityType, input.TagName, CurrentTenant?.Id); var tag = await TagManager.GetOrAddAsync(input.EntityType, input.TagName, CurrentTenant?.Id);
await _entityTagManager.AddTagToEntityAsync( await EntityTagManager.AddTagToEntityAsync(
tag.Id, tag.Id,
input.EntityType, input.EntityType,
input.EntityId, input.EntityId,
CurrentTenant?.Id); CurrentTenant?.Id);
} }
public async Task RemoveTagFromEntityAsync(EntityTagRemoveDto input) public virtual async Task RemoveTagFromEntityAsync(EntityTagRemoveDto input)
{ {
var definition = await _tagDefinitionStore.GetTagEntityTypeDefinitionsAsync(input.EntityType); var definition = await TagDefinitionStore.GetTagEntityTypeDefinitionsAsync(input.EntityType);
await CheckPolicyAsync(definition.DeletePolicy); await CheckPolicyAsync(definition.DeletePolicy);
await _entityTagManager.RemoveTagFromEntityAsync( await EntityTagManager.RemoveTagFromEntityAsync(
input.TagId, input.TagId,
input.EntityType, input.EntityType,
input.EntityId, input.EntityId,
CurrentTenant?.Id); CurrentTenant?.Id);
} }
public async Task SetEntityTagsAsync(EntityTagSetDto input) public virtual async Task SetEntityTagsAsync(EntityTagSetDto input)
{ {
var definition = await _tagDefinitionStore.GetTagEntityTypeDefinitionsAsync(input.EntityType); var definition = await TagDefinitionStore.GetTagEntityTypeDefinitionsAsync(input.EntityType);
await CheckPolicyAsync(definition.UpdatePolicy); await CheckPolicyAsync(definition.UpdatePolicy);
var existingTags = await _tagRepository.GetAllRelatedTagsAsync(input.EntityType, input.EntityId, CurrentTenant?.Id); var existingTags =
await TagRepository.GetAllRelatedTagsAsync(input.EntityType, input.EntityId, CurrentTenant?.Id);
var deletedTags = existingTags.Where(x => !input.Tags.Contains(x.Name)).ToList(); var deletedTags = existingTags.Where(x => !input.Tags.Contains(x.Name)).ToList();
var addedTags = input.Tags.Where(x => !existingTags.Any(a => a.Name == x)); var addedTags = input.Tags.Where(x => !existingTags.Any(a => a.Name == x));
await _entityTagRepository.DeleteManyAsync(deletedTags.Select(s => s.Id).ToArray()); await EntityTagRepository.DeleteManyAsync(deletedTags.Select(s => s.Id).ToArray());
foreach (var addedTag in addedTags) foreach (var addedTag in addedTags)
{ {
var tag = await _tagManager.GetOrAddAsync(input.EntityType, addedTag, CurrentTenant?.Id); var tag = await TagManager.GetOrAddAsync(input.EntityType, addedTag, CurrentTenant?.Id);
await _entityTagManager.AddTagToEntityAsync(tag.Id, input.EntityType, input.EntityId, CurrentTenant?.Id); await EntityTagManager.AddTagToEntityAsync(tag.Id, input.EntityType, input.EntityId, CurrentTenant?.Id);
} }
} }
} }
} }

2
modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/TagAdminAppService.cs

@ -72,7 +72,7 @@ namespace Volo.CmsKit.Admin.Tags
x.EntityType.ToLower().Contains(input.Filter)); x.EntityType.ToLower().Contains(input.Filter));
} }
public async Task<List<TagDefinitionDto>> GetTagDefinitionsAsync() public virtual async Task<List<TagDefinitionDto>> GetTagDefinitionsAsync()
{ {
var definitions = await TagManager.GetTagDefinitionsAsync(); var definitions = await TagManager.GetTagDefinitionsAsync();

18
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/Content.cs

@ -8,12 +8,16 @@ namespace Volo.CmsKit.Contents
{ {
public class Content : FullAuditedAggregateRoot<Guid>, IMultiTenant public class Content : FullAuditedAggregateRoot<Guid>, IMultiTenant
{ {
[CanBeNull]
public virtual Guid? TenantId { get; protected set; } public virtual Guid? TenantId { get; protected set; }
[NotNull]
public virtual string EntityType { get; protected set; } public virtual string EntityType { get; protected set; }
public virtual string EntityId { get; set; } [NotNull]
public virtual string EntityId { get; protected set; }
[NotNull]
public virtual string Value { get; protected set; } public virtual string Value { get; protected set; }
protected Content() protected Content()
@ -23,16 +27,22 @@ namespace Volo.CmsKit.Contents
public Content(Guid id, [NotNull] string entityType, [NotNull] string entityId, [NotNull] string value, Guid? tenantId = null) : base(id) public Content(Guid id, [NotNull] string entityType, [NotNull] string entityId, [NotNull] string value, Guid? tenantId = null) : base(id)
{ {
EntityType = Check.NotNullOrWhiteSpace(entityType, nameof(entityType), ContentConsts.MaxEntityTypeLength);
EntityId = Check.NotNullOrWhiteSpace(entityId, nameof(entityId), ContentConsts.MaxEntityIdLength); EntityId = Check.NotNullOrWhiteSpace(entityId, nameof(entityId), ContentConsts.MaxEntityIdLength);
SetValue(value); EntityType = Check.NotNullOrEmpty(entityType, nameof(entityType), ContentConsts.MaxEntityTypeLength);
Value = Check.NotNullOrEmpty(value, nameof(value), ContentConsts.MaxValueLength);
TenantId = tenantId; TenantId = tenantId;
} }
public void SetValue([NotNull] string value) public void SetValue([NotNull] string value)
{ {
Value = Check.NotNullOrWhiteSpace(value, nameof(value), ContentConsts.MaxValueLength); Value = Check.NotNullOrEmpty(value, nameof(value), ContentConsts.MaxValueLength);
}
public void SetEntity([NotNull] string entityType, [NotNull] string entityId)
{
EntityType = Check.NotNullOrEmpty(entityType, nameof(entityType), ContentConsts.MaxEntityTypeLength);
EntityId = Check.NotNullOrWhiteSpace(entityId, nameof(entityId), ContentConsts.MaxEntityIdLength);
} }
} }
} }

9
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentManager.cs

@ -18,14 +18,15 @@ namespace Volo.CmsKit.Contents
ContentRepository = contentRepository; ContentRepository = contentRepository;
} }
public async Task<Content> InsertAsync(Content content, CancellationToken cancellationToken = default) public virtual async Task<Content> InsertAsync(Content content, CancellationToken cancellationToken = default)
{ {
if (await ContentRepository.ExistsAsync(content.EntityType, content.EntityId, content.TenantId, cancellationToken)) if (await ContentRepository.ExistsAsync(content.EntityType, content.EntityId, content.TenantId,
cancellationToken))
{ {
throw new ContentAlreadyExistException(content.EntityType, content.EntityId); throw new ContentAlreadyExistException(content.EntityType, content.EntityId);
} }
return await ContentRepository.InsertAsync(content); return await ContentRepository.InsertAsync(content, cancellationToken: cancellationToken);
} }
} }
} }

32
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/Page.cs

@ -8,26 +8,36 @@ namespace Volo.CmsKit.Pages
{ {
public class Page : FullAuditedAggregateRoot<Guid>, IMultiTenant public class Page : FullAuditedAggregateRoot<Guid>, IMultiTenant
{ {
public Guid? TenantId { get; set; } [CanBeNull] public virtual Guid? TenantId { get; set; }
public virtual string Title { get; set; } [NotNull] public virtual string Title { get; protected set; }
[NotNull] public virtual string Url { get; protected set; }
[CanBeNull] public virtual string Description { get; set; }
public virtual string Url { get; set; }
public virtual string Description { get; set; }
protected Page() protected Page()
{ {
} }
public Page(Guid id, [NotNull] string title, [NotNull] string url, [CanBeNull] string description = null, Guid? tenantId = null) : base(id) public Page(Guid id, [NotNull] string title, [NotNull] string url, [CanBeNull] string description = null,
Guid? tenantId = null) : base(id)
{ {
Title = Check.NotNullOrWhiteSpace(title, nameof(title), PageConsts.MaxTitleLength); Title = Check.NotNullOrEmpty(title, nameof(title), PageConsts.MaxTitleLength);
Url = Check.NotNullOrWhiteSpace(url, nameof(url), PageConsts.MaxUrlLength); Url = Check.NotNullOrEmpty(url, nameof(url), PageConsts.MaxUrlLength);
Description = Check.Length(description, nameof(description), PageConsts.MaxDescriptionLength); Description = Check.Length(description, nameof(description), PageConsts.MaxDescriptionLength);
TenantId = tenantId; TenantId = tenantId;
} }
public virtual void SetTitle(string title)
{
Title = Check.NotNullOrEmpty(title, nameof(title), PageConsts.MaxTitleLength);
}
public virtual void SetUrl(string url)
{
Url = Check.NotNullOrEmpty(url, nameof(url), PageConsts.MaxUrlLength);
}
} }
} }

1
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/CmsKitTagOptions.cs

@ -1,5 +1,4 @@
using JetBrains.Annotations; using JetBrains.Annotations;
using Volo.CmsKit.Tags;
namespace Volo.CmsKit.Tags namespace Volo.CmsKit.Tags
{ {

15
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/DefaultTagDefinitionStore.cs

@ -11,11 +11,11 @@ namespace Volo.CmsKit.Tags
{ {
public class DefaultTagDefinitionStore : ITagDefinitionStore, ITransientDependency public class DefaultTagDefinitionStore : ITagDefinitionStore, ITransientDependency
{ {
private readonly CmsKitTagOptions options; protected CmsKitTagOptions CmsKitTagOptions { get; }
public DefaultTagDefinitionStore(IOptions<CmsKitTagOptions> options) public DefaultTagDefinitionStore(IOptions<CmsKitTagOptions> options)
{ {
this.options = options.Value; CmsKitTagOptions = options.Value;
} }
/// <summary> /// <summary>
@ -28,7 +28,8 @@ namespace Volo.CmsKit.Tags
{ {
Check.NotNullOrWhiteSpace(entityType, nameof(entityType)); Check.NotNullOrWhiteSpace(entityType, nameof(entityType));
var result = options.EntityTypes.SingleOrDefault(x => x.EntityType == entityType) ?? throw new EntityNotTaggableException(entityType); var result = CmsKitTagOptions.EntityTypes.SingleOrDefault(x => x.EntityType == entityType) ??
throw new EntityNotTaggableException(entityType);
return Task.FromResult(result); return Task.FromResult(result);
} }
@ -38,7 +39,7 @@ namespace Volo.CmsKit.Tags
/// </summary> /// </summary>
public virtual Task<List<TagEntityTypeDefiniton>> GetTagEntityTypeDefinitionListAsync() public virtual Task<List<TagEntityTypeDefiniton>> GetTagEntityTypeDefinitionListAsync()
{ {
return Task.FromResult(options.EntityTypes.ToList()); return Task.FromResult(CmsKitTagOptions.EntityTypes.ToList());
} }
/// <summary> /// <summary>
@ -50,9 +51,9 @@ namespace Volo.CmsKit.Tags
{ {
Check.NotNullOrWhiteSpace(entityType, nameof(entityType)); Check.NotNullOrWhiteSpace(entityType, nameof(entityType));
var definition = options.EntityTypes.SingleOrDefault(x => x.EntityType == entityType); var isDefined = CmsKitTagOptions.EntityTypes.Any(x => x.EntityType == entityType);
return Task.FromResult(definition != null); return Task.FromResult(isDefined);
} }
} }
} }

6
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTag.cs

@ -1,4 +1,6 @@
using System; using System;
using JetBrains.Annotations;
using Volo.Abp;
using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
@ -16,10 +18,10 @@ namespace Volo.CmsKit.Tags
{ {
} }
internal EntityTag(Guid tagId, string entityId, Guid? tenantId = null) internal EntityTag(Guid tagId, [NotNull] string entityId, Guid? tenantId = null)
{ {
TagId = tagId; TagId = tagId;
EntityId = entityId; EntityId = Check.NotNullOrEmpty(entityId,nameof(entityId));
TenantId = tenantId; TenantId = tenantId;
} }

25
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTagManager.cs

@ -3,50 +3,47 @@ using System;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Domain.Services; using Volo.Abp.Domain.Services;
using Volo.CmsKit.Tags;
namespace Volo.CmsKit.Tags namespace Volo.CmsKit.Tags
{ {
public class EntityTagManager : DomainService, IEntityTagManager public class EntityTagManager : DomainService, IEntityTagManager
{ {
protected readonly IEntityTagRepository _entityTagRepository; protected IEntityTagRepository EntityTagRepository { get; }
protected readonly ITagDefinitionStore _tagDefinitionStore; protected ITagDefinitionStore TagDefinitionStore { get; }
public EntityTagManager( public EntityTagManager(
IEntityTagRepository entityTagRepository, IEntityTagRepository entityTagRepository,
ITagDefinitionStore tagDefinitionStore) ITagDefinitionStore tagDefinitionStore)
{ {
_entityTagRepository = entityTagRepository; EntityTagRepository = entityTagRepository;
_tagDefinitionStore = tagDefinitionStore; TagDefinitionStore = tagDefinitionStore;
} }
public async Task<EntityTag> AddTagToEntityAsync( public virtual async Task<EntityTag> AddTagToEntityAsync(
[NotNull] Guid tagId, [NotNull] Guid tagId,
[NotNull] string entityType, [NotNull] string entityType,
[NotNull] string entityId, [NotNull] string entityId,
[CanBeNull] Guid? tenantId = null, [CanBeNull] Guid? tenantId = null,
CancellationToken cancellationToken = default) CancellationToken cancellationToken = default)
{ {
if (!await _tagDefinitionStore.IsDefinedAsync(entityType)) if (!await TagDefinitionStore.IsDefinedAsync(entityType))
{ {
throw new EntityNotTaggableException(entityType); throw new EntityNotTaggableException(entityType);
} }
var entityTag = new EntityTag(tagId, entityId, tenantId); var entityTag = new EntityTag(tagId, entityId, tenantId);
return await EntityTagRepository.InsertAsync(entityTag, cancellationToken: cancellationToken);
return await _entityTagRepository.InsertAsync(entityTag, cancellationToken: cancellationToken);
} }
public async Task RemoveTagFromEntityAsync( public virtual async Task RemoveTagFromEntityAsync(
[NotNull] Guid tagId, [NotNull] Guid tagId,
[NotNull] string entityType, [NotNull] string entityType,
[NotNull] string entityId, [NotNull] string entityId,
[CanBeNull] Guid? tenantId = null, [CanBeNull] Guid? tenantId = null,
CancellationToken cancellationToken = default) CancellationToken cancellationToken = default)
{ {
var entityTag = await _entityTagRepository.FindAsync(tagId, entityId, tenantId, cancellationToken); var entityTag = await EntityTagRepository.FindAsync(tagId, entityId, tenantId, cancellationToken);
await EntityTagRepository.DeleteAsync(entityTag, cancellationToken: cancellationToken);
await _entityTagRepository.DeleteAsync(entityTag);
} }
} }
} }

21
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/Tag.cs

@ -8,11 +8,13 @@ namespace Volo.CmsKit.Tags
{ {
public class Tag : FullAuditedAggregateRoot<Guid>, IMultiTenant public class Tag : FullAuditedAggregateRoot<Guid>, IMultiTenant
{ {
public string EntityType { get; set; } public virtual Guid? TenantId { get; set; }
public string Name { get; protected set; } [NotNull]
public virtual string EntityType { get; protected set; }
public Guid? TenantId { get; set; }
[NotNull]
public virtual string Name { get; protected set; }
protected Tag() protected Tag()
{ {
@ -24,14 +26,19 @@ namespace Volo.CmsKit.Tags
[NotNull] string name, [NotNull] string name,
Guid? tenantId = null) : base(id) Guid? tenantId = null) : base(id)
{ {
EntityType = Check.NotNullOrWhiteSpace(entityType, nameof(entityType), TagConsts.MaxEntityTypeLength); EntityType = Check.NotNullOrEmpty(entityType, nameof(entityType), TagConsts.MaxEntityTypeLength);
SetName(name); Name = Check.NotNullOrEmpty(name, nameof(name), TagConsts.MaxNameLength);
TenantId = tenantId; TenantId = tenantId;
} }
public void SetName(string name) public virtual void SetName(string name)
{ {
Name = Check.NotNullOrWhiteSpace(name, nameof(name), TagConsts.MaxNameLength); Name = Check.NotNullOrWhiteSpace(name, nameof(name), TagConsts.MaxNameLength);
} }
public virtual void SetEntityType(string entityType)
{
EntityType = Check.NotNullOrEmpty(entityType, nameof(entityType), TagConsts.MaxEntityTypeLength);
}
} }
} }

3
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/TagEntityTypeDefiniton.cs

@ -25,13 +25,12 @@ namespace Volo.CmsKit.Tags
[CanBeNull] string deletePolicy = null) : base(createPolicy, updatePolicy, deletePolicy) [CanBeNull] string deletePolicy = null) : base(createPolicy, updatePolicy, deletePolicy)
{ {
EntityType = Check.NotNullOrWhiteSpace(entityType, nameof(entityType)); EntityType = Check.NotNullOrWhiteSpace(entityType, nameof(entityType));
DisplayName = displayName; DisplayName = displayName;
} }
public bool Equals(TagEntityTypeDefiniton other) public bool Equals(TagEntityTypeDefiniton other)
{ {
return EntityType == other.EntityType; return EntityType == other?.EntityType;
} }
} }
} }

62
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/TagManager.cs

@ -1,35 +1,27 @@
using JetBrains.Annotations; using JetBrains.Annotations;
using Microsoft.Extensions.Options;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Domain.Services; using Volo.Abp.Domain.Services;
namespace Volo.CmsKit.Tags namespace Volo.CmsKit.Tags
{ {
public class TagManager : DomainService, ITagManager public class TagManager : DomainService, ITagManager
{ {
private readonly ITagRepository _tagRepository; protected ITagRepository TagRepository { get; }
private readonly ITagDefinitionStore _tagDefinitionStore; protected ITagDefinitionStore TagDefinitionStore { get; }
public TagManager( public TagManager(ITagRepository tagRepository, ITagDefinitionStore tagDefinitionStore)
ITagRepository tagRepository,
ITagDefinitionStore tagDefinitionStore)
{ {
_tagRepository = tagRepository; TagRepository = tagRepository;
_tagDefinitionStore = tagDefinitionStore; TagDefinitionStore = tagDefinitionStore;
} }
public async Task<Tag> GetOrAddAsync( public virtual async Task<Tag> GetOrAddAsync([NotNull] string entityType, [NotNull] string name,
[NotNull] string entityType, Guid? tenantId = null, CancellationToken cancellationToken = default)
[NotNull] string name,
Guid? tenantId = null,
CancellationToken cancellationToken = default)
{ {
var entity = await _tagRepository.FindAsync(entityType, name, tenantId, cancellationToken); var entity = await TagRepository.FindAsync(entityType, name, tenantId, cancellationToken);
if (entity == null) if (entity == null)
{ {
@ -39,53 +31,43 @@ namespace Volo.CmsKit.Tags
return entity; return entity;
} }
public async Task<Tag> InsertAsync( public virtual async Task<Tag> InsertAsync(Guid id, [NotNull] string entityType, [NotNull] string name,
Guid id, Guid? tenantId = null, CancellationToken cancellationToken = default)
[NotNull] string entityType,
[NotNull] string name,
Guid? tenantId = null,
CancellationToken cancellationToken = default)
{ {
if (await _tagRepository.AnyAsync(entityType, name, tenantId, cancellationToken)) if (!await TagDefinitionStore.IsDefinedAsync(entityType))
{ {
throw new TagAlreadyExistException(entityType, name); throw new EntityNotTaggableException(entityType);
} }
if (!await _tagDefinitionStore.IsDefinedAsync(entityType)) if (await TagRepository.AnyAsync(entityType, name, tenantId, cancellationToken))
{ {
throw new EntityNotTaggableException(entityType); throw new TagAlreadyExistException(entityType, name);
} }
return await _tagRepository.InsertAsync( return await TagRepository.InsertAsync(new Tag(id, entityType, name, tenantId),
new Tag(
id,
entityType,
name,
tenantId),
cancellationToken: cancellationToken); cancellationToken: cancellationToken);
} }
public async Task<Tag> UpdateAsync( public virtual async Task<Tag> UpdateAsync(Guid id, [NotNull] string name,
Guid id,
[NotNull] string name,
CancellationToken cancellationToken = default) CancellationToken cancellationToken = default)
{ {
var entity = await _tagRepository.GetAsync(id, cancellationToken: cancellationToken); var entity = await TagRepository.GetAsync(id, cancellationToken: cancellationToken);
if (name != entity.Name && if (name != entity.Name &&
await _tagRepository.AnyAsync(entity.EntityType, name, entity.TenantId, cancellationToken)) await TagRepository.AnyAsync(entity.EntityType, name, entity.TenantId, cancellationToken))
{ {
throw new TagAlreadyExistException(entity.EntityType, name); throw new TagAlreadyExistException(entity.EntityType, name);
} }
entity.SetName(name); entity.SetName(name);
return await _tagRepository.UpdateAsync(entity, cancellationToken: cancellationToken); return await TagRepository.UpdateAsync(entity, cancellationToken: cancellationToken);
} }
public Task<List<TagEntityTypeDefiniton>> GetTagDefinitionsAsync(CancellationToken cancellationToken = default) public virtual Task<List<TagEntityTypeDefiniton>> GetTagDefinitionsAsync(
CancellationToken cancellationToken = default)
{ {
return _tagDefinitionStore.GetTagEntityTypeDefinitionListAsync(); return TagDefinitionStore.GetTagEntityTypeDefinitionListAsync();
} }
} }
} }

8
modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Contents/EfCoreContentRepository.cs

@ -15,7 +15,7 @@ namespace Volo.CmsKit.Contents
{ {
} }
public Task<Content> GetAsync( public virtual Task<Content> GetAsync(
string entityType, string entityType,
string entityId, string entityId,
Guid? tenantId = null, Guid? tenantId = null,
@ -29,7 +29,7 @@ namespace Volo.CmsKit.Contents
); );
} }
public Task<Content> FindAsync( public virtual Task<Content> FindAsync(
string entityType, string entityType,
string entityId, string entityId,
Guid? tenantId = null, Guid? tenantId = null,
@ -43,7 +43,7 @@ namespace Volo.CmsKit.Contents
); );
} }
public Task DeleteAsync( public virtual Task DeleteAsync(
string entityType, string entityType,
string entityId, string entityId,
Guid? tenantId = null, Guid? tenantId = null,
@ -56,7 +56,7 @@ namespace Volo.CmsKit.Contents
cancellationToken: GetCancellationToken(cancellationToken)); cancellationToken: GetCancellationToken(cancellationToken));
} }
public async Task<bool> ExistsAsync( public virtual async Task<bool> ExistsAsync(
[NotNull] string entityType, [NotNull] string entityType,
[NotNull] string entityId, [NotNull] string entityId,
Guid? tenantId = null, Guid? tenantId = null,

25
modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Pages/EfCorePageRepository.cs

@ -17,13 +17,14 @@ namespace Volo.CmsKit.Pages
{ {
} }
public virtual async Task<int> GetCountAsync(string filter = null, CancellationToken cancellationToken = default) public virtual async Task<int> GetCountAsync(string filter = null,
CancellationToken cancellationToken = default)
{ {
return await (await GetDbSetAsync()).WhereIf( return await (await GetDbSetAsync()).WhereIf(
!filter.IsNullOrWhiteSpace(), !filter.IsNullOrWhiteSpace(),
x => x =>
x.Title.Contains(filter) x.Title.Contains(filter)
).CountAsync(GetCancellationToken(cancellationToken)); ).CountAsync(GetCancellationToken(cancellationToken));
} }
public virtual async Task<List<Page>> GetListAsync( public virtual async Task<List<Page>> GetListAsync(
@ -34,12 +35,12 @@ namespace Volo.CmsKit.Pages
CancellationToken cancellationToken = default) CancellationToken cancellationToken = default)
{ {
return await (await GetDbSetAsync()).WhereIf( return await (await GetDbSetAsync()).WhereIf(
!filter.IsNullOrWhiteSpace(), !filter.IsNullOrWhiteSpace(),
x => x =>
x.Title.Contains(filter)) x.Title.Contains(filter))
.OrderBy(sorting ?? nameof(Page.Title)) .OrderBy(sorting ?? nameof(Page.Title))
.PageBy(skipCount, maxResultCount) .PageBy(skipCount, maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken)); .ToListAsync(GetCancellationToken(cancellationToken));
} }
public virtual Task<Page> GetByUrlAsync(string url, CancellationToken cancellationToken = default) public virtual Task<Page> GetByUrlAsync(string url, CancellationToken cancellationToken = default)
@ -57,4 +58,4 @@ namespace Volo.CmsKit.Pages
return await (await GetDbSetAsync()).AnyAsync(x => x.Url == url, GetCancellationToken(cancellationToken)); return await (await GetDbSetAsync()).AnyAsync(x => x.Url == url, GetCancellationToken(cancellationToken));
} }
} }
} }

24
modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreEntityTagRepository.cs

@ -1,8 +1,6 @@
using JetBrains.Annotations; using JetBrains.Annotations;
using Nito.Disposables;
using System; using System;
using System.Linq; using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
@ -11,30 +9,32 @@ using Volo.CmsKit.EntityFrameworkCore;
namespace Volo.CmsKit.Tags namespace Volo.CmsKit.Tags
{ {
public class EfCoreEntityTagRepository: EfCoreRepository<ICmsKitDbContext, EntityTag>, IEntityTagRepository public class EfCoreEntityTagRepository : EfCoreRepository<ICmsKitDbContext, EntityTag>, IEntityTagRepository
{ {
public EfCoreEntityTagRepository(IDbContextProvider<ICmsKitDbContext> dbContextProvider) : base(dbContextProvider) public EfCoreEntityTagRepository(IDbContextProvider<ICmsKitDbContext> dbContextProvider) : base(
dbContextProvider)
{ {
} }
public async Task DeleteManyAsync(Guid[] tagIds, CancellationToken cancellationToken = default) public virtual async Task DeleteManyAsync(Guid[] tagIds, CancellationToken cancellationToken = default)
{ {
var dbSet = await GetDbSetAsync(); var dbContext = await GetDbContextAsync();
var dbSet = dbContext.Set<EntityTag>();
dbSet.RemoveRange(dbSet.Where(x => tagIds.Contains(x.TagId))); dbSet.RemoveRange(dbSet.Where(x => tagIds.Contains(x.TagId)));
await dbContext.SaveChangesAsync(GetCancellationToken(cancellationToken));
} }
public Task<EntityTag> FindAsync( public virtual Task<EntityTag> FindAsync(
[NotNull] Guid tagId, [NotNull] Guid tagId,
[NotNull] string entityId, [NotNull] string entityId,
[CanBeNull] Guid? tenantId, [CanBeNull] Guid? tenantId,
CancellationToken cancellationToken = default) CancellationToken cancellationToken = default)
{ {
return base.FindAsync(x => return base.FindAsync(x =>
x.TagId == tagId && x.TagId == tagId &&
x.EntityId == entityId && x.EntityId == entityId &&
x.TenantId == tenantId, x.TenantId == tenantId,
cancellationToken: cancellationToken); cancellationToken: cancellationToken);
} }
} }
} }

2
modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs

@ -5,10 +5,8 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.VirtualFileSystem;
using Volo.CmsKit.EntityFrameworkCore; using Volo.CmsKit.EntityFrameworkCore;
namespace Volo.CmsKit.Tags namespace Volo.CmsKit.Tags

8
modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Contents/MongoContentRepository.cs

@ -15,7 +15,7 @@ namespace Volo.CmsKit.MongoDB.Contents
{ {
} }
public Task<Content> GetAsync( public virtual Task<Content> GetAsync(
string entityType, string entityType,
string entityId, string entityId,
Guid? tenantId = null, Guid? tenantId = null,
@ -29,7 +29,7 @@ namespace Volo.CmsKit.MongoDB.Contents
); );
} }
public Task<Content> FindAsync( public virtual Task<Content> FindAsync(
string entityType, string entityType,
string entityId, string entityId,
Guid? tenantId = null, Guid? tenantId = null,
@ -43,7 +43,7 @@ namespace Volo.CmsKit.MongoDB.Contents
); );
} }
public Task DeleteAsync(string entityType, string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default) public virtual Task DeleteAsync(string entityType, string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default)
{ {
return DeleteAsync(x => return DeleteAsync(x =>
x.EntityType == entityType && x.EntityType == entityType &&
@ -52,7 +52,7 @@ namespace Volo.CmsKit.MongoDB.Contents
cancellationToken: GetCancellationToken(cancellationToken)); cancellationToken: GetCancellationToken(cancellationToken));
} }
public async Task<bool> ExistsAsync([NotNull] string entityType, [NotNull] string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default) public virtual async Task<bool> ExistsAsync([NotNull] string entityType, [NotNull] string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default)
{ {
return await (await GetMongoQueryableAsync(cancellationToken)).AnyAsync(x => return await (await GetMongoQueryableAsync(cancellationToken)).AnyAsync(x =>
x.EntityType == entityType && x.EntityType == entityType &&

2
modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/IPageAppService.cs → modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/IPagePublicAppService.cs

@ -3,7 +3,7 @@ using JetBrains.Annotations;
namespace Volo.CmsKit.Public.Pages namespace Volo.CmsKit.Public.Pages
{ {
public interface IPageAppService public interface IPagePublicAppService
{ {
Task<PageDto> FindByUrlAsync([NotNull] string url); Task<PageDto> FindByUrlAsync([NotNull] string url);
} }

6
modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Contents/ContentAppService.cs → modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Contents/ContentPublicAppService.cs

@ -3,11 +3,11 @@ using Volo.CmsKit.Contents;
namespace Volo.CmsKit.Public.Contents namespace Volo.CmsKit.Public.Contents
{ {
public class ContentAppService : CmsKitAppServiceBase, IContentAppService public class ContentPublicAppService : CmsKitAppServiceBase, IContentAppService
{ {
protected readonly IContentRepository ContentRepository; protected IContentRepository ContentRepository { get; }
public ContentAppService(IContentRepository contentRepository) public ContentPublicAppService(IContentRepository contentRepository)
{ {
ContentRepository = contentRepository; ContentRepository = contentRepository;
} }

27
modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PageAppService.cs

@ -1,27 +0,0 @@
using System.Threading.Tasks;
using Volo.CmsKit.Pages;
namespace Volo.CmsKit.Public.Pages
{
public class PageAppService : CmsKitPublicAppServiceBase, IPageAppService
{
protected readonly IPageRepository PageRepository;
public PageAppService(IPageRepository pageRepository)
{
PageRepository = pageRepository;
}
public virtual async Task<PageDto> FindByUrlAsync(string url)
{
var page = await PageRepository.FindByUrlAsync(url);
if (page == null)
{
return null;
}
return ObjectMapper.Map<Page, PageDto>(page);
}
}
}

28
modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs

@ -0,0 +1,28 @@
using System.Threading.Tasks;
using Volo.CmsKit.Pages;
namespace Volo.CmsKit.Public.Pages
{
public class PagePublicAppService : CmsKitPublicAppServiceBase, IPagePublicAppService
{
protected IPageRepository PageRepository { get; }
public PagePublicAppService(IPageRepository pageRepository)
{
PageRepository = pageRepository;
}
public virtual async Task<PageDto> FindByUrlAsync(string url)
{
PageDto pageDto = null;
var page = await PageRepository.FindByUrlAsync(url);
if (page !=null)
{
pageDto = ObjectMapper.Map<Page, PageDto>(page);
}
return pageDto;
}
}
}

13
modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Pages/PagesPublicController.cs

@ -1,24 +1,27 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.GlobalFeatures;
using Volo.CmsKit.GlobalFeatures;
namespace Volo.CmsKit.Public.Pages namespace Volo.CmsKit.Public.Pages
{ {
[RequiresGlobalFeature(typeof(PagesFeature))]
[RemoteService(Name = CmsKitPublicRemoteServiceConsts.RemoteServiceName)] [RemoteService(Name = CmsKitPublicRemoteServiceConsts.RemoteServiceName)]
[Area("cms-kit")] [Area("cms-kit")]
[Route("api/cms-kit-public/comments")] [Route("api/cms-kit-public/pages")]
public class PagesPublicController : IPageAppService public class PagesPublicController : IPagePublicAppService
{ {
protected readonly IPageAppService PageAppService; protected IPagePublicAppService PageAppService { get; }
public PagesPublicController(IPageAppService pageAppService) public PagesPublicController(IPagePublicAppService pageAppService)
{ {
PageAppService = pageAppService; PageAppService = pageAppService;
} }
[HttpGet] [HttpGet]
[Route("url/{url}")] [Route("url/{url}")]
public Task<PageDto> FindByUrlAsync(string url) public virtual Task<PageDto> FindByUrlAsync(string url)
{ {
return PageAppService.FindByUrlAsync(url); return PageAppService.FindByUrlAsync(url);
} }

4
modules/cms-kit/src/Volo.CmsKit.Public.Web/Controllers/PageController.cs

@ -14,9 +14,9 @@ namespace Volo.CmsKit.Public.Web.Controllers
[RequiresGlobalFeature(typeof(PagesFeature))] [RequiresGlobalFeature(typeof(PagesFeature))]
public class PageController : CmsKitPublicControllerBase public class PageController : CmsKitPublicControllerBase
{ {
protected IPageAppService PageAppService { get; } protected IPagePublicAppService PageAppService { get; }
public PageController(IPageAppService pageAppService) public PageController(IPagePublicAppService pageAppService)
{ {
PageAppService = pageAppService; PageAppService = pageAppService;
} }

4
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/DefaultPageViewComponent.cs

@ -9,9 +9,9 @@ namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages
[ViewComponent(Name = "CmsDefaultPage")] [ViewComponent(Name = "CmsDefaultPage")]
public class DefaultPageViewComponent : AbpViewComponent public class DefaultPageViewComponent : AbpViewComponent
{ {
protected readonly IPageAppService PageAppService; protected readonly IPagePublicAppService PageAppService;
public DefaultPageViewComponent(IPageAppService pageAppService) public DefaultPageViewComponent(IPagePublicAppService pageAppService)
{ {
PageAppService = pageAppService; PageAppService = pageAppService;
} }

4
modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PagePublicAppService_Tests.cs

@ -9,12 +9,12 @@ namespace Volo.CmsKit.Pages
public class PagePublicAppService_Tests : CmsKitApplicationTestBase public class PagePublicAppService_Tests : CmsKitApplicationTestBase
{ {
private readonly CmsKitTestData _data; private readonly CmsKitTestData _data;
private readonly IPageAppService _pageAppService; private readonly IPagePublicAppService _pageAppService;
public PagePublicAppService_Tests() public PagePublicAppService_Tests()
{ {
_data = GetRequiredService<CmsKitTestData>(); _data = GetRequiredService<CmsKitTestData>();
_pageAppService = GetRequiredService<IPageAppService>(); _pageAppService = GetRequiredService<IPagePublicAppService>();
} }
[Fact] [Fact]

9
modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml

@ -44,14 +44,13 @@
var disabled = Model.IsDisabled(feature.Provider.Name); var disabled = Model.IsDisabled(feature.Provider.Name);
<div class="mt-2"> <div class="mt-2">
<input type="text" name="FeatureGroups[@i].Features[@j].ProviderName" value="@feature.Provider.Name" hidden/> <input type="text" abp-id-name="@Model.FeatureGroups[i].Features[j].Type" value="@feature.ValueType?.Name" hidden/>
<input type="text" name="FeatureGroups[@i].Features[@j].Type" value="@feature.ValueType?.Name" hidden/>
@if (feature.ValueType is ToggleStringValueType) @if (feature.ValueType is ToggleStringValueType)
{ {
<abp-input asp-for="@feature.Value" <abp-input asp-for="@feature.Value"
type="checkbox" type="checkbox"
name="FeatureGroups[@i].Features[@j].BoolValue" abp-id-name="@Model.FeatureGroups[i].Features[j].BoolValue"
label="@feature.DisplayName" label="@feature.DisplayName"
disabled="@disabled" disabled="@disabled"
group-data-feature-name="@feature.Name" group-data-feature-name="@feature.Name"
@ -70,7 +69,7 @@
<abp-input asp-for="@feature.Value" <abp-input asp-for="@feature.Value"
label="@feature.DisplayName" label="@feature.DisplayName"
name="featureGroups[@i].Features[@j].Value" abp-id-name="@Model.FeatureGroups[i].Features[j].Value"
disabled="@disabled" disabled="@disabled"
type="@type" type="@type"
group-data-feature-name="@feature.Name" group-data-feature-name="@feature.Name"
@ -99,7 +98,7 @@
</div> </div>
} }
<input value="@feature.Name" name="FeatureGroups[@i].Features[@j].Name" hidden=""/> <input value="@feature.Name" abp-id-name="@Model.FeatureGroups[i].Features[j].Name" hidden/>
</div> </div>
} }
</div> </div>

7
modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs

@ -75,13 +75,6 @@ namespace Volo.Abp.FeatureManagement.Web.Pages.FeatureManagement
return providerName != ProviderName && providerName != DefaultValueFeatureValueProvider.ProviderName; return providerName != ProviderName && providerName != DefaultValueFeatureValueProvider.ProviderName;
} }
public class ProviderInfoViewModel
{
public string ProviderName { get; set; }
public string ProviderKey { get; set; }
}
public class FeatureGroupViewModel public class FeatureGroupViewModel
{ {
public List<FeatureViewModel> Features { get; set; } public List<FeatureViewModel> Features { get; set; }

9
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDataSeedContributor.cs

@ -6,6 +6,11 @@ namespace Volo.Abp.Identity
{ {
public class IdentityDataSeedContributor : IDataSeedContributor, ITransientDependency public class IdentityDataSeedContributor : IDataSeedContributor, ITransientDependency
{ {
public const string AdminEmailPropertyName = "AdminEmail";
public const string AdminEmailDefaultValue = "admin@abp.io";
public const string AdminPasswordPropertyName = "AdminPassword";
public const string AdminPasswordDefaultValue = "1q2w3E*";
protected IIdentityDataSeeder IdentityDataSeeder { get; } protected IIdentityDataSeeder IdentityDataSeeder { get; }
public IdentityDataSeedContributor(IIdentityDataSeeder identityDataSeeder) public IdentityDataSeedContributor(IIdentityDataSeeder identityDataSeeder)
@ -16,8 +21,8 @@ namespace Volo.Abp.Identity
public virtual Task SeedAsync(DataSeedContext context) public virtual Task SeedAsync(DataSeedContext context)
{ {
return IdentityDataSeeder.SeedAsync( return IdentityDataSeeder.SeedAsync(
context?["AdminEmail"] as string ?? "admin@abp.io", context?[AdminEmailPropertyName] as string ?? AdminEmailDefaultValue,
context?["AdminPassword"] as string ?? "1q2w3E*", context?[AdminPasswordPropertyName] as string ?? AdminPasswordDefaultValue,
context?.TenantId context?.TenantId
); );
} }

2
modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/AbpIdentityServerMongoDbContext.cs

@ -7,9 +7,11 @@ using Volo.Abp.IdentityServer.Devices;
using Volo.Abp.IdentityServer.Grants; using Volo.Abp.IdentityServer.Grants;
using Volo.Abp.IdentityServer.IdentityResources; using Volo.Abp.IdentityServer.IdentityResources;
using Volo.Abp.MongoDB; using Volo.Abp.MongoDB;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.IdentityServer.MongoDB namespace Volo.Abp.IdentityServer.MongoDB
{ {
[IgnoreMultiTenancy]
[ConnectionStringName(AbpIdentityServerDbProperties.ConnectionStringName)] [ConnectionStringName(AbpIdentityServerDbProperties.ConnectionStringName)]
public class AbpIdentityServerMongoDbContext : AbpMongoDbContext, IAbpIdentityServerMongoDbContext public class AbpIdentityServerMongoDbContext : AbpMongoDbContext, IAbpIdentityServerMongoDbContext
{ {

2
modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/IAbpIdentityServerMongoDbContext.cs

@ -7,9 +7,11 @@ using Volo.Abp.IdentityServer.Devices;
using Volo.Abp.IdentityServer.Grants; using Volo.Abp.IdentityServer.Grants;
using Volo.Abp.IdentityServer.IdentityResources; using Volo.Abp.IdentityServer.IdentityResources;
using Volo.Abp.MongoDB; using Volo.Abp.MongoDB;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.IdentityServer.MongoDB namespace Volo.Abp.IdentityServer.MongoDB
{ {
[IgnoreMultiTenancy]
[ConnectionStringName(AbpIdentityServerDbProperties.ConnectionStringName)] [ConnectionStringName(AbpIdentityServerDbProperties.ConnectionStringName)]
public interface IAbpIdentityServerMongoDbContext : IAbpMongoDbContext public interface IAbpIdentityServerMongoDbContext : IAbpMongoDbContext
{ {

2
modules/setting-management/src/Volo.Abp.SettingManagement.Application.Contracts/Volo/Abp/SettingManagement/SettingManagementPermissionDefinitionProvider.cs

@ -10,7 +10,7 @@ namespace Volo.Abp.SettingManagement
public override void Define(IPermissionDefinitionContext context) public override void Define(IPermissionDefinitionContext context)
{ {
var moduleGroup = context.AddGroup(SettingManagementPermissions.GroupName, L("Permission:SettingManagement")); var moduleGroup = context.AddGroup(SettingManagementPermissions.GroupName, L("Permission:SettingManagement"));
moduleGroup.AddPermission(SettingManagementPermissions.EmailSettingManagement, L("Permission:EmailSettingManagement"), multiTenancySide: MultiTenancySides.Host); moduleGroup.AddPermission(SettingManagementPermissions.EmailSetting, L("Permission:EmailSetting"), multiTenancySide: MultiTenancySides.Host);
} }
private static LocalizableString L(string name) private static LocalizableString L(string name)

2
modules/setting-management/src/Volo.Abp.SettingManagement.Application.Contracts/Volo/Abp/SettingManagement/SettingManagementPermissions.cs

@ -6,7 +6,7 @@ namespace Volo.Abp.SettingManagement
{ {
public const string GroupName = "SettingManagement"; public const string GroupName = "SettingManagement";
public const string EmailSettingManagement = GroupName + ".EmailSettingManagement"; public const string EmailSetting = GroupName + ".EmailSetting";
public static string[] GetAll() public static string[] GetAll()
{ {

2
modules/setting-management/src/Volo.Abp.SettingManagement.Application/Volo/Abp/SettingManagement/EmailSettingsAppService.cs

@ -5,7 +5,7 @@ using Volo.Abp.Emailing;
namespace Volo.Abp.SettingManagement namespace Volo.Abp.SettingManagement
{ {
[Authorize(SettingManagementPermissions.EmailSettingManagement)] [Authorize(SettingManagementPermissions.EmailSetting)]
public class EmailSettingsAppService : SettingManagementAppServiceBase, IEmailSettingsAppService public class EmailSettingsAppService : SettingManagementAppServiceBase, IEmailSettingsAppService
{ {
protected ISettingManager SettingManager { get; } protected ISettingManager SettingManager { get; }

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

@ -36,7 +36,7 @@ namespace Volo.Abp.SettingManagement.Blazor
Configure<SettingManagementComponentOptions>(options => Configure<SettingManagementComponentOptions>(options =>
{ {
options.Contributors.Add(new EmailSettingManagementPageContributor()); options.Contributors.Add(new EmailSettingPageContributor());
}); });
} }
} }

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

@ -35,7 +35,7 @@ namespace Volo.Abp.SettingManagement.Blazor.Pages.SettingManagement.EmailSetting
{ {
await EmailSettingsAppService.UpdateAsync(ObjectMapper.Map<EmailSettingsDto, UpdateEmailSettingsDto>(EmailSettings)); await EmailSettingsAppService.UpdateAsync(ObjectMapper.Map<EmailSettingsDto, UpdateEmailSettingsDto>(EmailSettings));
await UiMessageService.Success(L["SavedSuccessfully"]); await UiMessageService.Success(L["SuccessfullySaved"]);
} }
} }
} }

6
modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Settings/EmailSettingManagementPageContributor.cs → modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Settings/EmailSettingPageContributor.cs

@ -7,7 +7,7 @@ using Volo.Abp.SettingManagement.Localization;
namespace Volo.Abp.SettingManagement.Blazor.Settings namespace Volo.Abp.SettingManagement.Blazor.Settings
{ {
public class EmailSettingManagementPageContributor: ISettingComponentContributor public class EmailSettingPageContributor: ISettingComponentContributor
{ {
public async Task ConfigureAsync(SettingComponentCreationContext context) public async Task ConfigureAsync(SettingComponentCreationContext context)
{ {
@ -20,7 +20,7 @@ namespace Volo.Abp.SettingManagement.Blazor.Settings
context.Groups.Add( context.Groups.Add(
new SettingComponentGroup( new SettingComponentGroup(
"Volo.Abp.SettingManagement", "Volo.Abp.SettingManagement",
l["Menu:EmailSettingManagement"], l["Menu:EmailSetting"],
typeof(EmailSettingGroupViewComponent) typeof(EmailSettingGroupViewComponent)
) )
); );
@ -35,7 +35,7 @@ namespace Volo.Abp.SettingManagement.Blazor.Settings
{ {
var authorizationService = context.ServiceProvider.GetRequiredService<IAuthorizationService>(); var authorizationService = context.ServiceProvider.GetRequiredService<IAuthorizationService>();
return await authorizationService.IsGrantedAsync(SettingManagementPermissions.EmailSettingManagement); return await authorizationService.IsGrantedAsync(SettingManagementPermissions.EmailSetting);
} }
} }
} }

4
modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/de-DE.json

@ -4,8 +4,8 @@
"Settings": "Einstellungen", "Settings": "Einstellungen",
"SuccessfullySaved": "Erfolgreich gespeichert", "SuccessfullySaved": "Erfolgreich gespeichert",
"Permission:SettingManagement": "Einstellungen-Verwaltung", "Permission:SettingManagement": "Einstellungen-Verwaltung",
"Permission:EmailSettingManagement": "E-Mail-Einstellungen", "Permission:EmailSetting": "E-Mail-Einstellungen",
"Menu:EmailSettingManagement": "E-Mail-Verwaltung", "Menu:EmailSetting": "E-Mail-Einstellung",
"SmtpHost": "Host", "SmtpHost": "Host",
"SmtpPort": "Port", "SmtpPort": "Port",
"SmtpUserName": "Benutzername", "SmtpUserName": "Benutzername",

4
modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/en.json

@ -4,8 +4,8 @@
"Settings": "Settings", "Settings": "Settings",
"SuccessfullySaved": "Successfully saved", "SuccessfullySaved": "Successfully saved",
"Permission:SettingManagement": "Setting Management", "Permission:SettingManagement": "Setting Management",
"Permission:EmailSettingManagement": "Email Settings", "Permission:EmailSetting": "Email Setting",
"Menu:EmailSettingManagement": "Email management", "Menu:EmailSetting": "Email Setting",
"SmtpHost": "Host", "SmtpHost": "Host",
"SmtpPort": "Port", "SmtpPort": "Port",
"SmtpUserName": "User name", "SmtpUserName": "User name",

4
modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/es.json

@ -4,8 +4,8 @@
"Settings": "Configuraciones", "Settings": "Configuraciones",
"SuccessfullySaved": "Guardado correctamente", "SuccessfullySaved": "Guardado correctamente",
"Permission:SettingManagement": "Configuraciones de correo electronico", "Permission:SettingManagement": "Configuraciones de correo electronico",
"Permission:EmailSettingManagement": "Administración Configuraciones", "Permission:EmailSetting": "Configuración de correo electrónico",
"Menu:EmailSettingManagement": "Administración de correo electronico", "Menu:EmailSetting": "Configuración de correo electrónico",
"SmtpHost": "Host", "SmtpHost": "Host",
"SmtpPort": "Puerto", "SmtpPort": "Puerto",
"SmtpUserName": "Nombre de usuario", "SmtpUserName": "Nombre de usuario",

4
modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/tr.json

@ -4,8 +4,8 @@
"Settings": "Ayarlar", "Settings": "Ayarlar",
"SuccessfullySaved": "Başarıyla Kaydedildi", "SuccessfullySaved": "Başarıyla Kaydedildi",
"Permission:SettingManagement": "Ayarlar yönetimi", "Permission:SettingManagement": "Ayarlar yönetimi",
"Permission:EmailSettingManagement": "Email Ayarlar", "Permission:EmailSetting": "Email Ayarlar",
"Menu:EmailSettingManagement": "Email yönetimi", "Menu:EmailSetting": "Email Ayarlar",
"SmtpHost": "Sunucu", "SmtpHost": "Sunucu",
"SmtpPort": "Port", "SmtpPort": "Port",
"SmtpUserName": "Kullanıcı adı", "SmtpUserName": "Kullanıcı adı",

4
modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/zh-Hans.json

@ -4,8 +4,8 @@
"Settings": "设置", "Settings": "设置",
"SuccessfullySaved": "保存成功", "SuccessfullySaved": "保存成功",
"Permission:SettingManagement": "设置管理", "Permission:SettingManagement": "设置管理",
"Permission:EmailSettingManagement": "邮件设置", "Permission:EmailSetting": "邮件设置",
"Menu:EmailSettingManagement": "邮件管理", "Menu:EmailSetting": "邮件设置",
"SmtpHost": "主机", "SmtpHost": "主机",
"SmtpPort": "端口", "SmtpPort": "端口",
"SmtpUserName": "用户名", "SmtpUserName": "用户名",

2
modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs

@ -34,7 +34,7 @@ namespace Volo.Abp.SettingManagement.Web
Configure<SettingManagementPageOptions>(options => Configure<SettingManagementPageOptions>(options =>
{ {
options.Contributors.Add(new EmailSettingManagementPageContributor()); options.Contributors.Add(new EmailSettingPageContributor());
}); });
Configure<AbpVirtualFileSystemOptions>(options => Configure<AbpVirtualFileSystemOptions>(options =>

8
modules/setting-management/src/Volo.Abp.SettingManagement.Web/Settings/EmailSettingManagementPageContributor.cs → modules/setting-management/src/Volo.Abp.SettingManagement.Web/Settings/EmailSettingPageContributor.cs

@ -8,7 +8,7 @@ using Volo.Abp.SettingManagement.Web.Pages.SettingManagement.Components.EmailSet
namespace Volo.Abp.SettingManagement.Web.Settings namespace Volo.Abp.SettingManagement.Web.Settings
{ {
public class EmailSettingManagementPageContributor: ISettingPageContributor public class EmailSettingPageContributor: ISettingPageContributor
{ {
public async Task ConfigureAsync(SettingPageCreationContext context) public async Task ConfigureAsync(SettingPageCreationContext context)
{ {
@ -20,8 +20,8 @@ namespace Volo.Abp.SettingManagement.Web.Settings
var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<AbpSettingManagementResource>>(); var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<AbpSettingManagementResource>>();
context.Groups.Add( context.Groups.Add(
new SettingPageGroup( new SettingPageGroup(
"Volo.Abp.SettingManagement", "Volo.Abp.EmailSetting",
l["Menu:EmailSettingManagement"], l["Menu:EmailSetting"],
typeof(EmailSettingGroupViewComponent) typeof(EmailSettingGroupViewComponent)
) )
); );
@ -36,7 +36,7 @@ namespace Volo.Abp.SettingManagement.Web.Settings
{ {
var authorizationService = context.ServiceProvider.GetRequiredService<IAuthorizationService>(); var authorizationService = context.ServiceProvider.GetRequiredService<IAuthorizationService>();
return await authorizationService.IsGrantedAsync(SettingManagementPermissions.EmailSettingManagement); return await authorizationService.IsGrantedAsync(SettingManagementPermissions.EmailSetting);
} }
} }
} }

2
nupkg/common.ps1

@ -86,7 +86,7 @@ $projects = (
"framework/src/Volo.Abp.Emailing", "framework/src/Volo.Abp.Emailing",
"framework/src/Volo.Abp.EntityFrameworkCore", "framework/src/Volo.Abp.EntityFrameworkCore",
"framework/src/Volo.Abp.EntityFrameworkCore.MySQL", "framework/src/Volo.Abp.EntityFrameworkCore.MySQL",
# "framework/src/Volo.Abp.EntityFrameworkCore.Oracle", "framework/src/Volo.Abp.EntityFrameworkCore.Oracle",
"framework/src/Volo.Abp.EntityFrameworkCore.Oracle.Devart", "framework/src/Volo.Abp.EntityFrameworkCore.Oracle.Devart",
"framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql", "framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql",
"framework/src/Volo.Abp.EntityFrameworkCore.Sqlite", "framework/src/Volo.Abp.EntityFrameworkCore.Sqlite",

6
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/Data/MyProjectNameDbMigrationService.cs

@ -9,6 +9,7 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.Data; using Volo.Abp.Data;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Identity;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
using Volo.Abp.TenantManagement; using Volo.Abp.TenantManagement;
@ -105,7 +106,10 @@ namespace MyCompanyName.MyProjectName.Data
{ {
Logger.LogInformation($"Executing {(tenant == null ? "host" : tenant.Name + " tenant")} database seed..."); Logger.LogInformation($"Executing {(tenant == null ? "host" : tenant.Name + " tenant")} database seed...");
await _dataSeeder.SeedAsync(tenant?.Id); await _dataSeeder.SeedAsync(new DataSeedContext(tenant?.Id)
.WithProperty(IdentityDataSeedContributor.AdminEmailPropertyName, IdentityDataSeedContributor.AdminEmailDefaultValue)
.WithProperty(IdentityDataSeedContributor.AdminPasswordPropertyName, IdentityDataSeedContributor.AdminPasswordDefaultValue)
);
} }
private bool DbMigrationsProjectExists() private bool DbMigrationsProjectExists()

1
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs

@ -215,6 +215,7 @@ namespace MyCompanyName.MyProjectName
var configuration = context.GetConfiguration(); var configuration = context.GetConfiguration();
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]); options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
options.OAuthScopes("MyProjectName");
}); });
app.UseAuditing(); app.UseAuditing();

11
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json

@ -16,16 +16,5 @@
}, },
"StringEncryption": { "StringEncryption": {
"DefaultPassPhrase": "gsKnGZ041HLL4IM8" "DefaultPassPhrase": "gsKnGZ041HLL4IM8"
},
"Settings": {
"Abp.Mailing.Smtp.Host": "127.0.0.1",
"Abp.Mailing.Smtp.Port": "25",
"Abp.Mailing.Smtp.UserName": "",
"Abp.Mailing.Smtp.Password": "",
"Abp.Mailing.Smtp.Domain": "",
"Abp.Mailing.Smtp.EnableSsl": "false",
"Abp.Mailing.Smtp.UseDefaultCredentials": "true",
"Abp.Mailing.DefaultFromAddress": "noreply@abp.io",
"Abp.Mailing.DefaultFromDisplayName": "ABP application"
} }
} }

1
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyCompanyName.MyProjectName.HttpApi.HostWithIds.csproj

@ -12,7 +12,6 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" /> <PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" /> <PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.MultiTenancy\Volo.Abp.AspNetCore.MultiTenancy.csproj" /> <ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.MultiTenancy\Volo.Abp.AspNetCore.MultiTenancy.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" /> <ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" /> <ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />

1
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs

@ -227,6 +227,7 @@ namespace MyCompanyName.MyProjectName
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>(); var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
c.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); c.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
c.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]); c.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
c.OAuthScopes("MyProjectName");
}); });
app.UseAuditing(); app.UseAuditing();

11
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json

@ -15,16 +15,5 @@
}, },
"StringEncryption": { "StringEncryption": {
"DefaultPassPhrase": "gsKnGZ041HLL4IM8" "DefaultPassPhrase": "gsKnGZ041HLL4IM8"
},
"Settings": {
"Abp.Mailing.Smtp.Host": "127.0.0.1",
"Abp.Mailing.Smtp.Port": "25",
"Abp.Mailing.Smtp.UserName": "",
"Abp.Mailing.Smtp.Password": "",
"Abp.Mailing.Smtp.Domain": "",
"Abp.Mailing.Smtp.EnableSsl": "false",
"Abp.Mailing.Smtp.UseDefaultCredentials": "true",
"Abp.Mailing.DefaultFromAddress": "noreply@abp.io",
"Abp.Mailing.DefaultFromDisplayName": "ABP application"
} }
} }

11
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/appsettings.json

@ -12,16 +12,5 @@
}, },
"StringEncryption": { "StringEncryption": {
"DefaultPassPhrase": "gsKnGZ041HLL4IM8" "DefaultPassPhrase": "gsKnGZ041HLL4IM8"
},
"Settings": {
"Abp.Mailing.Smtp.Host": "127.0.0.1",
"Abp.Mailing.Smtp.Port": "25",
"Abp.Mailing.Smtp.UserName": "",
"Abp.Mailing.Smtp.Password": "",
"Abp.Mailing.Smtp.Domain": "",
"Abp.Mailing.Smtp.EnableSsl": "false",
"Abp.Mailing.Smtp.UseDefaultCredentials": "true",
"Abp.Mailing.DefaultFromAddress": "noreply@abp.io",
"Abp.Mailing.DefaultFromDisplayName": "ABP application"
} }
} }

11
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/appsettings.json

@ -11,16 +11,5 @@
}, },
"StringEncryption": { "StringEncryption": {
"DefaultPassPhrase": "gsKnGZ041HLL4IM8" "DefaultPassPhrase": "gsKnGZ041HLL4IM8"
},
"Settings": {
"Abp.Mailing.Smtp.Host": "127.0.0.1",
"Abp.Mailing.Smtp.Port": "25",
"Abp.Mailing.Smtp.UserName": "",
"Abp.Mailing.Smtp.Password": "",
"Abp.Mailing.Smtp.Domain": "",
"Abp.Mailing.Smtp.EnableSsl": "false",
"Abp.Mailing.Smtp.UseDefaultCredentials": "true",
"Abp.Mailing.DefaultFromAddress": "noreply@abp.io",
"Abp.Mailing.DefaultFromDisplayName": "ABP application"
} }
} }

1
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs

@ -182,6 +182,7 @@ namespace MyCompanyName.MyProjectName
var configuration = context.GetConfiguration(); var configuration = context.GetConfiguration();
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]); options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
options.OAuthScopes("MyProjectName");
}); });
app.UseAuditing(); app.UseAuditing();
app.UseAbpSerilogEnrichers(); app.UseAbpSerilogEnrichers();

1
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyCompanyName.MyProjectName.Web.Unified.csproj

@ -12,7 +12,6 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" /> <PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" /> <PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.*"> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.*">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>

Loading…
Cancel
Save