Browse Source

Merge branch 'dev' into studio-dev

pull/10363/head
Yunus Emre Kalkan 5 years ago
parent
commit
9ed6a89dc9
  1. 3
      abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/en-GB.json
  2. 3
      abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/en.json
  3. 3
      abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/tr.json
  4. 7
      framework/Volo.Abp.sln
  5. 6
      framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/AbpRabbitMqBackgroundJobOptions.cs
  6. 22
      framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs
  7. 35
      framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueConfiguration.cs
  8. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ProjectNameValidator.cs
  9. 34
      framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/AbpIdentityClientOptions.cs
  10. 14
      framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs
  11. 5
      framework/test/Volo.Abp.Cli.Core.Tests/Volo/Abp/Cli/ProjectNameValidation_Tests.cs
  12. 24
      framework/test/Volo.Abp.IdentityModel.Tests/Volo.Abp.IdentityModel.Tests.csproj
  13. 51
      framework/test/Volo.Abp.IdentityModel.Tests/Volo/Abp/IdentityModel/AbpIdentityClientOptions_Tests.cs
  14. 12
      framework/test/Volo.Abp.IdentityModel.Tests/Volo/Abp/IdentityModel/AbpIdentityModelTestBase.cs
  15. 10
      framework/test/Volo.Abp.IdentityModel.Tests/Volo/Abp/IdentityModel/AbpIdentityModelTestModule.cs
  16. 40
      framework/test/Volo.Abp.IdentityModel.Tests/appsettings.json
  17. 22
      modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingDbContextModelBuilderExtensions.cs
  18. 18
      modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingModelBuilderConfigurationOptions.cs
  19. 14
      modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbContextExtensions.cs
  20. 14
      modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AuditLoggingMongoModelBuilderConfigurationOptions.cs
  21. 12
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs
  22. 18
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsModelBuilderConfigurationOptions.cs
  23. 16
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContextExtensions.cs
  24. 14
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoModelBuilderConfigurationOptions.cs
  25. 15
      modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContextModelCreatingExtensions.cs
  26. 18
      modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringModelBuilderConfigurationOptions.cs
  27. 18
      modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContextExtensions.cs
  28. 14
      modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoModelBuilderConfigurationOptions.cs
  29. 25
      modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs
  30. 15
      modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingModelBuilderConfigurationOptions.cs
  31. 22
      modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContextExtensions.cs
  32. 14
      modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoModelBuilderConfigurationOptions.cs
  33. 35
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs
  34. 18
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitModelBuilderConfigurationOptions.cs
  35. 12
      modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs
  36. 14
      modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoModelBuilderConfigurationOptions.cs
  37. 19
      modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs
  38. 15
      modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsModelBuilderConfigurationOptions.cs
  39. 16
      modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoDbContextExtensions.cs
  40. 14
      modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoModelBuilderConfigurationOptions.cs
  41. 12
      modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContextModelCreatingExtensions.cs
  42. 18
      modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementModelBuilderConfigurationOptions.cs
  43. 14
      modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoDbContextExtensions.cs
  44. 15
      modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoModelBuilderConfigurationOptions.cs
  45. 83
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs
  46. 23
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerModelBuilderConfigurationOptions.cs
  47. 24
      modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/AbpIdentityServerMongoDbContextExtensions.cs
  48. 13
      modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/IdentityServerMongoModelBuilderConfigurationOptions.cs
  49. 15
      modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementDbContextModelBuilderExtensions.cs
  50. 18
      modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementModelBuilderConfigurationOptions.cs
  51. 14
      modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbContextExtensions.cs
  52. 14
      modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/PermissionManagementMongoModelBuilderConfigurationOptions.cs
  53. 28
      modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContextModelBuilderExtensions.cs
  54. 12
      modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoDbContextExtensions.cs
  55. 14
      modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoModelBuilderConfigurationOptions.cs
  56. 15
      modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementDbContextModelCreatingExtensions.cs
  57. 18
      modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementModelBuilderConfigurationOptions.cs
  58. 14
      modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbContextExtensions.cs
  59. 14
      modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/TenantManagementMongoModelBuilderConfigurationOptions.cs
  60. 2
      npm/ng-packs/apps/dev-app-e2e/tsconfig.json
  61. 2
      npm/ng-packs/apps/dev-app/tsconfig.json
  62. 2
      npm/ng-packs/package.json
  63. 2
      npm/ng-packs/packages/account-core/tsconfig.json
  64. 2
      npm/ng-packs/packages/account/tsconfig.json
  65. 7
      npm/ng-packs/packages/components/chart.js/ng-package.json
  66. 56
      npm/ng-packs/packages/components/chart.js/src/chart.component.spec.ts
  67. 149
      npm/ng-packs/packages/components/chart.js/src/chart.component.ts
  68. 11
      npm/ng-packs/packages/components/chart.js/src/chart.module.ts
  69. 4
      npm/ng-packs/packages/components/chart.js/src/public-api.ts
  70. 4
      npm/ng-packs/packages/components/chart.js/src/widget-utils.ts
  71. 2
      npm/ng-packs/packages/components/ng-package.json
  72. 1
      npm/ng-packs/packages/components/package.json
  73. 2
      npm/ng-packs/packages/components/src/test-setup.ts
  74. 2
      npm/ng-packs/packages/components/tsconfig.json
  75. 2
      npm/ng-packs/packages/core/src/lib/core.module.ts
  76. 23
      npm/ng-packs/packages/core/src/lib/providers/cookie-language.provider.ts
  77. 1
      npm/ng-packs/packages/core/src/lib/providers/index.ts
  78. 5
      npm/ng-packs/packages/core/src/lib/tokens/cookie-language-key.token.ts
  79. 3
      npm/ng-packs/packages/core/src/lib/tokens/index.ts
  80. 2
      npm/ng-packs/packages/core/tsconfig.json
  81. 2
      npm/ng-packs/packages/feature-management/tsconfig.json
  82. 2
      npm/ng-packs/packages/identity/tsconfig.json
  83. 2
      npm/ng-packs/packages/permission-management/tsconfig.json
  84. 4
      npm/ng-packs/packages/schematics/src/utils/angular/tsconfig.ts
  85. 2
      npm/ng-packs/packages/setting-management/tsconfig.json
  86. 2
      npm/ng-packs/packages/tenant-management/tsconfig.json
  87. 2
      npm/ng-packs/packages/theme-basic/tsconfig.json
  88. 3
      npm/ng-packs/packages/theme-shared/ng-package.json
  89. 1
      npm/ng-packs/packages/theme-shared/package.json
  90. 11
      npm/ng-packs/packages/theme-shared/src/lib/components/chart/chart.component.html
  91. 141
      npm/ng-packs/packages/theme-shared/src/lib/components/chart/chart.component.ts
  92. 3
      npm/ng-packs/packages/theme-shared/src/lib/components/index.ts
  93. 14
      npm/ng-packs/packages/theme-shared/src/lib/tests/append-content.token.spec.ts
  94. 2
      npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts
  95. 3
      npm/ng-packs/packages/theme-shared/src/lib/tokens/append-content.token.ts
  96. 1
      npm/ng-packs/packages/theme-shared/src/lib/utils/index.ts
  97. 2
      npm/ng-packs/packages/theme-shared/src/test-setup.ts
  98. 2
      npm/ng-packs/packages/theme-shared/tsconfig.json
  99. 1
      npm/ng-packs/tsconfig.json
  100. 1084
      npm/ng-packs/yarn.lock

3
abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/en-GB.json

@ -9,6 +9,7 @@
"OfficialBlog": "Official blog",
"CommercialHomePage": "Commercial home page",
"CommercialSupportWebSite": "Commercial support web site",
"CommunityWebSite": "ABP community web site"
"CommunityWebSite": "ABP community web site",
"ManageAccount": "My Account | ABP.IO"
}
}

3
abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/en.json

@ -9,6 +9,7 @@
"OfficialBlog": "Official blog",
"CommercialHomePage": "Commercial home page",
"CommercialSupportWebSite": "Commercial support web site",
"CommunityWebSite": "ABP community web site"
"CommunityWebSite": "ABP community web site",
"ManageAccount": "My Account | ABP.IO"
}
}

3
abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/tr.json

@ -9,6 +9,7 @@
"OfficialBlog": "Resmi blog",
"CommercialHomePage": "Kurumsal ana sayfa",
"CommercialSupportWebSite": "Kurumsal destek web sitesi",
"CommunityWebSite": "ABP topluluk web sitesi"
"CommunityWebSite": "ABP topluluk web sitesi",
"ManageAccount": "Hesabım | ABP.IO"
}
}

7
framework/Volo.Abp.sln

@ -383,6 +383,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.TextTemplating.Scr
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.MongoDB.Tests.SecondContext", "test\Volo.Abp.MongoDB.Tests.SecondContext\Volo.Abp.MongoDB.Tests.SecondContext.csproj", "{90B1866A-EF99-40B9-970E-B898E5AA523F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.IdentityModel.Tests", "test\Volo.Abp.IdentityModel.Tests\Volo.Abp.IdentityModel.Tests.csproj", "{40C6740E-BFCA-4D37-8344-3D84E2044BB2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Threading.Tests", "test\Volo.Abp.Threading.Tests\Volo.Abp.Threading.Tests.csproj", "{7B2FCAD6-86E6-49C8-ADBE-A61B4F4B101B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Auditing.Contracts", "src\Volo.Abp.Auditing.Contracts\Volo.Abp.Auditing.Contracts.csproj", "{508B6355-AD28-4E60-8549-266D21DBF2CF}"
@ -1145,6 +1147,10 @@ Global
{90B1866A-EF99-40B9-970E-B898E5AA523F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90B1866A-EF99-40B9-970E-B898E5AA523F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90B1866A-EF99-40B9-970E-B898E5AA523F}.Release|Any CPU.Build.0 = Release|Any CPU
{40C6740E-BFCA-4D37-8344-3D84E2044BB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{40C6740E-BFCA-4D37-8344-3D84E2044BB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{40C6740E-BFCA-4D37-8344-3D84E2044BB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{40C6740E-BFCA-4D37-8344-3D84E2044BB2}.Release|Any CPU.Build.0 = Release|Any CPU
{7B2FCAD6-86E6-49C8-ADBE-A61B4F4B101B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7B2FCAD6-86E6-49C8-ADBE-A61B4F4B101B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7B2FCAD6-86E6-49C8-ADBE-A61B4F4B101B}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -1346,6 +1352,7 @@ Global
{C996F458-98FB-483D-9306-4701290E2FC1} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{75D8DADB-3FA9-4C1D-B23A-DBFD08133B7C} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{90B1866A-EF99-40B9-970E-B898E5AA523F} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{40C6740E-BFCA-4D37-8344-3D84E2044BB2} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{7B2FCAD6-86E6-49C8-ADBE-A61B4F4B101B} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{508B6355-AD28-4E60-8549-266D21DBF2CF} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
EndGlobalSection

6
framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/AbpRabbitMqBackgroundJobOptions.cs

@ -15,10 +15,16 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
/// </summary>
public string DefaultQueueNamePrefix { get; set; }
/// <summary>
/// Default value: "AbpBackgroundJobsDelayed."
/// </summary>
public string DefaultDelayedQueueNamePrefix { get; set;}
public AbpRabbitMqBackgroundJobOptions()
{
JobQueues = new Dictionary<Type, JobQueueConfiguration>();
DefaultQueueNamePrefix = "AbpBackgroundJobs.";
DefaultDelayedQueueNamePrefix = "AbpBackgroundJobsDelayed.";
}
}
}

22
framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
@ -64,7 +65,8 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
return AbpRabbitMqBackgroundJobOptions.JobQueues.GetOrDefault(typeof(TArgs)) ??
new JobQueueConfiguration(
typeof(TArgs),
AbpRabbitMqBackgroundJobOptions.DefaultQueueNamePrefix + JobConfiguration.JobName
AbpRabbitMqBackgroundJobOptions.DefaultQueueNamePrefix + JobConfiguration.JobName,
AbpRabbitMqBackgroundJobOptions.DefaultDelayedQueueNamePrefix + JobConfiguration.JobName
);
}
@ -133,6 +135,9 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
var result = QueueConfiguration.Declare(ChannelAccessor.Channel);
Logger.LogDebug($"RabbitMQ Queue '{QueueConfiguration.QueueName}' has {result.MessageCount} messages and {result.ConsumerCount} consumers.");
// Declare delayed queue
QueueConfiguration.DeclareDelayed(ChannelAccessor.Channel);
if (AbpBackgroundJobOptions.IsJobExecutionEnabled)
{
Consumer = new AsyncEventingBasicConsumer(ChannelAccessor.Channel);
@ -154,12 +159,21 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
BackgroundJobPriority priority = BackgroundJobPriority.Normal,
TimeSpan? delay = null)
{
//TODO: How to handle priority & delay?
//TODO: How to handle priority
var routingKey = QueueConfiguration.QueueName;
var basicProperties = CreateBasicPropertiesToPublish();
if (delay.HasValue)
{
routingKey = QueueConfiguration.DelayedQueueName;
basicProperties.Expiration = delay.Value.TotalMilliseconds.ToString();
}
ChannelAccessor.Channel.BasicPublish(
exchange: "",
routingKey: QueueConfiguration.QueueName,
basicProperties: CreateBasicPropertiesToPublish(),
routingKey: routingKey,
basicProperties: basicProperties,
body: Serializer.Serialize(args)
);

35
framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueConfiguration.cs

@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using RabbitMQ.Client;
using Volo.Abp.RabbitMQ;
namespace Volo.Abp.BackgroundJobs.RabbitMQ
@ -9,21 +11,42 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
public string ConnectionName { get; set; }
public string DelayedQueueName { get; set; }
public JobQueueConfiguration(
Type jobArgsType,
string queueName,
Type jobArgsType,
string queueName,
string delayedQueueName,
string connectionName = null,
bool durable = true,
bool exclusive = false,
bool autoDelete = false)
: base(
queueName,
durable,
exclusive,
queueName,
durable,
exclusive,
autoDelete)
{
JobArgsType = jobArgsType;
ConnectionName = connectionName;
DelayedQueueName = delayedQueueName;
}
public virtual QueueDeclareOk DeclareDelayed(IModel channel)
{
var delayedArguments = new Dictionary<string, object>(Arguments)
{
["x-dead-letter-routing-key"] = QueueName,
["x-dead-letter-exchange"] = string.Empty
};
return channel.QueueDeclare(
queue: DelayedQueueName,
durable: Durable,
exclusive: Exclusive,
autoDelete: AutoDelete,
arguments: delayedArguments
);
}
}
}
}

2
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ProjectNameValidator.cs

@ -53,7 +53,7 @@ namespace Volo.Abp.Cli.Utils
{
foreach (var illegalKeyword in IllegalKeywords)
{
if (projectName.Contains(illegalKeyword))
if (projectName.Split(".").Contains(illegalKeyword))
{
throw new CliUsageException("Project name cannot contain the word \"" + illegalKeyword + "\". Specify a different name.");
}

34
framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/AbpIdentityClientOptions.cs

@ -1,4 +1,9 @@
namespace Volo.Abp.IdentityModel
using System;
using System.Collections.Generic;
using System.Linq;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.IdentityModel
{
public class AbpIdentityClientOptions
{
@ -8,5 +13,30 @@
{
IdentityClients = new IdentityClientConfigurationDictionary();
}
public IdentityClientConfiguration GetClientConfiguration(ICurrentTenant currentTenant, string identityClientName = null)
{
if (identityClientName.IsNullOrWhiteSpace())
{
identityClientName = IdentityClientConfigurationDictionary.DefaultName;
}
if (currentTenant.Id.HasValue)
{
var tenantConfiguration = IdentityClients.FirstOrDefault(x => x.Key == $"{identityClientName}.{currentTenant.Id}");
if (tenantConfiguration.Key == null && !currentTenant.Name.IsNullOrWhiteSpace())
{
tenantConfiguration = IdentityClients.FirstOrDefault(x => x.Key == $"{identityClientName}.{currentTenant.Name}");
}
if (tenantConfiguration.Key != null)
{
return tenantConfiguration.Value;
}
}
return IdentityClients.GetOrDefault(identityClientName) ??
IdentityClients.Default;
}
}
}
}

14
framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs

@ -66,7 +66,7 @@ namespace Volo.Abp.IdentityModel
protected virtual async Task<string> GetAccessTokenOrNullAsync(string identityClientName)
{
var configuration = GetClientConfiguration(identityClientName);
var configuration = ClientOptions.GetClientConfiguration(CurrentTenant, identityClientName);
if (configuration == null)
{
Logger.LogWarning($"Could not find {nameof(IdentityClientConfiguration)} for {identityClientName}. Either define a configuration for {identityClientName} or set a default configuration.");
@ -114,17 +114,6 @@ namespace Volo.Abp.IdentityModel
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
}
private IdentityClientConfiguration GetClientConfiguration(string identityClientName = null)
{
if (identityClientName.IsNullOrEmpty())
{
return ClientOptions.IdentityClients.Default;
}
return ClientOptions.IdentityClients.GetOrDefault(identityClientName) ??
ClientOptions.IdentityClients.Default;
}
protected virtual async Task<string> GetTokenEndpoint(IdentityClientConfiguration configuration)
{
//TODO: Can use (configuration.Authority + /connect/token) directly?
@ -205,6 +194,7 @@ namespace Volo.Abp.IdentityModel
UserName = configuration.UserName,
Password = configuration.UserPassword
};
IdentityModelHttpRequestMessageOptions.ConfigureHttpRequestMessage?.Invoke(request);
AddParametersToRequestAsync(configuration, request);

5
framework/test/Volo.Abp.Cli.Core.Tests/Volo/Abp/Cli/ProjectNameValidation_Tests.cs

@ -51,13 +51,16 @@ namespace Volo.Abp.Cli
{
var illegalKeywords = new[]
{
"Blazor"
"Blazor"
};
foreach (var illegalKeyword in illegalKeywords)
{
var args = new CommandLineArgs("new", illegalKeyword);
await _newCommand.ExecuteAsync(args).ShouldThrowAsync<CliUsageException>();
args = new CommandLineArgs("new", "Acme." + illegalKeyword);
await _newCommand.ExecuteAsync(args).ShouldThrowAsync<CliUsageException>();
}
}

24
framework/test/Volo.Abp.IdentityModel.Tests/Volo.Abp.IdentityModel.Tests.csproj

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.test.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.IdentityModel\Volo.Abp.IdentityModel.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" />
</ItemGroup>
<ItemGroup>
<None Remove="appsettings.json" />
<Content Include="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>

51
framework/test/Volo.Abp.IdentityModel.Tests/Volo/Abp/IdentityModel/AbpIdentityClientOptions_Tests.cs

@ -0,0 +1,51 @@
using System;
using Microsoft.Extensions.Options;
using Shouldly;
using Volo.Abp.MultiTenancy;
using Xunit;
namespace Volo.Abp.IdentityModel
{
public class AbpIdentityClientOptions_Tests : AbpIdentityModelTestBase
{
private readonly ICurrentTenant _currentTenant;
private readonly AbpIdentityClientOptions _identityClientOptions;
public AbpIdentityClientOptions_Tests()
{
_currentTenant = GetRequiredService<ICurrentTenant>();
_identityClientOptions = GetRequiredService<IOptions<AbpIdentityClientOptions>>().Value;
}
[Fact]
public void GetClientConfiguration_Test()
{
var hostDefaultConfiguration = _identityClientOptions.GetClientConfiguration(_currentTenant);
hostDefaultConfiguration.UserName.ShouldBe("host_default_admin");
var hostIdentityConfiguration = _identityClientOptions.GetClientConfiguration(_currentTenant, "Identity");
hostIdentityConfiguration.UserName.ShouldBe("host_identity_admin");
using (_currentTenant.Change(Guid.Parse("f72a344f-651e-49f0-85f6-be260a10e4df"), "Test_Tenant1"))
{
var tenantDefaultConfiguration = _identityClientOptions.GetClientConfiguration(_currentTenant);
tenantDefaultConfiguration.UserName.ShouldBe("tenant_default_admin");
}
using (_currentTenant.Change(Guid.Parse("f72a344f-651e-49f0-85f6-be260a10e4df")))
{
var tenantIdentityConfiguration = _identityClientOptions.GetClientConfiguration(_currentTenant, "Identity");
tenantIdentityConfiguration.UserName.ShouldBe("tenant_identity_admin");
}
using (_currentTenant.Change(Guid.NewGuid()))
{
var configuration = _identityClientOptions.GetClientConfiguration(_currentTenant);
configuration.UserName.ShouldBe("host_default_admin");
configuration = _identityClientOptions.GetClientConfiguration(_currentTenant, "Identity");
configuration.UserName.ShouldBe("host_identity_admin");
}
}
}
}

12
framework/test/Volo.Abp.IdentityModel.Tests/Volo/Abp/IdentityModel/AbpIdentityModelTestBase.cs

@ -0,0 +1,12 @@
using Volo.Abp.Testing;
namespace Volo.Abp.IdentityModel
{
public abstract class AbpIdentityModelTestBase : AbpIntegratedTest<AbpIdentityModelTestModule>
{
protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options)
{
options.UseAutofac();
}
}
}

10
framework/test/Volo.Abp.IdentityModel.Tests/Volo/Abp/IdentityModel/AbpIdentityModelTestModule.cs

@ -0,0 +1,10 @@
using Volo.Abp.Modularity;
namespace Volo.Abp.IdentityModel
{
[DependsOn(typeof(AbpIdentityModelModule))]
public class AbpIdentityModelTestModule : AbpModule
{
}
}

40
framework/test/Volo.Abp.IdentityModel.Tests/appsettings.json

@ -0,0 +1,40 @@
{
"IdentityClients": {
"Default": {
"GrantType": "password",
"ClientId": "Test_App",
"ClientSecret": "1q2w3e*",
"UserName": "host_default_admin",
"UserPassword": "1q2w3E*",
"Authority": "https://localhost:44395",
"Scope": "Test_Scope"
},
"Default.Test_Tenant1": {
"GrantType": "password",
"ClientId": "Test_App",
"ClientSecret": "1q2w3e*",
"UserName": "tenant_default_admin",
"UserPassword": "1q2w3E*",
"Authority": "https://localhost:44395",
"Scope": "Test_Scope"
},
"Identity": {
"GrantType": "password",
"ClientId": "Test_App",
"ClientSecret": "1q2w3e*",
"UserName": "host_identity_admin",
"UserPassword": "1q2w3E*",
"Authority": "https://localhost:44395",
"Scope": "Test_Scope"
},
"Identity.f72a344f-651e-49f0-85f6-be260a10e4df": {
"GrantType": "password",
"ClientId": "Test_App",
"ClientSecret": "1q2w3e*",
"UserName": "tenant_identity_admin",
"UserPassword": "1q2w3E*",
"Authority": "https://localhost:44395",
"Scope": "Test_Scope"
}
}
}

22
modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingDbContextModelBuilderExtensions.cs

@ -1,29 +1,19 @@
using System;
using JetBrains.Annotations;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling;
using Volo.Abp.Identity.EntityFrameworkCore;
namespace Volo.Abp.AuditLogging.EntityFrameworkCore
{
public static class AbpAuditLoggingDbContextModelBuilderExtensions
{
public static void ConfigureAuditLogging(
[NotNull] this ModelBuilder builder,
Action<AbpAuditLoggingModelBuilderConfigurationOptions> optionsAction = null)
[NotNull] this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
var options = new AbpAuditLoggingModelBuilderConfigurationOptions(
AbpAuditLoggingDbProperties.DbTablePrefix,
AbpAuditLoggingDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<AuditLog>(b =>
{
b.ToTable(options.TablePrefix + "AuditLogs", options.Schema);
b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "AuditLogs", AbpAuditLoggingDbProperties.DbSchema);
b.ConfigureByConvention();
@ -56,7 +46,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
builder.Entity<AuditLogAction>(b =>
{
b.ToTable(options.TablePrefix + "AuditLogActions", options.Schema);
b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "AuditLogActions", AbpAuditLoggingDbProperties.DbSchema);
b.ConfigureByConvention();
@ -75,7 +65,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
builder.Entity<EntityChange>(b =>
{
b.ToTable(options.TablePrefix + "EntityChanges", options.Schema);
b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "EntityChanges", AbpAuditLoggingDbProperties.DbSchema);
b.ConfigureByConvention();
@ -96,7 +86,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
builder.Entity<EntityPropertyChange>(b =>
{
b.ToTable(options.TablePrefix + "EntityPropertyChanges", options.Schema);
b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "EntityPropertyChanges", AbpAuditLoggingDbProperties.DbSchema);
b.ConfigureByConvention();

18
modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingModelBuilderConfigurationOptions.cs

@ -1,18 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Abp.Identity.EntityFrameworkCore
{
public class AbpAuditLoggingModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
{
public AbpAuditLoggingModelBuilderConfigurationOptions(
[NotNull] string tablePrefix,
[CanBeNull] string schema)
: base(
tablePrefix,
schema)
{
}
}
}

14
modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbContextExtensions.cs

@ -1,25 +1,17 @@
using System;
using Volo.Abp.MongoDB;
using Volo.Abp.MongoDB;
namespace Volo.Abp.AuditLogging.MongoDB
{
public static class AbpAuditLoggingMongoDbContextExtensions
{
public static void ConfigureAuditLogging(
this IMongoModelBuilder builder,
Action<AuditLoggingMongoModelBuilderConfigurationOptions> optionsAction = null)
this IMongoModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
var options = new AuditLoggingMongoModelBuilderConfigurationOptions(
AbpAuditLoggingDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<AuditLog>(b =>
{
b.CollectionName = options.CollectionPrefix + "AuditLogs";
b.CollectionName = AbpAuditLoggingDbProperties.DbTablePrefix + "AuditLogs";
});
}
}

14
modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AuditLoggingMongoModelBuilderConfigurationOptions.cs

@ -1,14 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.MongoDB;
namespace Volo.Abp.AuditLogging.MongoDB
{
public class AuditLoggingMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
{
public AuditLoggingMongoModelBuilderConfigurationOptions(
[NotNull] string collectionPrefix = "")
: base(collectionPrefix)
{
}
}
}

12
modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs

@ -7,8 +7,7 @@ namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore
public static class BackgroundJobsDbContextModelCreatingExtensions
{
public static void ConfigureBackgroundJobs(
this ModelBuilder builder,
Action<BackgroundJobsModelBuilderConfigurationOptions> optionsAction = null)
this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
@ -17,16 +16,9 @@ namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore
return;
}
var options = new BackgroundJobsModelBuilderConfigurationOptions(
BackgroundJobsDbProperties.DbTablePrefix,
BackgroundJobsDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<BackgroundJobRecord>(b =>
{
b.ToTable(options.TablePrefix + "BackgroundJobs", options.Schema);
b.ToTable(BackgroundJobsDbProperties.DbTablePrefix + "BackgroundJobs", BackgroundJobsDbProperties.DbSchema);
b.ConfigureByConvention();

18
modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsModelBuilderConfigurationOptions.cs

@ -1,18 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore
{
public class BackgroundJobsModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
{
public BackgroundJobsModelBuilderConfigurationOptions(
[NotNull] string tablePrefix = "",
[CanBeNull] string schema = null)
: base(
tablePrefix,
schema)
{
}
}
}

16
modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContextExtensions.cs

@ -1,26 +1,18 @@
using System;
using Volo.Abp.MongoDB;
using Volo.Abp.MongoDB;
namespace Volo.Abp.BackgroundJobs.MongoDB
{
public static class BackgroundJobsMongoDbContextExtensions
{
public static void ConfigureBackgroundJobs(
this IMongoModelBuilder builder,
Action<AbpMongoModelBuilderConfigurationOptions> optionsAction = null)
this IMongoModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
var options = new BackgroundJobsMongoModelBuilderConfigurationOptions(
BackgroundJobsDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<BackgroundJobRecord>(b =>
{
b.CollectionName = options.CollectionPrefix + "BackgroundJobs";
b.CollectionName = BackgroundJobsDbProperties.DbTablePrefix + "BackgroundJobs";
});
}
}
}
}

14
modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoModelBuilderConfigurationOptions.cs

@ -1,14 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.MongoDB;
namespace Volo.Abp.BackgroundJobs.MongoDB
{
public class BackgroundJobsMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
{
public BackgroundJobsMongoModelBuilderConfigurationOptions(
[NotNull] string collectionPrefix = "")
: base(collectionPrefix)
{
}
}
}

15
modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContextModelCreatingExtensions.cs

@ -1,5 +1,4 @@
using Microsoft.EntityFrameworkCore;
using System;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore
@ -7,21 +6,13 @@ namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore
public static class BlobStoringDbContextModelCreatingExtensions
{
public static void ConfigureBlobStoring(
this ModelBuilder builder,
Action<BlobStoringModelBuilderConfigurationOptions> optionsAction = null)
this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
var options = new BlobStoringModelBuilderConfigurationOptions(
BlobStoringDatabaseDbProperties.DbTablePrefix,
BlobStoringDatabaseDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<DatabaseBlobContainer>(b =>
{
b.ToTable(options.TablePrefix + "BlobContainers", options.Schema);
b.ToTable(BlobStoringDatabaseDbProperties.DbTablePrefix + "BlobContainers", BlobStoringDatabaseDbProperties.DbSchema);
b.ConfigureByConvention();
@ -36,7 +27,7 @@ namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore
builder.Entity<DatabaseBlob>(b =>
{
b.ToTable(options.TablePrefix + "Blobs", options.Schema);
b.ToTable(BlobStoringDatabaseDbProperties.DbTablePrefix + "Blobs", BlobStoringDatabaseDbProperties.DbSchema);
b.ConfigureByConvention();

18
modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringModelBuilderConfigurationOptions.cs

@ -1,18 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore
{
public class BlobStoringModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
{
public BlobStoringModelBuilderConfigurationOptions(
[NotNull] string tablePrefix = "",
[CanBeNull] string schema = null)
: base(
tablePrefix,
schema)
{
}
}
}

18
modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContextExtensions.cs

@ -1,31 +1,23 @@
using System;
using Volo.Abp.MongoDB;
using Volo.Abp.MongoDB;
namespace Volo.Abp.BlobStoring.Database.MongoDB
{
public static class BlobStoringMongoDbContextExtensions
{
public static void ConfigureBlobStoring(
this IMongoModelBuilder builder,
Action<AbpMongoModelBuilderConfigurationOptions> optionsAction = null)
this IMongoModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
var options = new BlobStoringMongoModelBuilderConfigurationOptions(
BlobStoringDatabaseDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<DatabaseBlobContainer>(b =>
{
b.CollectionName = options.CollectionPrefix + "BlobContainers";
b.CollectionName = BlobStoringDatabaseDbProperties.DbTablePrefix + "BlobContainers";
});
builder.Entity<DatabaseBlob>(b =>
{
b.CollectionName = options.CollectionPrefix + "Blobs";
b.CollectionName = BlobStoringDatabaseDbProperties.DbTablePrefix + "Blobs";
});
}
}
}
}

14
modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoModelBuilderConfigurationOptions.cs

@ -1,14 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.MongoDB;
namespace Volo.Abp.BlobStoring.Database.MongoDB
{
public class BlobStoringMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
{
public BlobStoringMongoModelBuilderConfigurationOptions(
[NotNull] string collectionPrefix = "")
: base(collectionPrefix)
{
}
}
}

25
modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs

@ -1,5 +1,4 @@
using System;
using JetBrains.Annotations;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;
@ -15,8 +14,7 @@ namespace Volo.Blogging.EntityFrameworkCore
public static class BloggingDbContextModelBuilderExtensions
{
public static void ConfigureBlogging(
[NotNull] this ModelBuilder builder,
Action<BloggingModelBuilderConfigurationOptions> optionsAction = null)
[NotNull] this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
@ -25,16 +23,9 @@ namespace Volo.Blogging.EntityFrameworkCore
return;
}
var options = new BloggingModelBuilderConfigurationOptions(
BloggingDbProperties.DbTablePrefix,
BloggingDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<BlogUser>(b =>
{
b.ToTable(options.TablePrefix + "Users", options.Schema);
b.ToTable(BloggingDbProperties.DbTablePrefix + "Users", BloggingDbProperties.DbSchema);
b.ConfigureByConvention();
b.ConfigureAbpUser();
@ -44,7 +35,7 @@ namespace Volo.Blogging.EntityFrameworkCore
builder.Entity<Blog>(b =>
{
b.ToTable(options.TablePrefix + "Blogs", options.Schema);
b.ToTable(BloggingDbProperties.DbTablePrefix + "Blogs", BloggingDbProperties.DbSchema);
b.ConfigureByConvention();
@ -57,7 +48,7 @@ namespace Volo.Blogging.EntityFrameworkCore
builder.Entity<Post>(b =>
{
b.ToTable(options.TablePrefix + "Posts", options.Schema);
b.ToTable(BloggingDbProperties.DbTablePrefix + "Posts", BloggingDbProperties.DbSchema);
b.ConfigureByConvention();
@ -77,7 +68,7 @@ namespace Volo.Blogging.EntityFrameworkCore
builder.Entity<Comment>(b =>
{
b.ToTable(options.TablePrefix + "Comments", options.Schema);
b.ToTable(BloggingDbProperties.DbTablePrefix + "Comments", BloggingDbProperties.DbSchema);
b.ConfigureByConvention();
@ -93,7 +84,7 @@ namespace Volo.Blogging.EntityFrameworkCore
builder.Entity<Tag>(b =>
{
b.ToTable(options.TablePrefix + "Tags", options.Schema);
b.ToTable(BloggingDbProperties.DbTablePrefix + "Tags", BloggingDbProperties.DbSchema);
b.ConfigureByConvention();
@ -108,7 +99,7 @@ namespace Volo.Blogging.EntityFrameworkCore
builder.Entity<PostTag>(b =>
{
b.ToTable(options.TablePrefix + "PostTags", options.Schema);
b.ToTable(BloggingDbProperties.DbTablePrefix + "PostTags", BloggingDbProperties.DbSchema);
b.ConfigureByConvention();

15
modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingModelBuilderConfigurationOptions.cs

@ -1,15 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Blogging.EntityFrameworkCore
{
public class BloggingModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
{
public BloggingModelBuilderConfigurationOptions(
[NotNull] string tablePrefix = "",
[CanBeNull] string schema = null)
: base(tablePrefix, schema)
{
}
}
}

22
modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContextExtensions.cs

@ -1,5 +1,4 @@
using System;
using Volo.Abp;
using Volo.Abp;
using Volo.Abp.MongoDB;
using Volo.Blogging.Blogs;
using Volo.Blogging.Comments;
@ -11,40 +10,33 @@ namespace Volo.Blogging.MongoDB
public static class BloggingMongoDbContextExtensions
{
public static void ConfigureBlogging(
this IMongoModelBuilder builder,
Action<AbpMongoModelBuilderConfigurationOptions> optionsAction = null)
this IMongoModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
var options = new BloggingMongoModelBuilderConfigurationOptions(
BloggingDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<BlogUser>(b =>
{
b.CollectionName = options.CollectionPrefix + "Users";
b.CollectionName = BloggingDbProperties.DbTablePrefix + "Users";
});
builder.Entity<Blog>(b =>
{
b.CollectionName = options.CollectionPrefix + "Blogs";
b.CollectionName = BloggingDbProperties.DbTablePrefix + "Blogs";
});
builder.Entity<Post>(b =>
{
b.CollectionName = options.CollectionPrefix + "Posts";
b.CollectionName = BloggingDbProperties.DbTablePrefix + "Posts";
});
builder.Entity<Tagging.Tag>(b =>
{
b.CollectionName = options.CollectionPrefix + "Tags";
b.CollectionName = BloggingDbProperties.DbTablePrefix + "Tags";
});
builder.Entity<Comment>(b =>
{
b.CollectionName = options.CollectionPrefix + "Comments";
b.CollectionName = BloggingDbProperties.DbTablePrefix + "Comments";
});
}
}

14
modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoModelBuilderConfigurationOptions.cs

@ -1,14 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.MongoDB;
namespace Volo.Blogging.MongoDB
{
public class BloggingMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
{
public BloggingMongoModelBuilderConfigurationOptions(
[NotNull] string collectionPrefix = "")
: base(collectionPrefix)
{
}
}
}

35
modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs

@ -1,5 +1,4 @@
using Microsoft.EntityFrameworkCore;
using System;
using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;
using Volo.Abp.GlobalFeatures;
@ -20,23 +19,15 @@ namespace Volo.CmsKit.EntityFrameworkCore
public static class CmsKitDbContextModelCreatingExtensions
{
public static void ConfigureCmsKit(
this ModelBuilder builder,
Action<CmsKitModelBuilderConfigurationOptions> optionsAction = null)
this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
var options = new CmsKitModelBuilderConfigurationOptions(
CmsKitDbProperties.DbTablePrefix,
CmsKitDbProperties.DbSchema
);
optionsAction?.Invoke(options);
if (GlobalFeatureManager.Instance.IsEnabled<CmsUserFeature>())
{
builder.Entity<CmsUser>(b =>
{
b.ToTable(options.TablePrefix + "Users", options.Schema);
b.ToTable(CmsKitDbProperties.DbTablePrefix + "Users", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
b.ConfigureAbpUser();
@ -56,7 +47,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{
builder.Entity<UserReaction>(b =>
{
b.ToTable(options.TablePrefix + "UserReactions", options.Schema);
b.ToTable(CmsKitDbProperties.DbTablePrefix + "UserReactions", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
@ -79,7 +70,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{
builder.Entity<Comment>(b =>
{
b.ToTable(options.TablePrefix + "Comments", options.Schema);
b.ToTable(CmsKitDbProperties.DbTablePrefix + "Comments", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
@ -103,7 +94,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{
builder.Entity<Rating>(r =>
{
r.ToTable(options.TablePrefix + "Ratings", options.Schema);
r.ToTable(CmsKitDbProperties.DbTablePrefix + "Ratings", CmsKitDbProperties.DbSchema);
r.ConfigureByConvention();
@ -125,7 +116,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{
builder.Entity<Tag>(b =>
{
b.ToTable(options.TablePrefix + "Tags", options.Schema);
b.ToTable(CmsKitDbProperties.DbTablePrefix + "Tags", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
@ -143,7 +134,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
builder.Entity<EntityTag>(b =>
{
b.ToTable(options.TablePrefix + "EntityTags", options.Schema);
b.ToTable(CmsKitDbProperties.DbTablePrefix + "EntityTags", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
@ -167,7 +158,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{
builder.Entity<Page>(b =>
{
b.ToTable(options.TablePrefix + "Pages", options.Schema);
b.ToTable(CmsKitDbProperties.DbTablePrefix + "Pages", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
@ -189,7 +180,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{
builder.Entity<Blog>(b =>
{
b.ToTable(options.TablePrefix + "Blogs", options.Schema);
b.ToTable(CmsKitDbProperties.DbTablePrefix + "Blogs", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
@ -202,7 +193,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
builder.Entity<BlogPost>(b =>
{
b.ToTable(options.TablePrefix + "BlogPosts", options.Schema);
b.ToTable(CmsKitDbProperties.DbTablePrefix + "BlogPosts", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
@ -219,7 +210,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
builder.Entity<BlogFeature>(b =>
{
b.ToTable(options.TablePrefix + "BlogFeatures", options.Schema);
b.ToTable(CmsKitDbProperties.DbTablePrefix + "BlogFeatures", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
@ -239,7 +230,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{
builder.Entity<MediaDescriptor>(b =>
{
b.ToTable(options.TablePrefix + "MediaDescriptors", options.Schema);
b.ToTable(CmsKitDbProperties.DbTablePrefix + "MediaDescriptors", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
@ -260,7 +251,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{
builder.Entity<MenuItem>(b =>
{
b.ToTable(options.TablePrefix + "MenuItems", options.Schema);
b.ToTable(CmsKitDbProperties.DbTablePrefix + "MenuItems", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();

18
modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitModelBuilderConfigurationOptions.cs

@ -1,18 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.CmsKit.EntityFrameworkCore
{
public class CmsKitModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
{
public CmsKitModelBuilderConfigurationOptions(
[NotNull] string tablePrefix = "",
[CanBeNull] string schema = null)
: base(
tablePrefix,
schema)
{
}
}
}

12
modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs

@ -1,5 +1,4 @@
using System;
using Volo.Abp;
using Volo.Abp;
using Volo.Abp.MongoDB;
using Volo.CmsKit.Blogs;
using Volo.CmsKit.Comments;
@ -16,17 +15,10 @@ namespace Volo.CmsKit.MongoDB
public static class CmsKitMongoDbContextExtensions
{
public static void ConfigureCmsKit(
this IMongoModelBuilder builder,
Action<AbpMongoModelBuilderConfigurationOptions> optionsAction = null)
this IMongoModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
var options = new CmsKitMongoModelBuilderConfigurationOptions(
CmsKitDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<CmsUser>(x =>
{
x.CollectionName = CmsKitDbProperties.DbTablePrefix + "Users";

14
modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoModelBuilderConfigurationOptions.cs

@ -1,14 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.MongoDB;
namespace Volo.CmsKit.MongoDB
{
public class CmsKitMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
{
public CmsKitMongoModelBuilderConfigurationOptions(
[NotNull] string collectionPrefix = "")
: base(collectionPrefix)
{
}
}
}

19
modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs

@ -1,5 +1,4 @@
using System;
using JetBrains.Annotations;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;
@ -11,8 +10,7 @@ namespace Volo.Docs.EntityFrameworkCore
public static class DocsDbContextModelBuilderExtensions
{
public static void ConfigureDocs(
[NotNull] this ModelBuilder builder,
Action<DocsModelBuilderConfigurationOptions> optionsAction = null)
[NotNull] this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
@ -21,16 +19,9 @@ namespace Volo.Docs.EntityFrameworkCore
return;
}
var options = new DocsModelBuilderConfigurationOptions(
DocsDbProperties.DbTablePrefix,
DocsDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<Project>(b =>
{
b.ToTable(options.TablePrefix + "Projects", options.Schema);
b.ToTable(DocsDbProperties.DbTablePrefix + "Projects", DocsDbProperties.DbSchema);
b.ConfigureByConvention();
@ -46,7 +37,7 @@ namespace Volo.Docs.EntityFrameworkCore
builder.Entity<Document>(b =>
{
b.ToTable(options.TablePrefix + "Documents", options.Schema);
b.ToTable(DocsDbProperties.DbTablePrefix + "Documents", DocsDbProperties.DbSchema);
b.ConfigureByConvention();
@ -70,7 +61,7 @@ namespace Volo.Docs.EntityFrameworkCore
builder.Entity<DocumentContributor>(b =>
{
b.ToTable(options.TablePrefix + "DocumentContributors", options.Schema);
b.ToTable(DocsDbProperties.DbTablePrefix + "DocumentContributors", DocsDbProperties.DbSchema);
b.ConfigureByConvention();

15
modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsModelBuilderConfigurationOptions.cs

@ -1,15 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Docs.EntityFrameworkCore
{
public class DocsModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
{
public DocsModelBuilderConfigurationOptions(
[NotNull] string tablePrefix,
[CanBeNull] string schema)
: base(tablePrefix, schema)
{
}
}
}

16
modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoDbContextExtensions.cs

@ -1,5 +1,4 @@
using System;
using Volo.Abp;
using Volo.Abp;
using Volo.Abp.MongoDB;
using Volo.Docs.Documents;
using Volo.Docs.Projects;
@ -9,25 +8,18 @@ namespace Volo.Docs.MongoDB
public static class DocsMongoDbContextExtensions
{
public static void ConfigureDocs(
this IMongoModelBuilder builder,
Action<AbpMongoModelBuilderConfigurationOptions> optionsAction = null)
this IMongoModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
var options = new DocsMongoModelBuilderConfigurationOptions(
DocsDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<Project>(b =>
{
b.CollectionName = options.CollectionPrefix + "Projects";
b.CollectionName = DocsDbProperties.DbTablePrefix + "Projects";
});
builder.Entity<Document>(b =>
{
b.CollectionName = options.CollectionPrefix + "DocumentS";
b.CollectionName = DocsDbProperties.DbTablePrefix + "DocumentS";
});
}
}

14
modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoModelBuilderConfigurationOptions.cs

@ -1,14 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.MongoDB;
namespace Volo.Docs.MongoDB
{
public class DocsMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
{
public DocsMongoModelBuilderConfigurationOptions(
[NotNull] string collectionPrefix)
: base(collectionPrefix)
{
}
}
}

12
modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContextModelCreatingExtensions.cs

@ -7,8 +7,7 @@ namespace Volo.Abp.FeatureManagement.EntityFrameworkCore
public static class FeatureManagementDbContextModelCreatingExtensions
{
public static void ConfigureFeatureManagement(
this ModelBuilder builder,
Action<FeatureManagementModelBuilderConfigurationOptions> optionsAction = null)
this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
@ -17,16 +16,9 @@ namespace Volo.Abp.FeatureManagement.EntityFrameworkCore
return;
}
var options = new FeatureManagementModelBuilderConfigurationOptions(
FeatureManagementDbProperties.DbTablePrefix,
FeatureManagementDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<FeatureValue>(b =>
{
b.ToTable(options.TablePrefix + "FeatureValues", options.Schema);
b.ToTable(FeatureManagementDbProperties.DbTablePrefix + "FeatureValues", FeatureManagementDbProperties.DbSchema);
b.ConfigureByConvention();

18
modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementModelBuilderConfigurationOptions.cs

@ -1,18 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Abp.FeatureManagement.EntityFrameworkCore
{
public class FeatureManagementModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
{
public FeatureManagementModelBuilderConfigurationOptions(
[NotNull] string tablePrefix = "",
[CanBeNull] string schema = null)
: base(
tablePrefix,
schema)
{
}
}
}

14
modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoDbContextExtensions.cs

@ -1,25 +1,17 @@
using System;
using Volo.Abp.MongoDB;
using Volo.Abp.MongoDB;
namespace Volo.Abp.FeatureManagement.MongoDB
{
public static class FeatureManagementMongoDbContextExtensions
{
public static void ConfigureFeatureManagement(
this IMongoModelBuilder builder,
Action<AbpMongoModelBuilderConfigurationOptions> optionsAction = null)
this IMongoModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
var options = new FeatureManagementMongoModelBuilderConfigurationOptions(
FeatureManagementDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<FeatureValue>(b =>
{
b.CollectionName = options.CollectionPrefix + "FeatureValues";
b.CollectionName = FeatureManagementDbProperties.DbTablePrefix + "FeatureValues";
});
}
}

15
modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoModelBuilderConfigurationOptions.cs

@ -1,15 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.MongoDB;
namespace Volo.Abp.FeatureManagement.MongoDB
{
public class FeatureManagementMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
{
public FeatureManagementMongoModelBuilderConfigurationOptions(
[NotNull] string collectionPrefix = "")
: base(collectionPrefix)
{
}
}
}

83
modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs

@ -1,5 +1,4 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling;
using Volo.Abp.IdentityServer.ApiResources;
@ -14,8 +13,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
public static class IdentityServerDbContextModelCreatingExtensions
{
public static void ConfigureIdentityServer(
this ModelBuilder builder,
Action<IdentityServerModelBuilderConfigurationOptions> optionsAction = null)
this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
@ -24,18 +22,11 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
return;
}
var options = new IdentityServerModelBuilderConfigurationOptions(
AbpIdentityServerDbProperties.DbTablePrefix,
AbpIdentityServerDbProperties.DbSchema
);
optionsAction?.Invoke(options);
#region Client
builder.Entity<Client>(b =>
{
b.ToTable(options.TablePrefix + "Clients", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "Clients", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
@ -69,7 +60,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ClientGrantType>(b =>
{
b.ToTable(options.TablePrefix + "ClientGrantTypes", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientGrantTypes", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
@ -82,13 +73,13 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ClientRedirectUri>(b =>
{
b.ToTable(options.TablePrefix + "ClientRedirectUris", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientRedirectUris", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
b.HasKey(x => new {x.ClientId, x.RedirectUri});
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql))
if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql))
{
ClientRedirectUriConsts.RedirectUriMaxLengthValue = 300;
}
@ -100,13 +91,13 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ClientPostLogoutRedirectUri>(b =>
{
b.ToTable(options.TablePrefix + "ClientPostLogoutRedirectUris", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientPostLogoutRedirectUris", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
b.HasKey(x => new {x.ClientId, x.PostLogoutRedirectUri});
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql))
if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql))
{
ClientPostLogoutRedirectUriConsts.PostLogoutRedirectUriMaxLengthValue = 300;
}
@ -120,7 +111,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ClientScope>(b =>
{
b.ToTable(options.TablePrefix + "ClientScopes", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientScopes", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
@ -133,14 +124,14 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ClientSecret>(b =>
{
b.ToTable(options.TablePrefix + "ClientSecrets", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientSecrets", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
b.HasKey(x => new {x.ClientId, x.Type, x.Value});
b.Property(x => x.Type).HasMaxLength(ClientSecretConsts.TypeMaxLength).IsRequired();
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
{
ClientSecretConsts.ValueMaxLength = 300;
}
@ -152,7 +143,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ClientClaim>(b =>
{
b.ToTable(options.TablePrefix + "ClientClaims", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientClaims", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
@ -166,7 +157,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ClientIdPRestriction>(b =>
{
b.ToTable(options.TablePrefix + "ClientIdPRestrictions", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientIdPRestrictions", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
@ -179,7 +170,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ClientCorsOrigin>(b =>
{
b.ToTable(options.TablePrefix + "ClientCorsOrigins", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientCorsOrigins", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
@ -192,14 +183,14 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ClientProperty>(b =>
{
b.ToTable(options.TablePrefix + "ClientProperties", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientProperties", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
b.HasKey(x => new {x.ClientId, x.Key, x.Value});
b.Property(x => x.Key).HasMaxLength(ClientPropertyConsts.KeyMaxLength).IsRequired();
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql))
if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql))
{
ClientPropertyConsts.ValueMaxLength = 300;
}
@ -214,7 +205,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<IdentityResource>(b =>
{
b.ToTable(options.TablePrefix + "IdentityResources", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "IdentityResources", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
@ -230,7 +221,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<IdentityResourceClaim>(b =>
{
b.ToTable(options.TablePrefix + "IdentityResourceClaims", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "IdentityResourceClaims", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
@ -243,14 +234,14 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<IdentityResourceProperty>(b =>
{
b.ToTable(options.TablePrefix + "IdentityResourceProperties", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "IdentityResourceProperties", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
b.HasKey(x => new {x.IdentityResourceId, x.Key, x.Value});
b.Property(x => x.Key).HasMaxLength(IdentityResourcePropertyConsts.KeyMaxLength).IsRequired();
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
{
IdentityResourcePropertyConsts.ValueMaxLength = 300;
}
@ -265,7 +256,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ApiResource>(b =>
{
b.ToTable(options.TablePrefix + "ApiResources", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiResources", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
@ -284,7 +275,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ApiResourceSecret>(b =>
{
b.ToTable(options.TablePrefix + "ApiResourceSecrets", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiResourceSecrets", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
@ -292,7 +283,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
b.Property(x => x.Type).HasMaxLength(ApiResourceSecretConsts.TypeMaxLength).IsRequired();
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
{
ApiResourceSecretConsts.ValueMaxLength = 300;
}
@ -305,7 +296,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ApiResourceClaim>(b =>
{
b.ToTable(options.TablePrefix + "ApiResourceClaims", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiResourceClaims", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
@ -318,7 +309,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ApiResourceScope>(b =>
{
b.ToTable(options.TablePrefix + "ApiResourceScopes", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiResourceScopes", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
@ -331,14 +322,14 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ApiResourceProperty>(b =>
{
b.ToTable(options.TablePrefix + "ApiResourceProperties", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiResourceProperties", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
b.HasKey(x => new {x.ApiResourceId, x.Key, x.Value});
b.Property(x => x.Key).HasMaxLength(ApiResourcePropertyConsts.KeyMaxLength).IsRequired();
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
{
ApiResourcePropertyConsts.ValueMaxLength = 300;
}
@ -353,7 +344,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ApiScope>(b =>
{
b.ToTable(options.TablePrefix + "ApiScopes", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiScopes", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
@ -369,7 +360,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ApiScopeClaim>(b =>
{
b.ToTable(options.TablePrefix + "ApiScopeClaims", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiScopeClaims", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
@ -382,14 +373,14 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ApiScopeProperty>(b =>
{
b.ToTable(options.TablePrefix + "ApiScopeProperties", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiScopeProperties", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
b.HasKey(x => new {x.ApiScopeId, x.Key, x.Value});
b.Property(x => x.Key).HasMaxLength(ApiScopePropertyConsts.KeyMaxLength).IsRequired();
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
{
ApiScopePropertyConsts.ValueMaxLength = 300;
}
@ -404,7 +395,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<PersistedGrant>(b =>
{
b.ToTable(options.TablePrefix + "PersistedGrants", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "PersistedGrants", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
@ -416,7 +407,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
b.Property(x => x.Description).HasMaxLength(PersistedGrantConsts.DescriptionMaxLength);
b.Property(x => x.CreationTime).IsRequired();
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql))
if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql))
{
PersistedGrantConsts.DataMaxLengthValue = 10000; //TODO: MySQL accepts 20.000. We can consider to change in v3.0.
}
@ -438,7 +429,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<DeviceFlowCodes>(b =>
{
b.ToTable(options.TablePrefix + "DeviceFlowCodes", options.Schema);
b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "DeviceFlowCodes", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention();
@ -451,7 +442,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
b.Property(x => x.CreationTime).IsRequired();
b.Property(x => x.Expiration).IsRequired();
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql))
if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql))
{
DeviceFlowCodesConsts.DataMaxLength = 10000; //TODO: MySQL accepts 20.000. We can consider to change in v3.0.
}
@ -471,13 +462,11 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
private static bool IsDatabaseProvider(
ModelBuilder modelBuilder,
IdentityServerModelBuilderConfigurationOptions options,
params EfCoreDatabaseProvider[] providers)
{
foreach (var provider in providers)
{
if (options.DatabaseProvider == EfCoreDatabaseProvider.MySql ||
modelBuilder.GetDatabaseProvider() == provider)
if (modelBuilder.GetDatabaseProvider() == provider)
{
return true;
}

23
modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerModelBuilderConfigurationOptions.cs

@ -1,23 +0,0 @@
using System;
using JetBrains.Annotations;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Abp.IdentityServer.EntityFrameworkCore
{
public class IdentityServerModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
{
[Obsolete("No need to manually set database provider after v2.9+. If it doesn't set automatically, use modelBuilder.UseXXX() in the OnModelCreating method of your DbContext (XXX is your database provider name).")]
public EfCoreDatabaseProvider? DatabaseProvider { get; set; }
public IdentityServerModelBuilderConfigurationOptions(
[NotNull] string tablePrefix,
[CanBeNull] string schema)
: base(
tablePrefix,
schema)
{
}
}
}

24
modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/AbpIdentityServerMongoDbContextExtensions.cs

@ -1,5 +1,4 @@
using System;
using Volo.Abp.IdentityServer.ApiResources;
using Volo.Abp.IdentityServer.ApiResources;
using Volo.Abp.IdentityServer.ApiScopes;
using Volo.Abp.IdentityServer.Clients;
using Volo.Abp.IdentityServer.Devices;
@ -12,45 +11,38 @@ namespace Volo.Abp.IdentityServer.MongoDB
public static class AbpIdentityServerMongoDbContextExtensions
{
public static void ConfigureIdentityServer(
this IMongoModelBuilder builder,
Action<IdentityServerMongoModelBuilderConfigurationOptions> optionsAction = null)
this IMongoModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
var options = new IdentityServerMongoModelBuilderConfigurationOptions(
AbpIdentityServerDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<ApiResource>(b =>
{
b.CollectionName = options.CollectionPrefix + "ApiResources";
b.CollectionName = AbpIdentityServerDbProperties.DbTablePrefix + "ApiResources";
});
builder.Entity<ApiScope>(b =>
{
b.CollectionName = options.CollectionPrefix + "ApiScopes";
b.CollectionName = AbpIdentityServerDbProperties.DbTablePrefix + "ApiScopes";
});
builder.Entity<IdentityResource>(b =>
{
b.CollectionName = options.CollectionPrefix + "IdentityResources";
b.CollectionName = AbpIdentityServerDbProperties.DbTablePrefix + "IdentityResources";
});
builder.Entity<Client>(b =>
{
b.CollectionName = options.CollectionPrefix + "Clients";
b.CollectionName = AbpIdentityServerDbProperties.DbTablePrefix + "Clients";
});
builder.Entity<PersistedGrant>(b =>
{
b.CollectionName = options.CollectionPrefix + "PersistedGrants";
b.CollectionName = AbpIdentityServerDbProperties.DbTablePrefix + "PersistedGrants";
});
builder.Entity<DeviceFlowCodes>(b =>
{
b.CollectionName = options.CollectionPrefix + "DeviceFlowCodes";
b.CollectionName = AbpIdentityServerDbProperties.DbTablePrefix + "DeviceFlowCodes";
});
}
}

13
modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/IdentityServerMongoModelBuilderConfigurationOptions.cs

@ -1,13 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.MongoDB;
namespace Volo.Abp.IdentityServer.MongoDB
{
public class IdentityServerMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
{
public IdentityServerMongoModelBuilderConfigurationOptions([NotNull] string collectionPrefix = "")
: base(collectionPrefix)
{
}
}
}

15
modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementDbContextModelBuilderExtensions.cs

@ -1,5 +1,4 @@
using System;
using JetBrains.Annotations;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling;
@ -8,21 +7,13 @@ namespace Volo.Abp.PermissionManagement.EntityFrameworkCore
public static class AbpPermissionManagementDbContextModelBuilderExtensions
{
public static void ConfigurePermissionManagement(
[NotNull] this ModelBuilder builder,
[CanBeNull] Action<AbpPermissionManagementModelBuilderConfigurationOptions> optionsAction = null)
[NotNull] this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
var options = new AbpPermissionManagementModelBuilderConfigurationOptions(
AbpPermissionManagementDbProperties.DbTablePrefix,
AbpPermissionManagementDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<PermissionGrant>(b =>
{
b.ToTable(options.TablePrefix + "PermissionGrants", options.Schema);
b.ToTable(AbpPermissionManagementDbProperties.DbTablePrefix + "PermissionGrants", AbpPermissionManagementDbProperties.DbSchema);
b.ConfigureByConvention();

18
modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementModelBuilderConfigurationOptions.cs

@ -1,18 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Abp.PermissionManagement.EntityFrameworkCore
{
public class AbpPermissionManagementModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
{
public AbpPermissionManagementModelBuilderConfigurationOptions(
[NotNull] string tablePrefix,
[CanBeNull] string schema)
: base(
tablePrefix,
schema)
{
}
}
}

14
modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbContextExtensions.cs

@ -1,25 +1,17 @@
using System;
using Volo.Abp.MongoDB;
using Volo.Abp.MongoDB;
namespace Volo.Abp.PermissionManagement.MongoDB
{
public static class AbpPermissionManagementMongoDbContextExtensions
{
public static void ConfigurePermissionManagement(
this IMongoModelBuilder builder,
Action<AbpMongoModelBuilderConfigurationOptions> optionsAction = null)
this IMongoModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
var options = new PermissionManagementMongoModelBuilderConfigurationOptions(
AbpPermissionManagementDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<PermissionGrant>(b =>
{
b.CollectionName = options.CollectionPrefix + "PermissionGrants";
b.CollectionName = AbpPermissionManagementDbProperties.DbTablePrefix + "PermissionGrants";
});
}
}

14
modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/PermissionManagementMongoModelBuilderConfigurationOptions.cs

@ -1,14 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.MongoDB;
namespace Volo.Abp.PermissionManagement.MongoDB
{
public class PermissionManagementMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
{
public PermissionManagementMongoModelBuilderConfigurationOptions(
[NotNull] string tablePrefix = "")
: base(tablePrefix)
{
}
}
}

28
modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContextModelBuilderExtensions.cs

@ -1,29 +1,14 @@
using System;
using JetBrains.Annotations;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Abp.SettingManagement.EntityFrameworkCore
{
public class SettingManagementModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
{
public SettingManagementModelBuilderConfigurationOptions(
[NotNull] string tablePrefix,
[CanBeNull] string schema)
: base(
tablePrefix,
schema)
{
}
}
public static class SettingManagementDbContextModelBuilderExtensions
{
//TODO: Instead of getting parameters, get a action of SettingManagementModelBuilderConfigurationOptions like other modules
public static void ConfigureSettingManagement(
[NotNull] this ModelBuilder builder,
[CanBeNull] Action<SettingManagementModelBuilderConfigurationOptions> optionsAction = null)
[NotNull] this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
@ -32,16 +17,9 @@ namespace Volo.Abp.SettingManagement.EntityFrameworkCore
return;
}
var options = new SettingManagementModelBuilderConfigurationOptions(
AbpSettingManagementDbProperties.DbTablePrefix,
AbpSettingManagementDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<Setting>(b =>
{
b.ToTable(options.TablePrefix + "Settings", options.Schema);
b.ToTable(AbpSettingManagementDbProperties.DbTablePrefix + "Settings", AbpSettingManagementDbProperties.DbSchema);
b.ConfigureByConvention();

12
modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoDbContextExtensions.cs

@ -1,4 +1,3 @@
using System;
using Volo.Abp.MongoDB;
namespace Volo.Abp.SettingManagement.MongoDB
@ -6,20 +5,13 @@ namespace Volo.Abp.SettingManagement.MongoDB
public static class SettingManagementMongoDbContextExtensions
{
public static void ConfigureSettingManagement(
this IMongoModelBuilder builder,
Action<SettingManagementMongoModelBuilderConfigurationOptions> optionsAction = null)
this IMongoModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
var options = new SettingManagementMongoModelBuilderConfigurationOptions(
AbpSettingManagementDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<Setting>(b =>
{
b.CollectionName = options.CollectionPrefix + "Settings";
b.CollectionName = AbpSettingManagementDbProperties.DbTablePrefix + "Settings";
});
}
}

14
modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoModelBuilderConfigurationOptions.cs

@ -1,14 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.MongoDB;
namespace Volo.Abp.SettingManagement.MongoDB
{
public class SettingManagementMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
{
public SettingManagementMongoModelBuilderConfigurationOptions(
[NotNull] string tablePrefix = "")
: base(tablePrefix)
{
}
}
}

15
modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementDbContextModelCreatingExtensions.cs

@ -1,4 +1,3 @@
using System;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling;
@ -8,8 +7,7 @@ namespace Volo.Abp.TenantManagement.EntityFrameworkCore
public static class AbpTenantManagementDbContextModelCreatingExtensions
{
public static void ConfigureTenantManagement(
this ModelBuilder builder,
[CanBeNull] Action<AbpTenantManagementModelBuilderConfigurationOptions> optionsAction = null)
this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
@ -18,16 +16,9 @@ namespace Volo.Abp.TenantManagement.EntityFrameworkCore
return;
}
var options = new AbpTenantManagementModelBuilderConfigurationOptions(
AbpTenantManagementDbProperties.DbTablePrefix,
AbpTenantManagementDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<Tenant>(b =>
{
b.ToTable(options.TablePrefix + "Tenants", options.Schema);
b.ToTable(AbpTenantManagementDbProperties.DbTablePrefix + "Tenants", AbpTenantManagementDbProperties.DbSchema);
b.ConfigureByConvention();
@ -42,7 +33,7 @@ namespace Volo.Abp.TenantManagement.EntityFrameworkCore
builder.Entity<TenantConnectionString>(b =>
{
b.ToTable(options.TablePrefix + "TenantConnectionStrings", options.Schema);
b.ToTable(AbpTenantManagementDbProperties.DbTablePrefix + "TenantConnectionStrings", AbpTenantManagementDbProperties.DbSchema);
b.ConfigureByConvention();

18
modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementModelBuilderConfigurationOptions.cs

@ -1,18 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Abp.TenantManagement.EntityFrameworkCore
{
public class AbpTenantManagementModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
{
public AbpTenantManagementModelBuilderConfigurationOptions(
[NotNull] string tablePrefix,
[CanBeNull] string schema)
: base(
tablePrefix,
schema)
{
}
}
}

14
modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbContextExtensions.cs

@ -1,25 +1,17 @@
using System;
using Volo.Abp.MongoDB;
using Volo.Abp.MongoDB;
namespace Volo.Abp.TenantManagement.MongoDB
{
public static class AbpTenantManagementMongoDbContextExtensions
{
public static void ConfigureTenantManagement(
this IMongoModelBuilder builder,
Action<AbpMongoModelBuilderConfigurationOptions> optionsAction = null)
this IMongoModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
var options = new TenantManagementMongoModelBuilderConfigurationOptions(
AbpTenantManagementDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<Tenant>(b =>
{
b.CollectionName = options.CollectionPrefix + "Tenants";
b.CollectionName = AbpTenantManagementDbProperties.DbTablePrefix + "Tenants";
});
}
}

14
modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/TenantManagementMongoModelBuilderConfigurationOptions.cs

@ -1,14 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.MongoDB;
namespace Volo.Abp.TenantManagement.MongoDB
{
public class TenantManagementMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
{
public TenantManagementMongoModelBuilderConfigurationOptions(
[NotNull] string tablePrefix = "")
: base(tablePrefix)
{
}
}
}

2
npm/ng-packs/apps/dev-app-e2e/tsconfig.json

@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"files": [],
"include": [],
"references": [

2
npm/ng-packs/apps/dev-app/tsconfig.json

@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"files": [],
"include": [],
"references": [

2
npm/ng-packs/package.json

@ -86,7 +86,7 @@
"@typescript-eslint/parser": "~4.28.3",
"angular-oauth2-oidc": "^12.1.0",
"bootstrap": "^4.5.0",
"chart.js": "^2.9.3",
"chart.js": "^3.5.1",
"cypress": "^7.3.0",
"dotenv": "~10.0.0",
"eslint": "7.22.0",

2
npm/ng-packs/packages/account-core/tsconfig.json

@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"files": [],
"include": [],
"references": [

2
npm/ng-packs/packages/account/tsconfig.json

@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"files": [],
"include": [],
"references": [

7
npm/ng-packs/packages/components/chart.js/ng-package.json

@ -0,0 +1,7 @@
{
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../../dist/packages/components/chart.js",
"lib": {
"entryFile": "src/public-api.ts"
}
}

56
npm/ng-packs/packages/theme-shared/src/lib/tests/chart.component.spec.ts → npm/ng-packs/packages/components/chart.js/src/chart.component.spec.ts

@ -1,10 +1,8 @@
import { createHostFactory, SpectatorHost } from '@ngneat/spectator/jest';
import { ReplaySubject } from 'rxjs';
import { ChartComponent } from '../components';
import * as widgetUtils from '../utils/widget-utils';
import { chartJsLoaded$ } from '../utils/widget-utils';
// import 'chart.js';
declare const Chart;
import { ChartComponent } from './chart.component';
import * as widgetUtils from './widget-utils';
Object.defineProperty(window, 'getComputedStyle', {
value: () => ({
@ -34,19 +32,18 @@ describe('ChartComponent', () => {
},
},
});
});
test('should throw error when chart.js is not loaded', () => {
try {
spectator.component.testChartJs();
} catch (error) {
expect(error.message).toContain('Chart is not found');
}
window.ResizeObserver =
window.ResizeObserver ||
jest.fn().mockImplementation(() => ({
disconnect: jest.fn(),
observe: jest.fn(),
unobserve: jest.fn(),
}));
});
test('should have a success class by default', done => {
import('chart.js').then(() => {
chartJsLoaded$.next();
import('chart.js/auto').then(() => {
setTimeout(() => {
expect(spectator.component.chart).toBeTruthy();
done();
@ -56,7 +53,6 @@ describe('ChartComponent', () => {
describe('#reinit', () => {
it('should call the destroy method', done => {
chartJsLoaded$.next();
const spy = jest.spyOn(spectator.component.chart, 'destroy');
spectator.setHostInput({
data: {
@ -79,7 +75,6 @@ describe('ChartComponent', () => {
describe('#refresh', () => {
it('should call the update method', done => {
chartJsLoaded$.next();
const spy = jest.spyOn(spectator.component.chart, 'update');
spectator.component.refresh();
setTimeout(() => {
@ -89,38 +84,11 @@ describe('ChartComponent', () => {
});
});
describe('#generateLegend', () => {
it('should call the generateLegend method', done => {
chartJsLoaded$.next();
const spy = jest.spyOn(spectator.component.chart, 'generateLegend');
spectator.component.generateLegend();
setTimeout(() => {
expect(spy).toHaveBeenCalled();
done();
}, 0);
});
});
describe('#onCanvasClick', () => {
it('should emit the onDataSelect', done => {
spectator.component.onDataSelect.subscribe(() => {
done();
});
chartJsLoaded$.next();
jest
.spyOn(spectator.component.chart, 'getElementAtEvent')
.mockReturnValue([document.createElement('div')]);
spectator.click('canvas');
});
});
describe('#base64Image', () => {
it('should return the base64 image', done => {
chartJsLoaded$.next();
setTimeout(() => {
expect(spectator.component.base64Image).toContain('base64');
expect(spectator.component.getBase64Image()).toContain('base64');
done();
}, 0);
});

149
npm/ng-packs/packages/components/chart.js/src/chart.component.ts

@ -0,0 +1,149 @@
import {
AfterViewInit,
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ElementRef,
EventEmitter,
Input,
OnChanges,
OnDestroy,
Output,
SimpleChanges,
ViewChild,
} from '@angular/core';
let Chart: any;
@Component({
selector: 'abp-chart',
template: `
<div
style="position:relative"
[style.width]="responsive && !width ? null : width"
[style.height]="responsive && !height ? null : height"
>
<canvas
#canvas
[attr.width]="responsive && !width ? null : width"
[attr.height]="responsive && !height ? null : height"
(click)="onCanvasClick($event)"
></canvas>
</div>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
exportAs: 'abpChart',
})
export class ChartComponent implements AfterViewInit, OnDestroy, OnChanges {
@Input() type: string;
@Input() data: any = {};
@Input() options: any = {};
@Input() plugins: any[] = [];
@Input() width: string;
@Input() height: string;
@Input() responsive = true;
@Output() dataSelect = new EventEmitter();
@Output() initialized = new EventEmitter<boolean>();
@ViewChild('canvas') canvas: ElementRef<HTMLCanvasElement>;
chart: any;
constructor(public el: ElementRef, private cdr: ChangeDetectorRef) {}
ngAfterViewInit() {
import('chart.js/auto').then(module => {
Chart = module.default;
this.initChart();
this.initialized.emit(true);
});
}
onCanvasClick(event) {
if (this.chart) {
const element = this.chart.getElementsAtEventForMode(
event,
'nearest',
{ intersect: true },
false,
);
const dataset = this.chart.getElementsAtEventForMode(
event,
'dataset',
{ intersect: true },
false,
);
if (element && element[0] && dataset) {
this.dataSelect.emit({ originalEvent: event, element: element[0], dataset: dataset });
}
}
}
initChart = () => {
const opts = this.options || {};
opts.responsive = this.responsive;
// allows chart to resize in responsive mode
if (opts.responsive && (this.height || this.width)) {
opts.maintainAspectRatio = false;
}
this.chart = new Chart(this.canvas.nativeElement, {
type: this.type as any,
data: this.data,
options: this.options,
});
};
getCanvas = () => {
return this.canvas.nativeElement;
};
getBase64Image = () => {
return this.chart.toBase64Image();
};
generateLegend = () => {
if (this.chart) {
return this.chart.generateLegend();
}
};
refresh = () => {
if (this.chart) {
this.chart.update();
this.cdr.detectChanges();
}
};
reinit = () => {
if (!this.chart) return;
this.chart.destroy();
this.initChart();
};
ngOnDestroy() {
if (this.chart) {
this.chart.destroy();
this.chart = null;
}
}
ngOnChanges(changes: SimpleChanges) {
if (!this.chart) return;
if (changes.data?.currentValue || changes.options?.currentValue) {
this.chart.destroy();
this.initChart();
}
}
}

11
npm/ng-packs/packages/components/chart.js/src/chart.module.ts

@ -0,0 +1,11 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ChartComponent } from './chart.component';
@NgModule({
imports: [CommonModule],
exports: [ChartComponent],
declarations: [ChartComponent],
providers: [],
})
export class ChartModule {}

4
npm/ng-packs/packages/components/chart.js/src/public-api.ts

@ -0,0 +1,4 @@
export * from './chart.component';
export * from './chart.module';
export * from './widget-utils';

4
npm/ng-packs/packages/theme-shared/src/lib/utils/widget-utils.ts → npm/ng-packs/packages/components/chart.js/src/widget-utils.ts

@ -1,5 +1,3 @@
import { ReplaySubject } from 'rxjs';
export function getRandomBackgroundColor(count) {
const colors = [];
@ -12,5 +10,3 @@ export function getRandomBackgroundColor(count) {
return colors;
}
export const chartJsLoaded$ = new ReplaySubject(1);

2
npm/ng-packs/packages/components/ng-package.json

@ -4,5 +4,5 @@
"lib": {
"entryFile": "src/public-api.ts"
},
"allowedNonPeerDependencies": ["ng-zorro-antd"]
"allowedNonPeerDependencies": ["ng-zorro-antd", "chart.js"]
}

1
npm/ng-packs/packages/components/package.json

@ -13,6 +13,7 @@
},
"dependencies": {
"ng-zorro-antd": "^12.0.1",
"chart.js": "^3.5.1",
"tslib": "^2.0.0"
},
"publishConfig": {

2
npm/ng-packs/packages/components/src/test-setup.ts

@ -1 +1,3 @@
import 'jest-canvas-mock';
import 'jest-preset-angular/setup-jest';

2
npm/ng-packs/packages/components/tsconfig.json

@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"files": [],
"include": [],
"references": [

2
npm/ng-packs/packages/core/src/lib/core.module.ts

@ -32,6 +32,7 @@ import { TENANT_KEY } from './tokens/tenant-key.token';
import { noop } from './utils/common-utils';
import './utils/date-extensions';
import { getInitialData, localeInitializer } from './utils/initial-utils';
import { CookieLanguageProvider } from './providers/cookie-language.provider';
export function storageFactory(): OAuthStorage {
return oAuthStorage;
@ -131,6 +132,7 @@ export class CoreModule {
ngModule: RootCoreModule,
providers: [
LocaleProvider,
CookieLanguageProvider,
{
provide: 'CORE_OPTIONS',
useValue: options,

23
npm/ng-packs/packages/core/src/lib/providers/cookie-language.provider.ts

@ -0,0 +1,23 @@
import { APP_INITIALIZER, Injector, Provider } from '@angular/core';
import { DOCUMENT } from '@angular/common';
import { SessionStateService } from '../services/session-state.service';
import { COOKIE_LANGUAGE_KEY } from '../tokens/cookie-language-key.token';
export function setLanguageToCookie(injector: Injector) {
return () => {
const sessionState = injector.get(SessionStateService);
const document = injector.get(DOCUMENT);
const cookieLanguageKey = injector.get(COOKIE_LANGUAGE_KEY);
sessionState.getLanguage$().subscribe(language => {
const cookieValue = encodeURIComponent(`c=${language}|uic=${language}`);
document.cookie = `${cookieLanguageKey}=${cookieValue}`;
});
};
}
export const CookieLanguageProvider: Provider = {
provide: APP_INITIALIZER,
useFactory: setLanguageToCookie,
deps: [Injector],
multi: true,
};

1
npm/ng-packs/packages/core/src/lib/providers/index.ts

@ -1 +1,2 @@
export * from './cookie-language.provider';
export * from './locale.provider';

5
npm/ng-packs/packages/core/src/lib/tokens/cookie-language-key.token.ts

@ -0,0 +1,5 @@
import { InjectionToken } from '@angular/core';
export const COOKIE_LANGUAGE_KEY = new InjectionToken<string>('COOKIE_LANGUAGE_KEY', {
factory: () => '.AspNetCore.Culture',
});

3
npm/ng-packs/packages/core/src/lib/tokens/index.ts

@ -1,6 +1,7 @@
export * from './app-config.token';
export * from './cookie-language-key.token';
export * from './list.token';
export * from './lodaer-delay.token';
export * from './manage-profile.token';
export * from './options.token';
export * from './app-config.token';
export * from './tenant-key.token';

2
npm/ng-packs/packages/core/tsconfig.json

@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"files": [],
"include": [],
"references": [

2
npm/ng-packs/packages/feature-management/tsconfig.json

@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"files": [],
"include": [],
"references": [

2
npm/ng-packs/packages/identity/tsconfig.json

@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"files": [],
"include": [],
"references": [

2
npm/ng-packs/packages/permission-management/tsconfig.json

@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"files": [],
"include": [],
"references": [

4
npm/ng-packs/packages/schematics/src/utils/angular/tsconfig.ts

@ -66,11 +66,11 @@ export function addTsConfigProjectReferences(paths: string[]): Rule {
* Throws an exception when the base tsconfig doesn't exists.
*/
export function verifyBaseTsConfigExists(host: Tree): void {
if (host.exists('tsconfig.base.json')) {
if (host.exists('tsconfig.json')) {
return;
}
throw new SchematicsException(
`Cannot find base TypeScript configuration file 'tsconfig.base.json'.`,
`Cannot find base TypeScript configuration file 'tsconfig.json'.`,
);
}

2
npm/ng-packs/packages/setting-management/tsconfig.json

@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"files": [],
"include": [],
"references": [

2
npm/ng-packs/packages/tenant-management/tsconfig.json

@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"files": [],
"include": [],
"references": [

2
npm/ng-packs/packages/theme-basic/tsconfig.json

@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"files": [],
"include": [],
"references": [

3
npm/ng-packs/packages/theme-shared/ng-package.json

@ -11,7 +11,6 @@
"@ng-bootstrap/ng-bootstrap",
"@ngx-validate/core",
"@swimlane/ngx-datatable",
"bootstrap",
"chart.js"
"bootstrap"
]
}

1
npm/ng-packs/packages/theme-shared/package.json

@ -13,7 +13,6 @@
"@ngx-validate/core": "^0.0.13",
"@swimlane/ngx-datatable": "^19.0.0",
"bootstrap": "~4.6.0",
"chart.js": "^2.9.3",
"tslib": "^2.0.0"
},
"publishConfig": {

11
npm/ng-packs/packages/theme-shared/src/lib/components/chart/chart.component.html

@ -1,11 +0,0 @@
<div
style="position:relative"
[style.width]="responsive && !width ? null : width"
[style.height]="responsive && !height ? null : height"
>
<canvas
[attr.width]="responsive && !width ? null : width"
[attr.height]="responsive && !height ? null : height"
(click)="onCanvasClick($event)"
></canvas>
</div>

141
npm/ng-packs/packages/theme-shared/src/lib/components/chart/chart.component.ts

@ -1,141 +0,0 @@
import {
AfterViewInit,
ChangeDetectorRef,
Component,
ElementRef,
EventEmitter,
Input,
OnDestroy,
Output,
} from '@angular/core';
import { BehaviorSubject } from 'rxjs';
import { chartJsLoaded$ } from '../../utils/widget-utils';
declare const Chart: any;
@Component({
selector: 'abp-chart',
templateUrl: './chart.component.html',
})
export class ChartComponent implements AfterViewInit, OnDestroy {
@Input() type: string;
@Input() options: any = {};
@Input() plugins: any[] = [];
@Input() width: string;
@Input() height: string;
@Input() responsive = true;
// eslint-disable-next-line @angular-eslint/no-output-on-prefix
@Output() readonly onDataSelect: EventEmitter<any> = new EventEmitter();
@Output() readonly initialized = new BehaviorSubject(this);
private _initialized: boolean;
_data: any;
chart: any;
constructor(public el: ElementRef, private cdRef: ChangeDetectorRef) {}
@Input() get data(): any {
return this._data;
}
set data(val: any) {
this._data = val;
this.reinit();
}
get canvas() {
return this.el.nativeElement.children[0].children[0];
}
get base64Image() {
return this.chart.toBase64Image();
}
ngAfterViewInit() {
chartJsLoaded$.subscribe(() => {
this.testChartJs();
this.initChart();
this._initialized = true;
});
}
testChartJs() {
try {
Chart;
} catch (error) {
throw new Error(`Chart is not found. Import the Chart from app.module like shown below:
import('chart.js');
`);
}
}
onCanvasClick = event => {
if (this.chart) {
const element = this.chart.getElementAtEvent(event);
const dataset = this.chart.getDatasetAtEvent(event);
if (element && element.length && dataset) {
this.onDataSelect.emit({
originalEvent: event,
element: element[0],
dataset,
});
}
}
};
initChart = () => {
const opts = this.options || {};
opts.responsive = this.responsive;
// allows chart to resize in responsive mode
if (opts.responsive && (this.height || this.width)) {
opts.maintainAspectRatio = false;
}
this.chart = new Chart(this.canvas, {
type: this.type,
data: this.data,
options: this.options,
plugins: this.plugins,
});
this.cdRef.detectChanges();
};
generateLegend = () => {
if (this.chart) {
return this.chart.generateLegend();
}
};
refresh = () => {
if (this.chart) {
this.chart.update();
this.cdRef.detectChanges();
}
};
reinit = () => {
if (this.chart) {
this.chart.destroy();
this.initChart();
}
};
ngOnDestroy() {
if (this.chart) {
this.chart.destroy();
this._initialized = false;
this.chart = null;
}
}
}

3
npm/ng-packs/packages/theme-shared/src/lib/components/index.ts

@ -1,13 +1,12 @@
export * from './breadcrumb/breadcrumb.component';
export * from './button/button.component';
export * from './chart/chart.component';
export * from './confirmation/confirmation.component';
export * from './http-error-wrapper/http-error-wrapper.component';
export * from './loader-bar/loader-bar.component';
export * from './loading/loading.component';
export * from './modal/modal.component';
export * from './modal/modal-close.directive';
export * from './modal/modal-ref.service';
export * from './modal/modal.component';
export * from './sort-order-icon/sort-order-icon.component';
export * from './table-empty-message/table-empty-message.component';
export * from './table/table.component';

14
npm/ng-packs/packages/theme-shared/src/lib/tests/append-content.token.spec.ts

@ -1,9 +1,8 @@
import { DomInsertionService } from '@abp/ng.core';
import { Component } from '@angular/core';
import { createComponentFactory, Spectator } from '@ngneat/spectator';
import { THEME_SHARED_APPEND_CONTENT } from '../tokens/append-content.token';
import { DomInsertionService } from '@abp/ng.core';
import { chartJsLoaded$ } from '../utils';
import styles from '../constants/styles';
import { THEME_SHARED_APPEND_CONTENT } from '../tokens/append-content.token';
@Component({ selector: 'abp-dummy', template: '' })
class DummyComponent {}
@ -18,13 +17,4 @@ describe('AppendContentToken', () => {
spectator.inject(THEME_SHARED_APPEND_CONTENT);
expect(spectator.inject(DomInsertionService).has(styles)).toBe(true);
});
it('should be loaded the chart.js', done => {
chartJsLoaded$.subscribe(loaded => {
expect(loaded).toBe(true);
done();
});
spectator.inject(THEME_SHARED_APPEND_CONTENT);
});
});

2
npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts

@ -12,7 +12,6 @@ import {
import { NgxDatatableModule } from '@swimlane/ngx-datatable';
import { BreadcrumbComponent } from './components/breadcrumb/breadcrumb.component';
import { ButtonComponent } from './components/button/button.component';
import { ChartComponent } from './components/chart/chart.component';
import { ConfirmationComponent } from './components/confirmation/confirmation.component';
import { HttpErrorWrapperComponent } from './components/http-error-wrapper/http-error-wrapper.component';
import { LoaderBarComponent } from './components/loader-bar/loader-bar.component';
@ -43,7 +42,6 @@ import { DateParserFormatter } from './utils/date-parser-formatter';
const declarationsWithExports = [
BreadcrumbComponent,
ButtonComponent,
ChartComponent,
ConfirmationComponent,
LoaderBarComponent,
LoadingComponent,

3
npm/ng-packs/packages/theme-shared/src/lib/tokens/append-content.token.ts

@ -1,7 +1,6 @@
import { CONTENT_STRATEGY, DomInsertionService } from '@abp/ng.core';
import { inject, InjectionToken } from '@angular/core';
import styles from '../constants/styles';
import { chartJsLoaded$ } from '../utils/widget-utils';
export const THEME_SHARED_APPEND_CONTENT = new InjectionToken<void>('THEME_SHARED_APPEND_CONTENT', {
providedIn: 'root',
@ -9,7 +8,5 @@ export const THEME_SHARED_APPEND_CONTENT = new InjectionToken<void>('THEME_SHARE
const domInsertion: DomInsertionService = inject(DomInsertionService);
domInsertion.insertContent(CONTENT_STRATEGY.AppendStyleToHead(styles));
import('chart.js').then(() => chartJsLoaded$.next(true));
},
});

1
npm/ng-packs/packages/theme-shared/src/lib/utils/index.ts

@ -1,3 +1,2 @@
export * from './date-parser-formatter';
export * from './validation-utils';
export * from './widget-utils';

2
npm/ng-packs/packages/theme-shared/src/test-setup.ts

@ -1,2 +1,2 @@
import 'jest-canvas-mock';
import 'jest-preset-angular/setup-jest';

2
npm/ng-packs/packages/theme-shared/tsconfig.json

@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.json",
"files": [],
"include": [],
"references": [

1
npm/ng-packs/tsconfig.base.json → npm/ng-packs/tsconfig.json

@ -17,6 +17,7 @@
"@abp/ng.account.core": ["packages/account-core/src/public-api.ts"],
"@abp/ng.account/config": ["packages/account/config/src/public-api.ts"],
"@abp/ng.components": ["packages/components/src/public-api.ts"],
"@abp/ng.components/chart.js": ["packages/components/chart.js/src/public-api.ts"],
"@abp/ng.components/page": ["packages/components/page/src/public-api.ts"],
"@abp/ng.components/tree": ["packages/components/tree/src/public-api.ts"],
"@abp/ng.core": ["packages/core/src/public-api.ts"],

1084
npm/ng-packs/yarn.lock

File diff suppressed because it is too large

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save