Browse Source

Merge branch 'dev' of https://github.com/abpframework/abp into dev

pull/2457/head
Alper Ebicoglu 6 years ago
parent
commit
3b6908c060
  1. 0
      docs/cs/EntityFrameworkCore-PostgreSQL-Integration.md
  2. 2
      docs/cs/docs-nav.json
  3. 0
      docs/en/EntityFrameworkCore-PostgreSQL-Integration.md
  4. 2
      docs/en/docs-nav.json
  5. 2
      docs/pt-BR/docs-nav.json
  6. 0
      docs/zh-Hans/EntityFrameworkCore-PostgreSQL-Integration.md
  7. 2
      docs/zh-Hans/docs-nav.json
  8. 28
      framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/CachedApplicationConfigurationClient.cs
  9. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/ICachedApplicationConfigurationClient.cs
  10. 4
      framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteLocalizationContributor.cs
  11. 4
      framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemotePermissionChecker.cs
  12. 50
      framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteTenantStore.cs
  13. 29
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs
  14. 4
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationController.cs
  15. 14
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationScriptController.cs
  16. 4
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestLocalizationMiddleware.cs
  17. 79
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/DefaultAbpRequestLocalizationOptionsProvider.cs
  18. 3
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/IAbpRequestLocalizationOptionsProvider.cs
  19. 28
      framework/src/Volo.Abp.Authorization/Microsoft/AspNetCore/Authorization/AbpAuthorizationServiceExtensions.cs
  20. 4
      framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionChecker.cs
  21. 5
      framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/IJobQueueManager.cs
  22. 31
      framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueManager.cs
  23. 7
      framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/RabbitMqBackgroundJobManager.cs
  24. 4
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
  25. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs
  26. 28
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs
  27. 8
      framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DependencyInjection/AbpDbContextConfigurationContext.cs
  28. 3
      framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs
  29. 4
      modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingApplicationContractsModule.cs
  30. 4
      modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/UpdateBlogDto.cs
  31. 1
      modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/BlogUserDto.cs
  32. 4
      modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Tagging/Dtos/GetPopularTagsInput.cs
  33. 3
      modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/BloggingDomainSharedModule.cs
  34. 3
      modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainModule.cs
  35. 1
      modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/Posts/EfCorePostRepository.cs
  36. 2
      modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/CommentsController.cs
  37. 1
      modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/PostsController.cs
  38. 1
      modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/TagsController.cs
  39. 1
      modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Comments/MongoCommentRepository.cs
  40. 2
      modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/New.cshtml
  41. 2
      modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/Documents/DocsDocumentController.cs
  42. 12
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs
  43. 5
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUser.cs
  44. 3
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserStore.cs
  45. 2
      modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextModelBuilderExtensions.cs
  46. 19
      modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionStore.cs
  47. 2
      modules/users/src/Volo.Abp.Users.EntityFrameworkCore/Volo/Abp/Users/EntityFrameworkCore/AbpUsersDbContextModelCreatingExtensions.cs
  48. 252
      npm/ng-packs/CHANGELOG.md
  49. 132
      npm/ng-packs/CONTRIBUTING.md
  50. 5
      npm/ng-packs/README.md
  51. 7
      npm/ng-packs/package.json
  52. 1
      npm/ng-packs/packages/account/src/lib/components/index.ts
  53. 1
      npm/ng-packs/packages/account/src/lib/services/index.ts
  54. 1
      npm/ng-packs/packages/account/src/public-api.ts
  55. 8
      npm/ng-packs/packages/core/src/lib/actions/config.actions.ts
  56. 31
      npm/ng-packs/packages/core/src/lib/plugins/config.plugin.ts
  57. 158
      npm/ng-packs/packages/core/src/lib/states/config.state.ts
  58. 13
      npm/ng-packs/packages/core/src/lib/tests/config.plugin.spec.ts
  59. 2
      npm/ng-packs/packages/identity/src/lib/components/index.ts
  60. 4
      npm/ng-packs/packages/identity/src/public-api.ts
  61. 6
      npm/ng-packs/packages/theme-shared/src/lib/components/sort-order-icon/sort-order-icon.component.html
  62. 4
      npm/ng-packs/packages/theme-shared/src/lib/components/sort-order-icon/sort-order-icon.component.ts
  63. 27
      npm/ng-packs/packages/theme-shared/src/lib/constants/styles.ts
  64. 2
      npm/ng-packs/packages/theme-shared/src/lib/tests/sort-order-icon.component.spec.ts
  65. 1
      npm/ng-packs/scripts/package.json
  66. 21
      npm/ng-packs/scripts/prod-build.js
  67. 132
      npm/ng-packs/yarn.lock
  68. 1
      templates/app/angular/src/styles.scss
  69. 6
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20191218090017_Initial.Designer.cs
  70. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20191218090017_Initial.cs
  71. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/MyProjectNameMigrationsDbContextModelSnapshot.cs
  72. 6
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20191218090727_Initial.Designer.cs
  73. 4
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20191218090727_Initial.cs
  74. 4
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs

0
docs/cs/Best-Practices/PostgreSQL-Integration.md → docs/cs/EntityFrameworkCore-PostgreSQL-Integration.md

2
docs/cs/docs-nav.json

@ -264,7 +264,7 @@
"items": [
{
"text": "PostgreSQL integrace",
"path": "Best-Practices/PostgreSQL-Integration.md"
"path": "EntityFrameworkCore-PostgreSQL-Integration.md"
}
]
},

0
docs/en/Best-Practices/PostgreSQL-Integration.md → docs/en/EntityFrameworkCore-PostgreSQL-Integration.md

2
docs/en/docs-nav.json

@ -265,7 +265,7 @@
"items": [
{
"text": "PostgreSQL Integration",
"path": "Best-Practices/PostgreSQL-Integration.md"
"path": "EntityFrameworkCore-PostgreSQL-Integration.md"
}
]
},

2
docs/pt-BR/docs-nav.json

@ -249,7 +249,7 @@
"items": [
{
"text": "Integração do PostgreSQL",
"path": "Best-Practices/PostgreSQL-Integration.md"
"path": "EntityFrameworkCore-PostgreSQL-Integration.md"
}
]
},

0
docs/zh-Hans/Best-Practices/PostgreSQL-Integration.md → docs/zh-Hans/EntityFrameworkCore-PostgreSQL-Integration.md

2
docs/zh-Hans/docs-nav.json

@ -254,7 +254,7 @@
"items": [
{
"text": "PostgreSQL 集成",
"path": "Best-Practices/PostgreSQL-Integration.md"
"path": "EntityFrameworkCore-PostgreSQL-Integration.md"
}
]
},

28
framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/CachedApplicationConfigurationClient.cs

@ -7,6 +7,7 @@ using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations;
using Volo.Abp.Caching;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http.Client.DynamicProxying;
using Volo.Abp.Threading;
using Volo.Abp.Users;
namespace Volo.Abp.AspNetCore.Mvc.Client
@ -30,6 +31,33 @@ namespace Volo.Abp.AspNetCore.Mvc.Client
Cache = cache;
}
public ApplicationConfigurationDto Get()
{
var cacheKey = CreateCacheKey();
var httpContext = HttpContextAccessor?.HttpContext;
if (httpContext != null && httpContext.Items[cacheKey] is ApplicationConfigurationDto configuration)
{
return configuration;
}
configuration = Cache.GetOrAdd(
cacheKey,
() => AsyncHelper.RunSync(Proxy.Service.GetAsync),
() => new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(120) //TODO: Should be configurable. Default value should be higher (5 mins would be good).
}
);
if (httpContext != null)
{
httpContext.Items[cacheKey] = configuration;
}
return configuration;
}
public async Task<ApplicationConfigurationDto> GetAsync()
{
var cacheKey = CreateCacheKey();

2
framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/ICachedApplicationConfigurationClient.cs

@ -5,6 +5,8 @@ namespace Volo.Abp.AspNetCore.Mvc.Client
{
public interface ICachedApplicationConfigurationClient
{
ApplicationConfigurationDto Get();
Task<ApplicationConfigurationDto> GetAsync();
}
}

4
framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteLocalizationContributor.cs

@ -55,9 +55,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Client
private Dictionary<string, string> GetResourceOrNull()
{
var applicationConfigurationDto = AsyncHelper.RunSync(
() => _applicationConfigurationClient.GetAsync()
);
var applicationConfigurationDto = _applicationConfigurationClient.Get();
var resource = applicationConfigurationDto
.Localization.Values

4
framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemotePermissionChecker.cs

@ -21,10 +21,10 @@ namespace Volo.Abp.AspNetCore.Mvc.Client
return configuration.Auth.GrantedPolicies.ContainsKey(name);
}
public Task<bool> IsGrantedAsync(ClaimsPrincipal claimsPrincipal, string name)
public async Task<bool> IsGrantedAsync(ClaimsPrincipal claimsPrincipal, string name)
{
/* This provider always works for the current principal. */
return IsGrantedAsync(name);
return await IsGrantedAsync(name);
}
}
}

50
framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteTenantStore.cs

@ -85,12 +85,58 @@ namespace Volo.Abp.AspNetCore.Mvc.Client
public TenantConfiguration Find(string name)
{
return AsyncHelper.RunSync(() => FindAsync(name));
var cacheKey = CreateCacheKey(name);
var httpContext = HttpContextAccessor?.HttpContext;
if (httpContext != null && httpContext.Items[cacheKey] is TenantConfiguration tenantConfiguration)
{
return tenantConfiguration;
}
tenantConfiguration = Cache.GetOrAdd(
cacheKey,
() => AsyncHelper.RunSync(async () => CreateTenantConfiguration(await Proxy.Service.FindTenantByNameAsync(name))),
() => new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow =
TimeSpan.FromMinutes(5) //TODO: Should be configurable.
}
);
if (httpContext != null)
{
httpContext.Items[cacheKey] = tenantConfiguration;
}
return tenantConfiguration;
}
public TenantConfiguration Find(Guid id)
{
return AsyncHelper.RunSync(() => FindAsync(id));
var cacheKey = CreateCacheKey(id);
var httpContext = HttpContextAccessor?.HttpContext;
if (httpContext != null && httpContext.Items[cacheKey] is TenantConfiguration tenantConfiguration)
{
return tenantConfiguration;
}
tenantConfiguration = Cache.GetOrAdd(
cacheKey,
() => AsyncHelper.RunSync(async () => CreateTenantConfiguration(await Proxy.Service.FindTenantByIdAsync(id))),
() => new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow =
TimeSpan.FromMinutes(5) //TODO: Should be configurable.
}
);
if (httpContext != null)
{
httpContext.Items[cacheKey] = tenantConfiguration;
}
return tenantConfiguration;
}
protected virtual TenantConfiguration CreateTenantConfiguration(FindTenantResultDto tenantResultDto)

29
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs

@ -6,6 +6,7 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Volo.Abp.Application.Services;
using Volo.Abp.Authorization;
using Volo.Abp.Features;
@ -34,7 +35,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
IAuthorizationService authorizationService,
ICurrentUser currentUser,
ISettingProvider settingProvider,
SettingDefinitionManager settingDefinitionManager,
ISettingDefinitionManager settingDefinitionManager,
IFeatureDefinitionManager featureDefinitionManager,
ILanguageProvider languageProvider)
{
@ -76,23 +77,35 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
protected virtual async Task<ApplicationAuthConfigurationDto> GetAuthConfigAsync()
{
Logger.LogDebug("Executing AbpApplicationConfigurationAppService.GetAuthConfigAsync()");
var authConfig = new ApplicationAuthConfigurationDto();
foreach (var policyName in await _abpAuthorizationPolicyProvider.GetPoliciesNamesAsync())
var policyNames = await _abpAuthorizationPolicyProvider.GetPoliciesNamesAsync();
Logger.LogDebug($"GetPoliciesNamesAsync returns {policyNames.Count} items.");
foreach (var policyName in policyNames)
{
authConfig.Policies[policyName] = true;
Logger.LogDebug($"_authorizationService.IsGrantedAsync? {policyName}");
if (await _authorizationService.IsGrantedAsync(policyName))
{
authConfig.GrantedPolicies[policyName] = true;
}
}
Logger.LogDebug("Executed AbpApplicationConfigurationAppService.GetAuthConfigAsync()");
return authConfig;
}
protected virtual async Task<ApplicationLocalizationConfigurationDto> GetLocalizationConfigAsync()
{
Logger.LogDebug("Executing AbpApplicationConfigurationAppService.GetLocalizationConfigAsync()");
var localizationConfig = new ApplicationLocalizationConfigurationDto();
localizationConfig.Languages.AddRange(await _languageProvider.GetLanguagesAsync());
@ -115,12 +128,14 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
localizationConfig.CurrentCulture = GetCurrentCultureInfo();
Logger.LogDebug("Executed AbpApplicationConfigurationAppService.GetLocalizationConfigAsync()");
return localizationConfig;
}
private static CurrentCultureDto GetCurrentCultureInfo()
{
return new CurrentCultureDto
return new CurrentCultureDto
{
Name = CultureInfo.CurrentUICulture.Name,
DisplayName = CultureInfo.CurrentUICulture.DisplayName,
@ -145,6 +160,8 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
private async Task<ApplicationSettingConfigurationDto> GetSettingConfigAsync()
{
Logger.LogDebug("Executing AbpApplicationConfigurationAppService.GetSettingConfigAsync()");
var result = new ApplicationSettingConfigurationDto
{
Values = new Dictionary<string, string>()
@ -160,11 +177,15 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
result.Values[settingDefinition.Name] = await _settingProvider.GetOrNullAsync(settingDefinition.Name);
}
Logger.LogDebug("Executed AbpApplicationConfigurationAppService.GetSettingConfigAsync()");
return result;
}
protected virtual async Task<ApplicationFeatureConfigurationDto> GetFeaturesConfigAsync()
{
Logger.LogDebug("Executing AbpApplicationConfigurationAppService.GetFeaturesConfigAsync()");
var result = new ApplicationFeatureConfigurationDto();
foreach (var featureDefinition in _featureDefinitionManager.GetAll())
@ -177,6 +198,8 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
result.Values[featureDefinition.Name] = await FeatureChecker.GetOrNullAsync(featureDefinition.Name);
}
Logger.LogDebug("Executed AbpApplicationConfigurationAppService.GetFeaturesConfigAsync()");
return result;
}
}

4
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationController.cs

@ -15,9 +15,9 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
}
[HttpGet]
public Task<ApplicationConfigurationDto> GetAsync()
public async Task<ApplicationConfigurationDto> GetAsync()
{
return _applicationConfigurationAppService.GetAsync();
return await _applicationConfigurationAppService.GetAsync();
}
}
}

14
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationScriptController.cs

@ -2,6 +2,7 @@
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Volo.Abp.Auditing;
using Volo.Abp.Http;
using Volo.Abp.Json;
@ -28,12 +29,15 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
[Produces(MimeTypes.Application.Javascript, MimeTypes.Text.Plain)]
public async Task<ActionResult> Get()
{
return Content(
CreateAbpExtendScript(
await _configurationAppService.GetAsync()
),
MimeTypes.Application.Javascript
Logger.LogDebug("Executing AbpApplicationConfigurationScriptController.Get()");
var result = CreateAbpExtendScript(
await _configurationAppService.GetAsync()
);
Logger.LogDebug("Executed AbpApplicationConfigurationScriptController.Get()");
return Content(result, MimeTypes.Application.Javascript);
}
private string CreateAbpExtendScript(ApplicationConfigurationDto config)

4
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestLocalizationMiddleware.cs

@ -25,7 +25,9 @@ namespace Microsoft.AspNetCore.RequestLocalization
{
var middleware = new RequestLocalizationMiddleware(
next,
new OptionsWrapper<RequestLocalizationOptions>(_requestLocalizationOptionsProvider.GetLocalizationOptions()),
new OptionsWrapper<RequestLocalizationOptions>(
await _requestLocalizationOptionsProvider.GetLocalizationOptionsAsync()
),
_loggerFactory
);

79
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/DefaultAbpRequestLocalizationOptionsProvider.cs

@ -2,67 +2,76 @@
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Localization;
using Microsoft.Extensions.DependencyInjection;
using Nito.AsyncEx;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Localization;
using Volo.Abp.Settings;
using Volo.Abp.Threading;
namespace Microsoft.AspNetCore.RequestLocalization
{
public class DefaultAbpRequestLocalizationOptionsProvider : IAbpRequestLocalizationOptionsProvider, ISingletonDependency
{
private readonly IServiceProvider _serviceProvider;
private Lazy<RequestLocalizationOptions> _lazyRequestLocalizationOptions;
private readonly IServiceScopeFactory _serviceProviderFactory;
private readonly SemaphoreSlim _syncSemaphore;
private Action<RequestLocalizationOptions> _optionsAction;
private RequestLocalizationOptions _requestLocalizationOptions;
public DefaultAbpRequestLocalizationOptionsProvider(IServiceProvider serviceProvider)
public DefaultAbpRequestLocalizationOptionsProvider(IServiceScopeFactory serviceProviderFactory)
{
_serviceProvider = serviceProvider;
_serviceProviderFactory = serviceProviderFactory;
_syncSemaphore = new SemaphoreSlim(1, 1);
}
public void InitLocalizationOptions(Action<RequestLocalizationOptions> optionsAction = null)
{
_lazyRequestLocalizationOptions = new Lazy<RequestLocalizationOptions>(() =>
_optionsAction = optionsAction;
}
public async Task<RequestLocalizationOptions> GetLocalizationOptionsAsync()
{
if (_requestLocalizationOptions == null)
{
using (var serviceScope = _serviceProvider.CreateScope())
using (await _syncSemaphore.LockAsync())
{
var languageProvider = serviceScope.ServiceProvider.GetRequiredService<ILanguageProvider>();
var settingProvider = serviceScope.ServiceProvider.GetRequiredService<ISettingProvider>();
using (var serviceScope = _serviceProviderFactory.CreateScope())
{
var languageProvider = serviceScope.ServiceProvider.GetRequiredService<ILanguageProvider>();
var settingProvider = serviceScope.ServiceProvider.GetRequiredService<ISettingProvider>();
var languages = AsyncHelper.RunSync(languageProvider.GetLanguagesAsync);
var defaultLanguage = AsyncHelper.RunSync(() =>
settingProvider.GetOrNullAsync(LocalizationSettingNames.DefaultLanguage));
var languages = await languageProvider.GetLanguagesAsync();
var defaultLanguage = await settingProvider.GetOrNullAsync(LocalizationSettingNames.DefaultLanguage);
var options = !languages.Any()
? new RequestLocalizationOptions()
: new RequestLocalizationOptions
{
DefaultRequestCulture = DefaultGetRequestCulture(defaultLanguage, languages),
var options = !languages.Any()
? new RequestLocalizationOptions()
: new RequestLocalizationOptions
{
DefaultRequestCulture = DefaultGetRequestCulture(defaultLanguage, languages),
SupportedCultures = languages
.Select(l => l.CultureName)
.Distinct()
.Select(c => new CultureInfo(c))
.ToArray(),
SupportedCultures = languages
.Select(l => l.CultureName)
.Distinct()
.Select(c => new CultureInfo(c))
.ToArray(),
SupportedUICultures = languages
.Select(l => l.UiCultureName)
.Distinct()
.Select(c => new CultureInfo(c))
.ToArray()
};
SupportedUICultures = languages
.Select(l => l.UiCultureName)
.Distinct()
.Select(c => new CultureInfo(c))
.ToArray()
};
optionsAction?.Invoke(options);
return options;
_optionsAction?.Invoke(options);
_requestLocalizationOptions = options;
}
}
}, true);
}
}
public RequestLocalizationOptions GetLocalizationOptions()
{
return _lazyRequestLocalizationOptions.Value;
return _requestLocalizationOptions;
}
private static RequestCulture DefaultGetRequestCulture(string defaultLanguage, IReadOnlyList<LanguageInfo> languages)

3
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/IAbpRequestLocalizationOptionsProvider.cs

@ -1,4 +1,5 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
namespace Microsoft.AspNetCore.RequestLocalization
@ -7,6 +8,6 @@ namespace Microsoft.AspNetCore.RequestLocalization
{
void InitLocalizationOptions(Action<RequestLocalizationOptions> optionsAction = null);
RequestLocalizationOptions GetLocalizationOptions();
Task<RequestLocalizationOptions> GetLocalizationOptionsAsync();
}
}

28
framework/src/Volo.Abp.Authorization/Microsoft/AspNetCore/Authorization/AbpAuthorizationServiceExtensions.cs

@ -7,52 +7,54 @@ namespace Microsoft.AspNetCore.Authorization
{
public static class AbpAuthorizationServiceExtensions
{
public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService authorizationService, string policyName)
public static async Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService authorizationService, string policyName)
{
return AuthorizeAsync(
return await AuthorizeAsync(
authorizationService,
authorizationService.AsAbpAuthorizationService().CurrentPrincipal,
null,
policyName
);
}
public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService authorizationService, object resource, IAuthorizationRequirement requirement)
public static async Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService authorizationService, object resource, IAuthorizationRequirement requirement)
{
return authorizationService.AuthorizeAsync(
return await authorizationService.AuthorizeAsync(
authorizationService.AsAbpAuthorizationService().CurrentPrincipal,
resource,
requirement
);
}
public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService authorizationService, object resource, AuthorizationPolicy policy)
public static async Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService authorizationService, object resource, AuthorizationPolicy policy)
{
return authorizationService.AuthorizeAsync(
return await authorizationService.AuthorizeAsync(
authorizationService.AsAbpAuthorizationService().CurrentPrincipal,
resource,
policy
);
}
public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService authorizationService, AuthorizationPolicy policy)
public static async Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService authorizationService, AuthorizationPolicy policy)
{
return AuthorizeAsync(authorizationService, authorizationService.AsAbpAuthorizationService().CurrentPrincipal,
return await AuthorizeAsync(
authorizationService,
null,
policy
);
}
public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService authorizationService, object resource, IEnumerable<IAuthorizationRequirement> requirements)
public static async Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService authorizationService, object resource, IEnumerable<IAuthorizationRequirement> requirements)
{
return authorizationService.AuthorizeAsync(
return await authorizationService.AuthorizeAsync(
authorizationService.AsAbpAuthorizationService().CurrentPrincipal,
resource,
requirements
);
}
public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService authorizationService, object resource, string policyName)
public static async Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService authorizationService, object resource, string policyName)
{
return authorizationService.AuthorizeAsync(
return await authorizationService.AuthorizeAsync(
authorizationService.AsAbpAuthorizationService().CurrentPrincipal,
resource,
policyName

4
framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionChecker.cs

@ -27,9 +27,9 @@ namespace Volo.Abp.Authorization.Permissions
PermissionValueProviderManager = permissionValueProviderManager;
}
public virtual Task<bool> IsGrantedAsync(string name)
public virtual async Task<bool> IsGrantedAsync(string name)
{
return IsGrantedAsync(PrincipalAccessor.Principal, name);
return await IsGrantedAsync(PrincipalAccessor.Principal, name);
}
public virtual async Task<bool> IsGrantedAsync(ClaimsPrincipal claimsPrincipal, string name)

5
framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/IJobQueueManager.cs

@ -1,9 +1,10 @@
using Volo.Abp.Threading;
using System.Threading.Tasks;
using Volo.Abp.Threading;
namespace Volo.Abp.BackgroundJobs.RabbitMQ
{
public interface IJobQueueManager : IRunnable
{
IJobQueue<TArgs> Get<TArgs>();
Task<IJobQueue<TArgs>> GetAsync<TArgs>();
}
}

31
framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueManager.cs

@ -4,6 +4,7 @@ using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Nito.AsyncEx;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Threading;
@ -17,6 +18,8 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
protected AbpBackgroundJobOptions Options { get; }
protected SemaphoreSlim SyncSemaphore { get; }
public JobQueueManager(
IOptions<AbpBackgroundJobOptions> options,
IServiceProvider serviceProvider)
@ -24,6 +27,7 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
ServiceProvider = serviceProvider;
Options = options.Value;
JobQueues = new ConcurrentDictionary<string, IRunnable>();
SyncSemaphore = new SemaphoreSlim(1, 1);
}
public async Task StartAsync(CancellationToken cancellationToken = default)
@ -51,20 +55,31 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
JobQueues.Clear();
}
public IJobQueue<TArgs> Get<TArgs>()
public async Task<IJobQueue<TArgs>> GetAsync<TArgs>()
{
var jobConfiguration = Options.GetJob(typeof(TArgs));
return (IJobQueue<TArgs>)JobQueues.GetOrAdd(jobConfiguration.JobName, _ =>
if (JobQueues.TryGetValue(jobConfiguration.JobName, out var jobQueue))
{
return (IJobQueue<TArgs>)jobQueue;
}
using (await SyncSemaphore.LockAsync())
{
var jobQueue = (IRunnable) ServiceProvider
.GetRequiredService(typeof(IJobQueue<>)
.MakeGenericType(typeof(TArgs)));
if (JobQueues.TryGetValue(jobConfiguration.JobName, out jobQueue))
{
return (IJobQueue<TArgs>)jobQueue;
}
AsyncHelper.RunSync(() => jobQueue.StartAsync());
jobQueue = (IJobQueue<TArgs>)ServiceProvider
.GetRequiredService(typeof(IJobQueue<>).MakeGenericType(typeof(TArgs)));
return jobQueue;
});
await jobQueue.StartAsync();
JobQueues.TryAdd(jobConfiguration.JobName, jobQueue);
return (IJobQueue<TArgs>)jobQueue;
}
}
}
}

7
framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/RabbitMqBackgroundJobManager.cs

@ -14,14 +14,13 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
_jobQueueManager = jobQueueManager;
}
public Task<string> EnqueueAsync<TArgs>(
public async Task<string> EnqueueAsync<TArgs>(
TArgs args,
BackgroundJobPriority priority = BackgroundJobPriority.Normal,
TimeSpan? delay = null)
{
return _jobQueueManager
.Get<TArgs>()
.EnqueueAsync(args, priority, delay);
var jobQueue = await _jobQueueManager.GetAsync<TArgs>();
return await jobQueue.EnqueueAsync(args, priority, delay);
}
}
}

4
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs

@ -165,7 +165,7 @@ namespace Volo.Abp.Cli.Commands
sb.AppendLine(" abp new Acme.BookStore -d mongodb");
sb.AppendLine(" abp new Acme.BookStore -d mongodb -o d:\\my-project");
sb.AppendLine(" abp new Acme.BookStore -t module");
sb.AppendLine(" abp new Acme.BookStore -t module no-ui");
sb.AppendLine(" abp new Acme.BookStore -t module --no-ui");
sb.AppendLine(" abp new Acme.BookStore --local-framework-ref --abp-path \"D:\\github\\abp\"");
sb.AppendLine("");
sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI");
@ -246,4 +246,4 @@ namespace Volo.Abp.Cli.Commands
}
}
}
}
}

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs

@ -1,17 +1,11 @@
using System;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using ICSharpCode.SharpZipLib.Core;
using ICSharpCode.SharpZipLib.Zip;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.Cli.Args;
using Volo.Abp.Cli.Licensing;
using Volo.Abp.Cli.ProjectBuilding;
using Volo.Abp.Cli.ProjectBuilding.Building;
using Volo.Abp.Cli.Utils;
using Volo.Abp.DependencyInjection;

28
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs

@ -5,12 +5,9 @@ using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Volo.Abp.Cli.Args;
using Volo.Abp.Cli.ProjectBuilding.Analyticses;
using Volo.Abp.Cli.ProjectModification;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Json;
namespace Volo.Abp.Cli.Commands
{
@ -20,21 +17,12 @@ namespace Volo.Abp.Cli.Commands
private readonly VoloNugetPackagesVersionUpdater _nugetPackagesVersionUpdater;
private readonly NpmPackagesUpdater _npmPackagesUpdater;
private readonly ICliAnalyticsCollect _cliAnalyticsCollect;
private readonly AbpCliOptions _options;
private readonly IJsonSerializer _jsonSerializer;
public UpdateCommand(VoloNugetPackagesVersionUpdater nugetPackagesVersionUpdater,
NpmPackagesUpdater npmPackagesUpdater,
ICliAnalyticsCollect cliAnalyticsCollect,
IJsonSerializer jsonSerializer,
IOptions<AbpCliOptions> options)
NpmPackagesUpdater npmPackagesUpdater)
{
_nugetPackagesVersionUpdater = nugetPackagesVersionUpdater;
_npmPackagesUpdater = npmPackagesUpdater;
_cliAnalyticsCollect = cliAnalyticsCollect;
_jsonSerializer = jsonSerializer;
_options = options.Value;
Logger = NullLogger<UpdateCommand>.Instance;
}
@ -44,24 +32,18 @@ namespace Volo.Abp.Cli.Commands
var updateNpm = commandLineArgs.Options.ContainsKey(Options.Packages.Npm);
var updateNuget = commandLineArgs.Options.ContainsKey(Options.Packages.NuGet);
var directory = commandLineArgs.Options.GetOrNull(Options.SolutionPath.Short, Options.SolutionPath.Long);
if (directory == null)
{
directory = Directory.GetCurrentDirectory();
}
var directory = commandLineArgs.Options.GetOrNull(Options.SolutionPath.Short, Options.SolutionPath.Long) ??
Directory.GetCurrentDirectory();
var both = (updateNuget && updateNpm) || (!updateNuget && !updateNpm);
if (updateNuget || both)
if (updateNuget || !updateNpm)
{
await UpdateNugetPackages(commandLineArgs, directory);
}
if (updateNpm || both)
if (updateNpm || !updateNuget)
{
UpdateNpmPackages(directory);
}
}
private void UpdateNpmPackages(string directory)

8
framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DependencyInjection/AbpDbContextConfigurationContext.cs

@ -2,6 +2,8 @@
using System.Data.Common;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.EntityFrameworkCore.DependencyInjection
@ -29,7 +31,8 @@ namespace Volo.Abp.EntityFrameworkCore.DependencyInjection
ConnectionStringName = connectionStringName;
ExistingConnection = existingConnection;
DbContextOptions = new DbContextOptionsBuilder();
DbContextOptions = new DbContextOptionsBuilder()
.UseLoggerFactory(serviceProvider.GetRequiredService<ILoggerFactory>());
}
}
@ -49,7 +52,8 @@ namespace Volo.Abp.EntityFrameworkCore.DependencyInjection
connectionStringName,
existingConnection)
{
base.DbContextOptions = new DbContextOptionsBuilder<TDbContext>();
base.DbContextOptions = new DbContextOptionsBuilder<TDbContext>()
.UseLoggerFactory(serviceProvider.GetRequiredService<ILoggerFactory>());
}
}
}

3
framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs

@ -31,8 +31,7 @@ namespace Volo.Abp.Localization
includeParentCultures
);
}
public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures, bool includeBaseLocalizers)
{
return GetAllStrings(

4
modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingApplicationContractsModule.cs

@ -1,6 +1,4 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
using Volo.Blogging.Localization;

4
modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/UpdateBlogDto.cs

@ -1,6 +1,4 @@
using System;
namespace Volo.Blogging.Blogs.Dtos
namespace Volo.Blogging.Blogs.Dtos
{
public class UpdateBlogDto
{

1
modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/BlogUserDto.cs

@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Text;
using Volo.Abp.Application.Dtos;
namespace Volo.Blogging.Posts

4
modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Tagging/Dtos/GetPopularTagsInput.cs

@ -1,6 +1,4 @@
using System;
namespace Volo.Blogging.Tagging.Dtos
namespace Volo.Blogging.Tagging.Dtos
{
public class GetPopularTagsInput
{

3
modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/BloggingDomainSharedModule.cs

@ -1,5 +1,4 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Localization.Resources.AbpValidation;
using Volo.Abp.Modularity;
using Volo.Blogging.Localization;

3
modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainModule.cs

@ -1,5 +1,4 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Domain;
using Volo.Abp.Domain;
using Volo.Abp.Modularity;
namespace Volo.Blogging

1
modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/Posts/EfCorePostRepository.cs

@ -7,7 +7,6 @@ using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Blogging.EntityFrameworkCore;
using System.Linq.Dynamic.Core;
namespace Volo.Blogging.Posts
{

2
modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/CommentsController.cs

@ -1,11 +1,9 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Auditing;
using Volo.Blogging.Comments;
using Volo.Blogging.Comments.Dtos;

1
modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/PostsController.cs

@ -4,7 +4,6 @@ using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Auditing;
using Volo.Blogging.Posts;
namespace Volo.Blogging

1
modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/TagsController.cs

@ -4,7 +4,6 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Auditing;
using Volo.Blogging.Tagging;
using Volo.Blogging.Tagging.Dtos;

1
modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Comments/MongoCommentRepository.cs

@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using MongoDB.Driver;
using MongoDB.Driver.Linq;

2
modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/New.cshtml

@ -14,7 +14,7 @@
}
@section scripts {
<abp-script-bundle name="@typeof(NewModel).FullName" >
<abp-script type="@typeof(TuiEditorScriptContributor)" />
<abp-script type="@typeof(TuiEditorScriptContributor)"/>
<abp-script src="/Pages/Blog/Posts/new.js" />
</abp-script-bundle>
}

2
modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/Documents/DocsDocumentController.cs

@ -46,6 +46,8 @@ namespace Volo.Docs.Documents
return DocumentAppService.GetResourceAsync(input);
}
[HttpGet]
[Route("parameters")]
public Task<DocumentParametersDto> GetParametersAsync(GetParametersDocumentInput input)
{
return DocumentAppService.GetParametersAsync(input);

12
modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs

@ -5,9 +5,11 @@ using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Localization;
using Volo.Docs.Documents;
using Volo.Docs.HtmlConverting;
@ -87,7 +89,15 @@ namespace Volo.Docs.Pages.Documents.Project
DocumentsUrlPrefix = _uiOptions.RoutePrefix;
ShowProjectsCombobox = _uiOptions.ShowProjectsCombobox;
await SetProjectAsync();
try
{
await SetProjectAsync();
}
catch (EntityNotFoundException e)
{
Logger.LogWarning(e.Message);
return NotFound();
}
if (ShowProjectsCombobox)
{

5
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUser.cs

@ -130,16 +130,17 @@ namespace Volo.Abp.Identity
ExtraProperties = new Dictionary<string, object>();
}
public IdentityUser(Guid id, [NotNull] string userName, string email = null, Guid? tenantId = null)
public IdentityUser(Guid id, [NotNull] string userName, [NotNull] string email, Guid? tenantId = null)
{
Check.NotNull(userName, nameof(userName));
Check.NotNull(email, nameof(email));
Id = id;
TenantId = tenantId;
UserName = userName;
NormalizedUserName = userName.ToUpperInvariant();
Email = email;
NormalizedEmail = email?.ToUpperInvariant();
NormalizedEmail = email.ToUpperInvariant();
ConcurrencyStamp = Guid.NewGuid().ToString();
SecurityStamp = Guid.NewGuid().ToString();

3
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserStore.cs

@ -597,11 +597,12 @@ namespace Volo.Abp.Identity
/// <param name="email">The email to set.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
/// <returns>The task object representing the asynchronous operation.</returns>
public virtual Task SetEmailAsync([NotNull] IdentityUser user, string email, CancellationToken cancellationToken = default)
public virtual Task SetEmailAsync([NotNull] IdentityUser user, [NotNull] string email, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
Check.NotNull(user, nameof(user));
Check.NotNull(email, nameof(email));
user.Email = email;

2
modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextModelBuilderExtensions.cs

@ -29,7 +29,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
b.ConfigureAbpUser();
b.Property(u => u.NormalizedUserName).IsRequired().HasMaxLength(IdentityUserConsts.MaxNormalizedUserNameLength).HasColumnName(nameof(IdentityUser.NormalizedUserName));
b.Property(u => u.NormalizedEmail).HasMaxLength(IdentityUserConsts.MaxNormalizedEmailLength).HasColumnName(nameof(IdentityUser.NormalizedEmail));
b.Property(u => u.NormalizedEmail).IsRequired().HasMaxLength(IdentityUserConsts.MaxNormalizedEmailLength).HasColumnName(nameof(IdentityUser.NormalizedEmail));
b.Property(u => u.PasswordHash).HasMaxLength(IdentityUserConsts.MaxPasswordHashLength).HasColumnName(nameof(IdentityUser.PasswordHash));
b.Property(u => u.SecurityStamp).IsRequired().HasMaxLength(IdentityUserConsts.MaxSecurityStampLength).HasColumnName(nameof(IdentityUser.SecurityStamp));
b.Property(u => u.TwoFactorEnabled).HasDefaultValue(false).HasColumnName(nameof(IdentityUser.TwoFactorEnabled));

19
modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionStore.cs

@ -1,4 +1,6 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Caching;
using Volo.Abp.DependencyInjection;
@ -7,16 +9,19 @@ namespace Volo.Abp.PermissionManagement
{
public class PermissionStore : IPermissionStore, ITransientDependency
{
public ILogger<PermissionStore> Logger { get; set; }
protected IPermissionGrantRepository PermissionGrantRepository { get; }
protected IDistributedCache<PermissionGrantCacheItem> Cache { get; }
public PermissionStore(
IPermissionGrantRepository permissionGrantRepository,
IDistributedCache<PermissionGrantCacheItem> cache)
{
PermissionGrantRepository = permissionGrantRepository;
Cache = cache;
Logger = NullLogger<PermissionStore>.Instance;
}
public async Task<bool> IsGrantedAsync(string name, string providerName, string providerKey)
@ -27,23 +32,33 @@ namespace Volo.Abp.PermissionManagement
protected virtual async Task<PermissionGrantCacheItem> GetCacheItemAsync(string name, string providerName, string providerKey)
{
var cacheKey = CalculateCacheKey(name, providerName, providerKey);
Logger.LogDebug($"PermissionStore.GetCacheItemAsync: {cacheKey}");
var cacheItem = await Cache.GetAsync(cacheKey);
if (cacheItem != null)
{
Logger.LogDebug($"Found in the cache: {cacheKey}");
return cacheItem;
}
Logger.LogDebug($"Not found in the cache, getting from the repository: {cacheKey}");
cacheItem = new PermissionGrantCacheItem(
name,
await PermissionGrantRepository.FindAsync(name, providerName, providerKey) != null
(await PermissionGrantRepository.FindAsync(name, providerName, providerKey)) != null
);
Logger.LogDebug($"Setting the cache item: {cacheKey}");
await Cache.SetAsync(
cacheKey,
cacheItem
);
Logger.LogDebug($"Finished setting the cache item: {cacheKey}");
return cacheItem;
}

2
modules/users/src/Volo.Abp.Users.EntityFrameworkCore/Volo/Abp/Users/EntityFrameworkCore/AbpUsersDbContextModelCreatingExtensions.cs

@ -10,7 +10,7 @@ namespace Volo.Abp.Users.EntityFrameworkCore
{
b.Property(u => u.TenantId).HasColumnName(nameof(IUser.TenantId));
b.Property(u => u.UserName).IsRequired().HasMaxLength(AbpUserConsts.MaxUserNameLength).HasColumnName(nameof(IUser.UserName));
b.Property(u => u.Email).HasMaxLength(AbpUserConsts.MaxEmailLength).HasColumnName(nameof(IUser.Email));
b.Property(u => u.Email).IsRequired().HasMaxLength(AbpUserConsts.MaxEmailLength).HasColumnName(nameof(IUser.Email));
b.Property(u => u.Name).HasMaxLength(AbpUserConsts.MaxNameLength).HasColumnName(nameof(IUser.Name));
b.Property(u => u.Surname).HasMaxLength(AbpUserConsts.MaxSurnameLength).HasColumnName(nameof(IUser.Surname));
b.Property(u => u.EmailConfirmed).HasDefaultValue(false).HasColumnName(nameof(IUser.EmailConfirmed));

252
npm/ng-packs/CHANGELOG.md

@ -0,0 +1,252 @@
# [1.1.0](https://github.com/abpframework/abp/compare/1.0.2...1.1.0) (2019-12-06)
### Bug Fixes
* **account:** add header parameter to fetchTokenUsingPasswordFlow method ([3c92489](https://github.com/abpframework/abp/commit/3c924899ca6e5b797bd6536420f75efb61981787))
* **account:** add tenant header to token request ([dce9777](https://github.com/abpframework/abp/commit/dce97779e5c5a343a1a4bb1b2599bb9a0b192d9a))
* **core:** fix add view clear before creating view ([95563de](https://github.com/abpframework/abp/commit/95563de2a414f2b96a52e63e85cf7d256dcccbaa))
* **core:** fix change default insert position in the lazy-load.service ([13a10c2](https://github.com/abpframework/abp/commit/13a10c2cc5dd35ae120492f95de18b182be85eb1))
* **core:** fix abpfor directive filtering bug ([4f4075f](https://github.com/abpframework/abp/commit/4f4075fb2b6f9ec371fbfa85ed61ac1a5af725ef))
* **core:** fix sort pipe key error ([2f53454](https://github.com/abpframework/abp/commit/2f534545bac1d45d8f5e5fd99fee982765db6a4d))
* **core:** fix sort pipe null data problem ([4764750](https://github.com/abpframework/abp/commit/4764750a8c4c38c670d05858e88407b91c5dbe60))
* **core:** fix visibility directive bug ([c1a1bfe](https://github.com/abpframework/abp/commit/c1a1bfe7ee16e3c2e9f71779c4928340c0278a9a))
* **identity:** fix validation display error ([335c74d](https://github.com/abpframework/abp/commit/335c74d80097de5a97913e97230f423768f751ea))
* **module-template:** organize home page [#2265](https://github.com/abpframework/abp/issues/2265) ([1b54da2](https://github.com/abpframework/abp/commit/1b54da232ff86891b54219a58e2ee616a46fbe5f))
* **module-template:** update environments ([b5a13a2](https://github.com/abpframework/abp/commit/b5a13a26580210ab035b344ce30366f1595ae9d3))
* **template:** fix lazyLoadService parameters in app.component ([6f024a9](https://github.com/abpframework/abp/commit/6f024a94df6b882385f8653a17071d4b0eb638c3))
* **tenant-management:** add modalBusy controls ([e75bf30](https://github.com/abpframework/abp/commit/e75bf30aada713697f34feb0c6a49ca25bc3e709)), closes [#2042](https://github.com/abpframework/abp/issues/2042)
* **tenant-management:** add type error control ([f21917a](https://github.com/abpframework/abp/commit/f21917ab2bb5f5dce51dde1a5e9fbbef36bc9f90))
* **theme-basic:** fix layout animations ([66fcb0e](https://github.com/abpframework/abp/commit/66fcb0e0a5bdb6f6ec25171cb0a7e06cb333c9cd))
* **theme-shared:** fix breadcrumb type error ([d7c9a60](https://github.com/abpframework/abp/commit/d7c9a6044c32b7b20232a76c5e98b9d874c79cd7))
* **theme-shared:** fix confirmation yes text localization ([f55862a](https://github.com/abpframework/abp/commit/f55862adca463b9fbd6e3af36738874ed210742e))
* **theme-shared:** fix creating custom error component problem ([2c891d8](https://github.com/abpframework/abp/commit/2c891d84e904f619cc4ac6de834e0dbc666837ee))
* **theme-shared:** fix modal animation and backdrop height ([383c4f6](https://github.com/abpframework/abp/commit/383c4f6a29d2412e9225283b0c2f8d0e8db50936))
* **theme-shared:** fix wrong folder name ([1f8c447](https://github.com/abpframework/abp/commit/1f8c4477cf79d1d891d159580728ce8ea76d6934))
* add finalize operator to set false the modalBusy ([208a5e3](https://github.com/abpframework/abp/commit/208a5e3ab52a828e8a4e37156dd2f927c48b152e)), closes [#2093](https://github.com/abpframework/abp/issues/2093)
* add finalize operator to set false the modalBusy ([3ec86f1](https://github.com/abpframework/abp/commit/3ec86f150e5ef1f9728137eff0aa8210248cb015)), closes [#2093](https://github.com/abpframework/abp/issues/2093)
* fix mistyped config file and selector name ([73fbe7d](https://github.com/abpframework/abp/commit/73fbe7ddf1326f5faa812bae0e79c0726d740d5d))
* move table-sort.directive to theme-shared ([ae31b57](https://github.com/abpframework/abp/commit/ae31b57aa91a45d0b828ae64a7151f7d0b483661)), closes [#2067](https://github.com/abpframework/abp/issues/2067)
* remove console warn ([d2dc069](https://github.com/abpframework/abp/commit/d2dc06982b62f4f7c54848130cdf87df6dab521e))
* update NgxValidate blueprints ([22b1c56](https://github.com/abpframework/abp/commit/22b1c569dd1241a9b74be3c7caf128ce101c4f39))
### Code Refactoring
* **theme-shared:** rename error.component ([d17d6b1](https://github.com/abpframework/abp/commit/d17d6b1c16dca21c682b116d2d3847f10e4856bd))
### Features
* **theme-shared:** add date parser formatter for ng-datepicker ([4769843](https://github.com/abpframework/abp/commit/4769843e305badd5da64efccfb90d1552c576b6f))
* **account:** implement dynamic password rules ([0bde323](https://github.com/abpframework/abp/commit/0bde3233186177662f03e7a2a55236e8d2b2fa69))
* **account:** implement dynamic password validation to register page ([60ed67d](https://github.com/abpframework/abp/commit/60ed67d004acb78041efa9e2a2d20cd83611e803)), closes [#2039](https://github.com/abpframework/abp/issues/2039)
* **account:** implement manage-profile html design ([746c7ce](https://github.com/abpframework/abp/commit/746c7ceda9674f6093a4e833c756eda3ae8c8bdd))
* **account:** implement new login and register html design ([f44773c](https://github.com/abpframework/abp/commit/f44773cca74c22f742f82b64b04d390bec9094c7))
* **core:** add condition check to getGrantedPolicy ([76b7559](https://github.com/abpframework/abp/commit/76b755957598b4a21e1f270538c6137ae1c537ae))
* **core:** add stop-propagation directive test ([d4b5bd9](https://github.com/abpframework/abp/commit/d4b5bd93deadd06d45593ab1f0015f55abedf603))
* **core:** add template ref to permission directive ([eedab03](https://github.com/abpframework/abp/commit/eedab03ad1634097bebf21542071933768b9e5e5))
* **core:** add toLocalISOString function to Date prototype ([9be9401](https://github.com/abpframework/abp/commit/9be940181e2d68bd9bb7af44487b81996f4431ac))
* **core:** add undefined and empty string params control to rest service ([6b78dbf](https://github.com/abpframework/abp/commit/6b78dbff863e92f6c41358fceb25210763571388))
* **core:** support to find requiredPolicy from child route ([a3d751f](https://github.com/abpframework/abp/commit/a3d751f482d4ca4ab9b8a23896b789479376e820))
* **feature-management:** add empty data message ([6e759b8](https://github.com/abpframework/abp/commit/6e759b8829649a4a80a5c82700af9f9baea3763d))
* **identity:** add badges to role list ([a191661](https://github.com/abpframework/abp/commit/a1916615354155a91410da65ff726e762a158887))
* **identity:** implement dynamic password validation to users page ([7d026e5](https://github.com/abpframework/abp/commit/7d026e5e9176511864947ebc8d8c452384e72ee9)), closes [#2039](https://github.com/abpframework/abp/issues/2039)
* **permissin-guard:** add a handling permission condition ([c5fc902](https://github.com/abpframework/abp/commit/c5fc902fb3aa45422d7efb5728d12b0e31b0ff8c))
* **permission-management:** add hideBadges input ([b9d2e5f](https://github.com/abpframework/abp/commit/b9d2e5f6565e95b7b6e73c457d9a6f857277379e))
* **setting-management:** add a pointer class ([80e362a](https://github.com/abpframework/abp/commit/80e362a06d05da9f9ac214e95a46510c713ad5b3))
* **settings-management:** add requiredPolicy to settings page ([04bcc4f](https://github.com/abpframework/abp/commit/04bcc4f4a92a213f737e9104b417fd986d803e69))
* **template:** add insert position parameter in load method of lazyLoadScript ([77e6515](https://github.com/abpframework/abp/commit/77e6515aadd7a9d5fa049237f0d09f6e227aafdf))
* **theme-basic:** add icon to default link template ([0e765bd](https://github.com/abpframework/abp/commit/0e765bd1d73342bb2e7dda17a3e4db00a958b45e))
* **theme-basic:** add two icons ([22051fe](https://github.com/abpframework/abp/commit/22051fe7eb416d1d768bac480031518bde621553))
* **theme-basic:** copy new styles ([6c2df8d](https://github.com/abpframework/abp/commit/6c2df8dfdf1c77a414a7049461ed5006e164c3b3))
* **theme-basic:** implement collapse animation to the user info nav element ([87bad9b](https://github.com/abpframework/abp/commit/87bad9b567e3d10b2ae576c4ab514b3591faeb42))
* **theme-basic:** implement collapseWithMargin animation to the application layout main navigation ([6fa1922](https://github.com/abpframework/abp/commit/6fa19229bbd54a79cf98c06b9cbfe3222c0cd91c))
* **theme-shared:** add collapseLinearWithMargin animation ([91f10ee](https://github.com/abpframework/abp/commit/91f10eec66e8930f144d91bb236776296b624fcc))
* **theme-shared:** add custom component features to error.component ([257cc8f](https://github.com/abpframework/abp/commit/257cc8f4597cef6d0fd530e7a15015a088585ade)), closes [#2097](https://github.com/abpframework/abp/issues/2097)
* **theme-shared:** add destroy subject to custom error component ([707c37c](https://github.com/abpframework/abp/commit/707c37c04d602d743289724198a4ffbffde8fc29)), closes [#2097](https://github.com/abpframework/abp/issues/2097)
* **theme-shared:** add expand classes and implement to layout ([d6c049d](https://github.com/abpframework/abp/commit/d6c049d3bfe5945e9d81e3077124a6f993c9bba6))
* **theme-shared:** add hideCloseIcon property to http error config token ([8365934](https://github.com/abpframework/abp/commit/8365934032c144927ae9ac636dbf1a89db94113c))
* **theme-shared:** add http error config token ([5809d1b](https://github.com/abpframework/abp/commit/5809d1ba01438d3d5bc26c7a67a871c5459d2069))
* **theme-shared:** add id input to button.component ([c7c1efe](https://github.com/abpframework/abp/commit/c7c1efe378cd345a40f6af894c58c648fc7618e8))
* **theme-shared:** add overflow-hidden class ([e0902a1](https://github.com/abpframework/abp/commit/e0902a1a20227e4e8e695303357b29b42b9fd8c8))
* **theme-shared:** add table scroll styles ([fe2d731](https://github.com/abpframework/abp/commit/fe2d73102dd00c73dff4cf21559209fa6297a414))
* add abp-collapsed-height and remove abp-collapsed class ([c0fef92](https://github.com/abpframework/abp/commit/c0fef926621a81962c2670dc1337d8a0c3d1a93f))
* add collapseWithMargin animation ([6f94e73](https://github.com/abpframework/abp/commit/6f94e736e3bcaf70b78fbfcf17e0426c63c80f49))
* add jest.config files ([c116a2d](https://github.com/abpframework/abp/commit/c116a2d21396fc696adfd0a393e0420f62333504))
* implement new home page ([01c8bf9](https://github.com/abpframework/abp/commit/01c8bf9f592e834516204a09ae26e661fde46553))
* update ui design ([7ebb7a0](https://github.com/abpframework/abp/commit/7ebb7a0097e8cc1f84c41078a802c596135e3dcf)), closes [#2024](https://github.com/abpframework/abp/issues/2024)
### BREAKING CHANGES
* **theme-shared:** renamed error.component to http-error-wrapper.component
## [1.0.2](https://github.com/abpframework/abp/compare/1.0.0...1.0.2) (2019-10-22)
### Bug Fixes
* fix manage profile animations ([d41e2e4](https://github.com/abpframework/abp/commit/d41e2e483f4a201ba90709a5a898fe3b8535682e))
# [1.0.0](https://github.com/abpframework/abp/compare/0.22.0...1.0.0) (2019-10-21)
### Bug Fixes
* fix width of table columns ([e182861](https://github.com/abpframework/abp/commit/e1828614702d646feab3e4d73696d894d63bbc55))
### Features
* **setting-management:** create state ([8f358bb](https://github.com/abpframework/abp/commit/8f358bbe0179feaacb80bb9dde79682b69b7eb2f))
* **theme-shared:** add new inputs to button component ([d6efc85](https://github.com/abpframework/abp/commit/d6efc85b8ed88bd7b99025662b5220567d9551cc))
* upgrade font awesome ([e4957fe](https://github.com/abpframework/abp/commit/e4957fe45548b7910996aab2dc6b0f9f425e7c04))
# [0.22.0](https://github.com/abpframework/abp/compare/0.21.0...0.22.0) (2019-10-14)
### Bug Fixes
* **core:** change pipe inputs ([4fa105b](https://github.com/abpframework/abp/commit/4fa105bb77b123ec2861b8f9033bb6f986b960e4))
* **core:** fix localizationInitialize function state selector error ([08d013e](https://github.com/abpframework/abp/commit/08d013ebc419366a272fc2d8d4e5a4c55ed22107))
* **core:** fix state selecting errors ([8967bb4](https://github.com/abpframework/abp/commit/8967bb431001d2cad8abf0200103a9809d6ab815))
* **tenant-management-config:** fix exports ([cecdbfc](https://github.com/abpframework/abp/commit/cecdbfc44ae9186db99cf38ae24d01b15ae4af46))
* **theme-shared:** change color-white css class ([1abe70f](https://github.com/abpframework/abp/commit/1abe70f7f1edef8fb198047ce980ba1cfa360b36))
* **theme-shared:** fix modal styles and animations ([093e62e](https://github.com/abpframework/abp/commit/093e62eb64c5446d13fd78ec68dd4e9d4ebfe684))
* **theme-shared:** remove unnecessary brackets ([d330342](https://github.com/abpframework/abp/commit/d3303420e0485ccfbff02840101b9f686c7cb328))
* **theme-shared:** fix timing bug ([8ddf13e](https://github.com/abpframework/abp/commit/8ddf13ef6546957d7c0679a4df93c26c5076c1b9))
* fix some bugs ([efb6c45](https://github.com/abpframework/abp/commit/efb6c456f6453f715d65876722ad636bb024d12e))
### Code Refactoring
* **core:** convert localization pipe to pure ([bbfc2dc](https://github.com/abpframework/abp/commit/bbfc2dc688ea91662dd54adcdb621c26686dea15))
### Features
* **module-template:** add settings component ([d7713ee](https://github.com/abpframework/abp/commit/d7713ee30836cf667ae96fd8bd8a584f377cab82))
* **core:** add default option to localization ([a92b48d](https://github.com/abpframework/abp/commit/a92b48d6b3f635f0f80fc1d6cc81b30f039b4e40))
* **core:** add sort method to sort.pipe ([6b7f2ae](https://github.com/abpframework/abp/commit/6b7f2ae2ca47001c7f8bd977ea9827c9b273a6ea))
* **core:** add table-sort.directive ([35420bc](https://github.com/abpframework/abp/commit/35420bc4d48d5b2109f5f2c943613cd550fb8255))
* **core:** lazy load service supports url array ([220d411](https://github.com/abpframework/abp/commit/220d41149d4824c3341ee5e946a898f159e45a63))
* **module-template:** add identity, tenant management, setting-management modules ([5c1bcbb](https://github.com/abpframework/abp/commit/5c1bcbb256c0b1b8bb948d256ee5e4c8162d12c3)), closes [#1652](https://github.com/abpframework/abp/issues/1652)
* **templates:** add setting management module ([5c29d1f](https://github.com/abpframework/abp/commit/5c29d1f69f9f94f5ecd473a40b0a049ecc51c4eb)), closes [#1652](https://github.com/abpframework/abp/issues/1652)
* create dev-app ([2c2cd7c](https://github.com/abpframework/abp/commit/2c2cd7c1aa0aee2c63a68dbdad9810a730810810))
* create libraries in the module-template [#1652](https://github.com/abpframework/abp/issues/1652) ([7856b22](https://github.com/abpframework/abp/commit/7856b223533aaedbb9b068ab8116daffa985b70c))
* create module template main app [#1652](https://github.com/abpframework/abp/issues/1652) ([a99496f](https://github.com/abpframework/abp/commit/a99496f2efd229b9250334f7eb9c0371b276fa33))
* seperate 3th party css files from initial bundle ([ac71b2f](https://github.com/abpframework/abp/commit/ac71b2fc6f7ae6e6b7d4e632104af330ab8de484))
# [0.21.0](https://github.com/abpframework/abp/compare/0.20.1...0.21.0) (2019-09-23)
## [0.20.1](https://github.com/abpframework/abp/compare/0.20.0...0.20.1) (2019-09-23)
### Bug Fixes
* **account:** comment to remember me logic ([00b9d01](https://github.com/abpframework/abp/commit/00b9d015cb63c25df85705802a53434fabb1d26c))
* **account:** rename appName ([d5035c4](https://github.com/abpframework/abp/commit/d5035c4400cb1f99d32b79b42d05ffa0d60f26fd))
* **core:** add ng zone to route navigating ([19a1abb](https://github.com/abpframework/abp/commit/19a1abba0cc1d42bdaeb8b654737379223ee61bf))
* **core:** auth guard redirect ([7c14c73](https://github.com/abpframework/abp/commit/7c14c73a392c591b382be34128d9674616284b6f))
* **core:** build error ([0f1424a](https://github.com/abpframework/abp/commit/0f1424a0749debcbd95ccc351fcea17dcb294bdd))
* **core:** change getGrantedPolicy ([148c16b](https://github.com/abpframework/abp/commit/148c16b80b2da07447e089626a75add60ac210ca))
* **core:** localization pipe sync value problem ([efa0a4e](https://github.com/abpframework/abp/commit/efa0a4e1bd5184afc9bebd670aaa8447ca841ce5))
* **feature-management:** npm version ([d4bd43b](https://github.com/abpframework/abp/commit/d4bd43b0f9a9387daeed26853d358f87248ae8f8))
* **feature-management:** remove deleteDestPath from ng-package.json ([e35b801](https://github.com/abpframework/abp/commit/e35b8010ed38a5c72794dc3decffb9d252540bbb))
* **identity:** change actions column minimum width ([8086c1c](https://github.com/abpframework/abp/commit/8086c1c97cd18335c71eb3ae9bf217f8c32fca01))
* **identity:** change template ([3bef365](https://github.com/abpframework/abp/commit/3bef3650f8cbfcfc47894abdf490f12a6dc1fbb5))
* **permission-management:** fix type error ([779e161](https://github.com/abpframework/abp/commit/779e161aa8b9a379295525458fc60b97d2b33629))
* **setting-management:** fix permisson problem ([143a34e](https://github.com/abpframework/abp/commit/143a34e2440dc222158a8d5de8b831c13c2625af))
* **tenant:** add validation to connection string #resolves 1641 ([96386ef](https://github.com/abpframework/abp/commit/96386ef0e6d8c8f7f99b2c9758d6500e36ad409a))
* **tenant-management:** change actions column minimum width ([cb7df88](https://github.com/abpframework/abp/commit/cb7df881e14b563d4721f35b710c2852381438ef))
* add feature-management to angular.json ([03ae5b5](https://github.com/abpframework/abp/commit/03ae5b5ee48da4b7f42384283decf36bd1a22d2d))
* **tenant-management:** change checkbox html element ([97af208](https://github.com/abpframework/abp/commit/97af208f9a9f9d359d73f516ca58759b50254cce))
* **tenant-management:** fix default connection string modal validation issue [#1641](https://github.com/abpframework/abp/issues/1641) ([adf32c1](https://github.com/abpframework/abp/commit/adf32c1cb265c2d2e06d158cf4c0453f041c0f75))
* **theme-basic:** remove unused router ([015e94d](https://github.com/abpframework/abp/commit/015e94daf663ce81b8229a3c019d4f980f76fed9))
* **theme-shared:** change abpButton class from fa-spin to fa-pulse ([ef79664](https://github.com/abpframework/abp/commit/ef796645d96bc6968565497995049314ce2039e8))
* **theme-shared:** change button text colors to white ([9638ef1](https://github.com/abpframework/abp/commit/9638ef107baa7258b2b35e5eafbded4bcbd61b18))
* **theme-shared:** change fade animation name ([683337f](https://github.com/abpframework/abp/commit/683337f6b45442fd8d2edb19fd978aa1bd47170f))
* **theme-shared:** loader bar turning back problem ([38f5f32](https://github.com/abpframework/abp/commit/38f5f320147dcaf781a905b0d67d8634cd89173d))
* **theme-shared:** move chart.js importing in the appendScript function ([1b30f90](https://github.com/abpframework/abp/commit/1b30f90f79b4ac0187baebee1ced73aa1d8dd601))
* **theme-shared:** remove unnecessary css style ([70ec0b3](https://github.com/abpframework/abp/commit/70ec0b3a63c001f94e7eb5de4b1be6fefb625869))
### Reverts
* Revert "fix docs projects combobox link bug" ([0965eb4](https://github.com/abpframework/abp/commit/0965eb43bde4fce27037761cf2150126142a8c86))
# [0.19.0](https://github.com/abpframework/abp/compare/0.18.1...0.19.0) (2019-08-16)
### Bug Fixes
* **account:** tenant-box selection ([26c6901](https://github.com/abpframework/abp/commit/26c69017d9655d82a9d50b08f2acdc9da0d3895a))
* **angular-tutorial:** add some modules in shared.module ([5154e80](https://github.com/abpframework/abp/commit/5154e80add02833627eb44b69f31ac94b49afce6))
* **core:** check if localization key exists ([c80ba38](https://github.com/abpframework/abp/commit/c80ba38d3de0dc2446f32a043cefd70c51c7b513))
* **core:** localization empty return problem ([1afaed3](https://github.com/abpframework/abp/commit/1afaed318d4ef7c27b1106115fe1426b76bea4f4))
* **core:** redirect user to child routes instead of module root route ([298ad36](https://github.com/abpframework/abp/commit/298ad367a30a75be387199d9aca30a9e0dfbe83a))
* remove unnecessary paths ([23b50c6](https://github.com/abpframework/abp/commit/23b50c6eb1e4c6fa9fe228306d24cd19a21104b4))
* **core:** rename directives ([5e4be2a](https://github.com/abpframework/abp/commit/5e4be2ab4fec3e23461986318c7424076bb31e90))
* **core:** store tenant instead of tenant id ([b1c30fd](https://github.com/abpframework/abp/commit/b1c30fdcd15e6b9471d44fcbd2cb65290566ab60))
* **identity:** add localization key to search input placeholder ([c079dbc](https://github.com/abpframework/abp/commit/c079dbcf4f07d73e225d94f8292a837d34b991e2))
* **identity:** change request url ([e23b337](https://github.com/abpframework/abp/commit/e23b3372cdaa60269f8b7bc0ec5a2f04b19a8cb7))
* **identity:** disable input when editing a static role ([c1ab80a](https://github.com/abpframework/abp/commit/c1ab80a3efdd1c6b47fe5ede103b09049c8c6f3e))
* **identity:** hide password field of modal when editing an existing user ([c5508d2](https://github.com/abpframework/abp/commit/c5508d2f25613cb34d7df027a1a98ce7c41625aa))
* **multi-tenancy:** correctly set TenantId on create in AppService ([2a4c319](https://github.com/abpframework/abp/commit/2a4c319081a0f95e8f437a932fb84299d2fcfc9b)), closes [#1360](https://github.com/abpframework/abp/issues/1360)
* **ng-core:** add type error control ([5f24fb8](https://github.com/abpframework/abp/commit/5f24fb86c7704e1c9ea76eb11a575b70c973802a))
* **permission-management:** disabled checkbox bug in permission modal ([774c338](https://github.com/abpframework/abp/commit/774c33886bb1658f494972f7958a36f54e2a9db1))
* **permission-management:** disabled checkboxes ([23aa91d](https://github.com/abpframework/abp/commit/23aa91da5481556c92b48d562afe3736c66c16c6))
* **scripts:** add missing import ([a5048f1](https://github.com/abpframework/abp/commit/a5048f12e4ad7c6ffbb51fb89c439855dcb0e395))
* **tenant-management:** change request urls ([f869794](https://github.com/abpframework/abp/commit/f869794e163ffd3558ab5bae19bfef40cc94e3fc))
* **tenant-management:** fix request search value of abp-button and handle form submit ([0047492](https://github.com/abpframework/abp/commit/00474927dda8a2555104693e3ab4f8f33ec34b60))
* **tenant-management:** prod build error ([0dc1e1f](https://github.com/abpframework/abp/commit/0dc1e1fa87d289ea9f775ef5ad85fb646bed736d))
* **tenant-management:** remove parentName in child route ([c1cefc7](https://github.com/abpframework/abp/commit/c1cefc777ea41a38e2481e7d2b13b1551d9217c4))
* **tenant-management:** rename GetTenant action to GetTenants ([ed7cbc1](https://github.com/abpframework/abp/commit/ed7cbc18487cac5336b089f7efd94d209d192de7))
* **theme-basic:** add pointer class to nav elements ([e1a4a12](https://github.com/abpframework/abp/commit/e1a4a12d611b365d0493880c611fc84866021e59))
* **theme-basic:** change-password and profile modals ([5b6abc5](https://github.com/abpframework/abp/commit/5b6abc517f82af18c3a53a2b070ae4a4526aa9c4))
* **theme-basic:** close navbar dropdowns on window resize ([d49de5f](https://github.com/abpframework/abp/commit/d49de5f88b93ab83f7e969d7adb0a3d668709325))
* **theme-basic:** fix navigation dropdowns ([35cd51a](https://github.com/abpframework/abp/commit/35cd51a92cb6be8b06779ef32b660847639c9664))
* **theme-basic:** navigation dropdown visibility and alignment ([7451adc](https://github.com/abpframework/abp/commit/7451adcada8424621ab39f433524b6bc3d713394))
* **theme-basic:** rename EmptyLayout to EmptyLayoutComponent ([84f5132](https://github.com/abpframework/abp/commit/84f51324153e441a02f9ab45f480f5e6a5bd09ea))
* **theme-basic:** translation keys ([7311801](https://github.com/abpframework/abp/commit/73118018913f0b737ac0e649a1dc5d764daa9c63))
* **theme-shared:** button code quality ([9f9ce58](https://github.com/abpframework/abp/commit/9f9ce5810ef892806f3e31f92ecaacb5e9db7fbc))
* **theme-shared:** button-component disabled attribute ([7272912](https://github.com/abpframework/abp/commit/72729125c1add763537604779964a3630e34af06))
* **theme-shared:** fix accessibility issue with loading state of button component ([60c64fb](https://github.com/abpframework/abp/commit/60c64fb93b250e654c4d51c96e7a9a5b4ba8d585))
* **theme-shared:** improve code quality of error.handler ([2809ec8](https://github.com/abpframework/abp/commit/2809ec8d4e17fdc05e67254346d0dea7fbd08677))
* **theme-shared:** modal component ([9676ea1](https://github.com/abpframework/abp/commit/9676ea1bed44f1399190fe18c56c4110da7fa4e3))
* **theme-shared:** modal component click listening ([ae5c398](https://github.com/abpframework/abp/commit/ae5c398b8ae655d9a6e1d8a08d5b2a827dd73556))
* **theme-shared:** remove constructor function ([eed7807](https://github.com/abpframework/abp/commit/eed7807b8d0b3a9462d85673ca648cc41a4ea5c0))
* **theme-shared:** undo keyup changes ([be16db3](https://github.com/abpframework/abp/commit/be16db3898eef1207a1a0558f1f458cfd2f9d696))
* **theme-shared:** validation-error component ([700d768](https://github.com/abpframework/abp/commit/700d768807d317b68e764a563732ad717dadaae2))
* **user, permission:** bug fix ([0004677](https://github.com/abpframework/abp/commit/0004677796022b0c3b0a2c621aebf56ce0e5280f))
* change peerDependencies to dependencies in tenant-management ([161edb6](https://github.com/abpframework/abp/commit/161edb6f81174b526cb287682ecf81db7c16e382))
* child dropdown width and ellipsis width ([602d24b](https://github.com/abpframework/abp/commit/602d24bbda1c076e4a1c74766e94304fd91e915a))
* localizations ([e5c1f2e](https://github.com/abpframework/abp/commit/e5c1f2e00eb769adda9bf7a8c05995512688f8cd))
* pr feedbacks ([a1b7c6d](https://github.com/abpframework/abp/commit/a1b7c6d730c794c8626f61e1df4647325f646486))
* remove comment lines ([12bd324](https://github.com/abpframework/abp/commit/12bd3244d91637ada5e427f17b0c3891095c5d6c))
* translation keys ([ad092ca](https://github.com/abpframework/abp/commit/ad092ca11d37cf293ec452f6de0e2446b3a27895))
* update commit message sync.js ([6738b26](https://github.com/abpframework/abp/commit/6738b2694ea946f22182d3bb3c0face930497a94))
### Features
* **theme-basic:** change modal ([902731f](https://github.com/abpframework/abp/commit/902731f01d9d30dce0b79808dd85ec433a1ed95c))
* **theme-shared:** change modal style and logic ([ae93dc4](https://github.com/abpframework/abp/commit/ae93dc432ced052c5e88ec486bbe47363b84e5ee))
### Performance Improvements
* **permission-management:** handle attr.disabled while rendering to DOM ([4b09f02](https://github.com/abpframework/abp/commit/4b09f02e096fb39fdb0ca8e752ba25209a035c09))

132
npm/ng-packs/CONTRIBUTING.md

@ -0,0 +1,132 @@
# Contributing to ABP Angular UI
We would love for you to contribute to ABP Angular UI and help make it even better than it is today.
# Development
Run `yarn` to install all dependencies, then run `yarn prepare:workspace` to prepare the ABP packages (might take 2 minutes).
Run `yarn start` to start the `dev-app`. Navigate to http://localhost:4200/.
## Package
[Symlink Manager](https://github.com/mehmet-erim/symlink-manager) is used to manage symbolic link processes. Run `yarn symlink copy` to select the packages to develop.
## Application
The `dev-app` project is the same as the Angular UI template project. `dev-app` is used to see changes instantly.
If you will only develop the `dev-app`, you don't need to run `symlink-manager`.
> Reminder! If you have developed the `dev-app` template, you should do the same for the application and module templates.
For more information, see the [docs.abp.io](https://docs.abp.io)
# Committing changes
Before you commit, please ensure that your code passes the existing unit tests.
New features should be accompanied by new tests.
Every commit should contain only the changes related to the subject of that commit.
## Commit message format
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
format that includes a **type**, a **scope** and a **subject**:
```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```
The **header** is mandatory and the **scope** of the header is optional.
Any line of the commit message cannot be longer 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.
The footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any.
```
docs(changelog): update changelog to beta.5
```
```
fix(release): need to depend on latest rxjs and zone.js
The version in our package.json gets copied to the one we publish, and users need the latest of these.
```
### Revert
If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
### Type
Must be one of the following:
- **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
- **ci**: Changes to our CI configuration files and scripts (example scope: scripts)
- **docs**: Documentation only changes
- **feat**: A new feature
- **fix**: A bug fix
- **perf**: A code change that improves performance
- **refactor**: A code change that neither fixes a bug nor adds a feature
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- **test**: Adding missing tests or correcting existing tests
### Scope
The scope should be the name of the npm package affected (as perceived by the person reading the changelog generated from commit messages).
The following is the list of supported scopes:
- **core**
- **theme-shared**
- **theme-basic**
- **account**
- **identity**
- **tenant-management**
- **feature-management**
- **permission-management**
- **setting-management**
- **account-config**
- **identity-config**
- **setting-management-config**
- **tenant-management-config**
There are currently a few exceptions to the "use package name" rule:
- **packaging**: used for changes that change the npm package layout in all of our packages, e.g.
public path changes, package.json changes done to all packages, d.ts file/format changes, changes
to bundles, etc.
- **scripts**: used for changes that change any script.
- **template**: used for changes that change `dev-app` and `app` template applications.
- **changelog**: used for updating the release notes in CHANGELOG.md
- none/empty string: useful for `style`, `test` and `refactor` changes that are done across all
packages (e.g. `style: add missing semicolons`) and for docs changes that are not related to a
specific package (e.g. `docs: fix typo in tutorial`).
### Subject
The subject contains a succinct description of the change:
- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize the first letter
- no dot (.) at the end
### Body
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
The body should include the motivation for the change and contrast this with previous behavior.
### Footer
The footer should contain any information about **Breaking Changes** and is also the place to
reference GitHub issues that this commit **Closes**.
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
# Thanks for contributing!

5
npm/ng-packs/README.md

@ -1,6 +1,5 @@
<h1> Abp Ng Packages </h1>
## Getting started
Run `yarn` to install all dependencies, then run `yarn prepare:workspace` to prepare the ABP packages (might take 2 minutes).
@ -12,8 +11,6 @@ Run `yarn start` to start the `dev-app`. Navigate to http://localhost:4200/.
### Package
[Symlink Manager](https://github.com/mehmet-erim/symlink-manager) is used to manage symbolic link processes. Run `yarn symlink copy` to select the packages to develop.
> Ignore the changes in the dist folder. The changes should be discarded.
### Application
The `dev-app` project is the same as the Angular UI template project. `dev-app` is used to see changes instantly.
@ -22,3 +19,5 @@ If you will only develop the `dev-app`, you don't need to run `symlink-manager`.
> Reminder! If you have developed the `dev-app` template, you should do the same for the application and module templates.
For more information, see the [docs.abp.io](https://docs.abp.io)
If would you like contribute, see the [contribution guideline](./CONTRIBUTING.md).

7
npm/ng-packs/package.json

@ -9,9 +9,11 @@
"lint": "ng lint",
"scripts:build": "cd scripts && npm install && yarn build",
"prepare:workspace": "yarn scripts:build",
"ci": "yarn prepare:workspace && yarn ci:test && yarn ng lint",
"ci": "yarn prepare:workspace && yarn ci:test && yarn ng lint && yarn ci:build",
"ci:test": "ng test --coverage=false",
"lerna": "lerna"
"ci:build": "cd scripts && yarn build:prod",
"lerna": "lerna",
"generate:changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
},
"devDependencies": {
"@abp/ng.account": "^1.1.1",
@ -57,6 +59,7 @@
"bootstrap": "^4.3.1",
"chart.js": "^2.9.2",
"codelyzer": "^5.1.2",
"conventional-changelog-cli": "^2.0.31",
"cz-conventional-changelog": "3.0.2",
"font-awesome": "^4.7.0",
"jest": "^24.9.0",

1
npm/ng-packs/packages/account/src/lib/components/index.ts

@ -3,3 +3,4 @@ export * from './login/login.component';
export * from './manage-profile/manage-profile.component';
export * from './register/register.component';
export * from './personal-settings/personal-settings.component';
export * from './tenant-box/tenant-box.component';

1
npm/ng-packs/packages/account/src/lib/services/index.ts

@ -0,0 +1 @@
export * from './account.service';

1
npm/ng-packs/packages/account/src/public-api.ts

@ -3,3 +3,4 @@ export * from './lib/components';
export * from './lib/constants/routes';
export * from './lib/tokens';
export * from './lib/models';
export * from './lib/services';

8
npm/ng-packs/packages/core/src/lib/actions/config.actions.ts

@ -8,3 +8,11 @@ export class PatchRouteByName {
export class GetAppConfiguration {
static readonly type = '[Config] Get App Configuration';
}
/**
* @see usage: https://github.com/abpframework/abp/pull/2425#issue-355018812
*/
export class AddRoute {
static readonly type = '[Config] Add Route';
constructor(public payload: Omit<ABP.Route, 'children'>) {}
}

31
npm/ng-packs/packages/core/src/lib/plugins/config.plugin.ts

@ -1,6 +1,13 @@
import { Inject, Injectable, InjectionToken } from '@angular/core';
import { Router, Routes } from '@angular/router';
import { actionMatcher, InitState, NgxsNextPluginFn, NgxsPlugin, setValue, UpdateState } from '@ngxs/store';
import {
actionMatcher,
InitState,
NgxsNextPluginFn,
NgxsPlugin,
setValue,
UpdateState,
} from '@ngxs/store';
import snq from 'snq';
import { ABP } from '../models';
import { organizeRoutes, getAbpRoutes } from '../utils/route-utils';
@ -12,7 +19,10 @@ export const NGXS_CONFIG_PLUGIN_OPTIONS = new InjectionToken('NGXS_CONFIG_PLUGIN
export class ConfigPlugin implements NgxsPlugin {
private initialized = false;
constructor(@Inject(NGXS_CONFIG_PLUGIN_OPTIONS) private options: ABP.Root, private router: Router) {}
constructor(
@Inject(NGXS_CONFIG_PLUGIN_OPTIONS) private options: ABP.Root,
private router: Router,
) {}
handle(state: any, event: any, next: NgxsNextPluginFn) {
const matches = actionMatcher(event);
@ -40,21 +50,16 @@ export class ConfigPlugin implements NgxsPlugin {
}
function transformRoutes(routes: Routes = [], wrappers: ABP.FullRoute[] = []): any {
// TODO: remove in v1
const oldAbpRoutes: ABP.FullRoute[] = routes
.filter(route => {
return snq(() => route.data.routes.routes.find(r => r.path === route.path), false);
})
.reduce((acc, val) => [...acc, ...val.data.routes.routes], []);
// tslint:disable-next-line: deprecation
const abpRoutes = [...getAbpRoutes(), ...oldAbpRoutes];
const abpRoutes = [...getAbpRoutes()];
wrappers = abpRoutes.filter(ar => ar.wrapper);
const transformed = [] as ABP.FullRoute[];
routes
.filter(route => route.component || route.loadChildren)
.forEach(route => {
const abpPackage = abpRoutes.find(abp => abp.path.toLowerCase() === route.path.toLowerCase() && !abp.wrapper);
const abpPackage = abpRoutes.find(
abp => abp.path.toLowerCase() === route.path.toLowerCase() && !abp.wrapper,
);
const { length } = transformed;
@ -77,8 +82,7 @@ function transformRoutes(routes: Routes = [], wrappers: ABP.FullRoute[] = []): a
function setUrls(routes: ABP.FullRoute[], parentUrl?: string): ABP.FullRoute[] {
if (parentUrl) {
// this if block using for only recursive call
// recursive block
return routes.map(route => ({
...route,
url: `${parentUrl}/${route.path}`,
@ -104,6 +108,7 @@ function flatRoutes(routes: ABP.FullRoute[]): ABP.FullRoute[] {
return r.reduce((acc, val) => {
let value: ABP.FullRoute[] = [val];
if (val.children) {
val.children = val.children.map(child => ({ ...child, parentName: val.name }));
value = [val, ...flat(val.children)];
}

158
npm/ng-packs/packages/core/src/lib/states/config.state.ts

@ -1,18 +1,8 @@
import {
Action,
createSelector,
Selector,
State,
StateContext,
Store,
} from '@ngxs/store';
import { Action, createSelector, Selector, State, StateContext, Store } from '@ngxs/store';
import { of } from 'rxjs';
import { switchMap, tap } from 'rxjs/operators';
import snq from 'snq';
import {
GetAppConfiguration,
PatchRouteByName,
} from '../actions/config.actions';
import { GetAppConfiguration, PatchRouteByName, AddRoute } from '../actions/config.actions';
import { SetLanguage } from '../actions/session.actions';
import { ABP } from '../models/common';
import { Config } from '../models/config';
@ -83,12 +73,9 @@ export class ConfigState {
}
static getApiUrl(key?: string) {
const selector = createSelector(
[ConfigState],
(state: Config.State): string => {
return state.environment.apis[key || 'default'].url;
},
);
const selector = createSelector([ConfigState], (state: Config.State): string => {
return state.environment.apis[key || 'default'].url;
});
return selector;
}
@ -104,18 +91,12 @@ export class ConfigState {
const selector = createSelector([ConfigState], (state: Config.State) => {
if (keyword) {
const keys = snq(
() =>
Object.keys(state.setting.values).filter(
key => key.indexOf(keyword) > -1,
),
() => Object.keys(state.setting.values).filter(key => key.indexOf(keyword) > -1),
[],
);
if (keys.length) {
return keys.reduce(
(acc, key) => ({ ...acc, [key]: state.setting.values[key] }),
{},
);
return keys.reduce((acc, key) => ({ ...acc, [key]: state.setting.values[key] }), {});
}
}
@ -125,32 +106,29 @@ export class ConfigState {
}
static getGrantedPolicy(key: string) {
const selector = createSelector(
[ConfigState],
(state: Config.State): boolean => {
if (!key) return true;
const getPolicy = k => snq(() => state.auth.grantedPolicies[k], false);
const selector = createSelector([ConfigState], (state: Config.State): boolean => {
if (!key) return true;
const getPolicy = k => snq(() => state.auth.grantedPolicies[k], false);
const orRegexp = /\|\|/g;
const andRegexp = /&&/g;
const orRegexp = /\|\|/g;
const andRegexp = /&&/g;
if (orRegexp.test(key)) {
const keys = key.split('||').filter(k => !!k);
if (orRegexp.test(key)) {
const keys = key.split('||').filter(k => !!k);
if (keys.length !== 2) return false;
if (keys.length !== 2) return false;
return getPolicy(keys[0].trim()) || getPolicy(keys[1].trim());
} else if (andRegexp.test(key)) {
const keys = key.split('&&').filter(k => !!k);
return getPolicy(keys[0].trim()) || getPolicy(keys[1].trim());
} else if (andRegexp.test(key)) {
const keys = key.split('&&').filter(k => !!k);
if (keys.length !== 2) return false;
if (keys.length !== 2) return false;
return getPolicy(keys[0].trim()) && getPolicy(keys[1].trim());
}
return getPolicy(keys[0].trim()) && getPolicy(keys[1].trim());
}
return getPolicy(key);
},
);
return getPolicy(key);
});
return selector;
}
@ -225,8 +203,7 @@ export class ConfigState {
}),
),
switchMap(configuration => {
let defaultLang: string =
configuration.setting.values['Abp.Localization.DefaultLanguage'];
let defaultLang: string = configuration.setting.values['Abp.Localization.DefaultLanguage'];
if (defaultLang.includes(';')) {
defaultLang = defaultLang.split(';')[0];
@ -246,12 +223,73 @@ export class ConfigState {
) {
let routes: ABP.FullRoute[] = getState().routes;
const index = routes.findIndex(route => route.name === name);
routes = patchRouteDeep(routes, name, newValue);
const flattedRoutes = getState().flattedRoutes;
const index = flattedRoutes.findIndex(route => route.name === name);
if (index > -1) {
flattedRoutes[index] = newValue as ABP.FullRoute;
}
return patchState({
routes,
flattedRoutes,
});
}
@Action(AddRoute)
addRoute({ patchState, getState }: StateContext<Config.State>, { payload }: AddRoute) {
let routes: ABP.FullRoute[] = getState().routes;
const flattedRoutes = getState().flattedRoutes;
const route: ABP.FullRoute = { ...payload };
if (route.parentName) {
const index = flattedRoutes.findIndex(r => r.name === route.parentName);
if (index < 0) return;
const parent = flattedRoutes[index];
if (parent.url.replace('/', '')) {
route.url = `${parent.url}/${route.path}`;
} else {
route.url = `/${route.path}`;
}
route.order = route.order || route.order === 0 ? route.order : parent.children.length;
parent.children = [...(parent.children || []), route].sort((a, b) => a.order - b.order);
flattedRoutes[index] = parent;
flattedRoutes.push(route);
let parentName = parent.name;
const parentNameArr = [parentName];
while (parentName) {
parentName = snq(() => flattedRoutes.find(r => r.name === parentName).parentName);
if (parentName) {
parentNameArr.unshift(parentName);
}
}
routes = updateRouteDeep(routes, parentNameArr, parent);
} else {
route.url = `/${route.path}`;
if (route.order || route.order === 0) {
routes = [...routes, route].sort((a, b) => a.order - b.order);
} else {
route.order = routes.length;
routes = [...routes, route];
}
flattedRoutes.push(route);
}
return patchState({
routes,
flattedRoutes,
});
}
}
@ -295,3 +333,25 @@ function patchRouteDeep(
return organizeRoutes(routes);
}
function updateRouteDeep(
routes: ABP.FullRoute[],
parentNameArr: string[],
newValue: ABP.FullRoute,
parentIndex = 0,
) {
const index = routes.findIndex(route => route.name === parentNameArr[parentIndex]);
if (parentIndex === parentNameArr.length - 1) {
routes[index] = newValue;
} else {
routes[index].children = updateRouteDeep(
routes[index].children,
parentNameArr,
newValue,
parentIndex + 1,
);
}
return routes;
}

13
npm/ng-packs/packages/core/src/lib/tests/config.plugin.spec.ts

@ -170,6 +170,7 @@ const expectedState = {
path: 'users',
name: 'AbpIdentity::Users',
order: 1,
parentName: 'AbpIdentity::Menu:IdentityManagement',
requiredPolicy: 'AbpIdentity.Users',
url: '/identity/users',
},
@ -177,6 +178,7 @@ const expectedState = {
path: 'roles',
name: 'AbpIdentity::Roles',
order: 2,
parentName: 'AbpIdentity::Menu:IdentityManagement',
requiredPolicy: 'AbpIdentity.Roles',
url: '/identity/roles',
},
@ -194,6 +196,7 @@ const expectedState = {
path: 'tenants',
name: 'AbpTenantManagement::Tenants',
order: 1,
parentName: 'AbpTenantManagement::Menu:TenantManagement',
requiredPolicy: 'AbpTenantManagement.Tenants',
url: '/tenant-management/tenants',
},
@ -215,6 +218,7 @@ const expectedState = {
path: 'users',
name: 'AbpIdentity::Users',
order: 1,
parentName: 'AbpIdentity::Menu:IdentityManagement',
requiredPolicy: 'AbpIdentity.Users',
url: '/identity/users',
},
@ -222,6 +226,7 @@ const expectedState = {
path: 'roles',
name: 'AbpIdentity::Roles',
order: 2,
parentName: 'AbpIdentity::Menu:IdentityManagement',
requiredPolicy: 'AbpIdentity.Roles',
url: '/identity/roles',
},
@ -232,6 +237,7 @@ const expectedState = {
path: 'users',
name: 'AbpIdentity::Users',
order: 1,
parentName: 'AbpIdentity::Menu:IdentityManagement',
requiredPolicy: 'AbpIdentity.Users',
url: '/identity/users',
},
@ -239,6 +245,7 @@ const expectedState = {
path: 'roles',
name: 'AbpIdentity::Roles',
order: 2,
parentName: 'AbpIdentity::Menu:IdentityManagement',
requiredPolicy: 'AbpIdentity.Roles',
url: '/identity/roles',
},
@ -253,6 +260,7 @@ const expectedState = {
path: 'tenants',
name: 'AbpTenantManagement::Tenants',
order: 1,
parentName: 'AbpTenantManagement::Menu:TenantManagement',
requiredPolicy: 'AbpTenantManagement.Tenants',
url: '/tenant-management/tenants',
},
@ -264,6 +272,7 @@ const expectedState = {
path: 'tenants',
name: 'AbpTenantManagement::Tenants',
order: 1,
parentName: 'AbpTenantManagement::Menu:TenantManagement',
requiredPolicy: 'AbpTenantManagement.Tenants',
url: '/tenant-management/tenants',
},
@ -277,12 +286,14 @@ const expectedState = {
path: 'login',
name: 'AbpAccount::Login',
order: 1,
parentName: 'AbpAccount::Menu:Account',
url: '/account/login',
},
{
path: 'register',
name: 'AbpAccount::Register',
order: 2,
parentName: 'AbpAccount::Menu:Account',
url: '/account/register',
},
],
@ -293,12 +304,14 @@ const expectedState = {
path: 'login',
name: 'AbpAccount::Login',
order: 1,
parentName: 'AbpAccount::Menu:Account',
url: '/account/login',
},
{
path: 'register',
name: 'AbpAccount::Register',
order: 2,
parentName: 'AbpAccount::Menu:Account',
url: '/account/register',
},
],

2
npm/ng-packs/packages/identity/src/lib/components/index.ts

@ -0,0 +1,2 @@
export * from './roles/roles.component';
export * from './users/users.component';

4
npm/ng-packs/packages/identity/src/public-api.ts

@ -4,8 +4,8 @@
export * from './lib/identity.module';
export * from './lib/actions/identity.actions';
export * from './lib/components/roles/roles.component';
export * from './lib/components';
export * from './lib/constants/routes';
export * from './lib/models/identity';
export * from './lib/services/identity.service';
export * from './lib/services';
export * from './lib/states/identity.state';

6
npm/ng-packs/packages/theme-shared/src/lib/components/sort-order-icon/sort-order-icon.component.html

@ -1,3 +1,3 @@
<span class="float-right {{ iconClass }}">
<i class="fa {{ icon }}"></i>
</span>
<div class="float-right {{ iconClass }}">
<span class="{{ icon }}"></span>
</div>

4
npm/ng-packs/packages/theme-shared/src/lib/components/sort-order-icon/sort-order-icon.component.ts

@ -61,8 +61,8 @@ export class SortOrderIconComponent {
iconClass: string;
get icon(): string {
if (!this.selectedSortKey) return 'fa-sort';
if (this.selectedSortKey === this.sortKey) return `fa-sort-${this.order}`;
if (!this.selectedSortKey) return 'sorting';
if (this.selectedSortKey === this.sortKey) return `sorting_${this.order}`;
else return '';
}

27
npm/ng-packs/packages/theme-shared/src/lib/constants/styles.ts

@ -241,6 +241,33 @@ body abp-toast .ui-toast .ui-toast-message.ui-toast-message-info .ui-toast-messa
max-height: 100vh;
}
[class^="sorting"] {
opacity: .3;
cursor: pointer;
}
[class^="sorting"]:before {
right: 0.5rem;
content: "↑";
}
[class^="sorting"]:after {
right: 0.5rem;
content: "↓";
}
.sorting_desc {
opacity: 1;
}
.sorting_desc:before {
opacity: .3;
}
.sorting_asc {
opacity: 1;
}
.sorting_asc:after {
opacity: .3;
}
@keyframes fadeInTop {
from {
transform: translateY(-5px);

2
npm/ng-packs/packages/theme-shared/src/lib/tests/sort-order-icon.component.spec.ts

@ -24,7 +24,7 @@ describe('SortOrderIconComponent', () => {
component.sort(newKey);
expect(component.selectedSortKey).toBe(newKey);
expect(component.order).toBe('asc');
expect(component.icon).toBe('fa-sort-asc');
expect(component.icon).toBe('sorting_asc');
});
test("shouldn't have any icon class when sortKey and selectedSortKey are different", () => {

1
npm/ng-packs/scripts/package.json

@ -6,6 +6,7 @@
"modules": "[build.js, sync.js]",
"scripts": {
"build": "node -r esm build.js",
"build:prod": "node -r esm prod-build.js",
"publish-packages": "node -r esm publish.js",
"install-new-dependencies": "node -r esm install-new-dependencies.js",
"sync": "node -r esm sync.js",

21
npm/ng-packs/scripts/prod-build.js

@ -0,0 +1,21 @@
// ESM syntax is supported.
import execa from 'execa';
import fse from 'fs-extra';
(async () => {
await execa('yarn', ['install', '--ignore-scripts'], {
stdout: 'inherit',
cwd: '../../../templates/app/angular',
});
await fse.remove('../../../templates/app/angular/node_modules/@abp');
await fse.copy('../node_modules/@abp', '../../../templates/app/angular/node_modules/@abp', {
overwrite: true,
});
await execa('yarn', ['ng', 'build', '--prod'], {
stdout: 'inherit',
cwd: '../../../templates/app/angular',
});
})();

132
npm/ng-packs/yarn.lock

@ -2,26 +2,26 @@
# yarn lockfile v1
"@abp/ng.account.config@1.1.0", "@abp/ng.account.config@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@abp/ng.account.config/-/ng.account.config-1.1.0.tgz#abb8abaf1154147a1b7ff738b7f465fdb148239c"
integrity sha512-Awxodsq2i+O8PKdcFgQzvFz06gKkKU/AcSSprTK2Wj5AKwMNVcTydShh3OLvWPS/gkyp8L7pRfkjPcabZdQlng==
"@abp/ng.account.config@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@abp/ng.account.config/-/ng.account.config-1.1.1.tgz#43de54dd12606a6bc10caace9e430bdb136206b6"
integrity sha512-d0Gj/BtB/YtsVMsyFJI+vcX+KE2CCKNpUQ6YC2rmIwPwOkbqV7UtbzMhxgHoG4lTTfh1pxclIOL6WFzQInI4kg==
dependencies:
tslib "^1.9.0"
"@abp/ng.account@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@abp/ng.account/-/ng.account-1.1.0.tgz#800d1d9755d7942bbc6e8fdd462dce8688048c9c"
integrity sha512-VIZvFCczZ4ixH1x+fqQt2zi5n4/IL5AH5Ud0W+8gZfXVRmOMhOzYct8F2/LLzt/U4qP7Sam8+e/AJPZ3dpq/KQ==
"@abp/ng.account@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@abp/ng.account/-/ng.account-1.1.1.tgz#eddce66856d1133c4d7c04e861be019cfea6b25e"
integrity sha512-EUG7Hiv21KuOMmVSCxUBjMOlno4oYIUtrOUMNK/A/y42cr8UwUFmsu7HEx5J30Z0KWBn7w4vWvAy6KenqzMclQ==
dependencies:
"@abp/ng.account.config" "^1.1.0"
"@abp/ng.theme.shared" "^1.1.0"
"@abp/ng.account.config" "^1.1.1"
"@abp/ng.theme.shared" "^1.1.1"
tslib "^1.9.0"
"@abp/ng.core@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@abp/ng.core/-/ng.core-1.1.0.tgz#80459153723eb0ca05f330f7fcf90c6432399568"
integrity sha512-9AsPOVcL6ZommHc6qG2AZ5JNWYV8q84U4/a9NHofeiOVGQqjiJ287qZfMc2eOqB51/+PdJsodXiyBIQWCtJRPg==
"@abp/ng.core@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@abp/ng.core/-/ng.core-1.1.1.tgz#a08a06fff8fb58a913b619820120d93fa5120a1b"
integrity sha512-oCYQJPmiYr6UjnW6L5Dhd7rl0wvE2ABjWYT70IDLSaFjxHRlQ2exA2kKft4RMkCT0iPNzEfmdHZyqX/8AHCy8Q==
dependencies:
"@ngxs/router-plugin" "^3.5.1"
"@ngxs/storage-plugin" "^3.5.1"
@ -32,86 +32,86 @@
snq "^1.0.3"
tslib "^1.9.0"
"@abp/ng.feature-management@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@abp/ng.feature-management/-/ng.feature-management-1.1.0.tgz#76584c255a8569df6faa2f8172610c3be61eda88"
integrity sha512-WxOhOx4C3itBmQjbBo8M++K411nnu66SpaCKL7Drh4AEU89KbODarrhgtveiKuzZn1Om1WA3p3QZP0uIiiSAiQ==
"@abp/ng.feature-management@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@abp/ng.feature-management/-/ng.feature-management-1.1.1.tgz#d431a62fd677229421137c83e3ce1beb44f9d92c"
integrity sha512-Pji1vp9jWQacrRawBFRh/ao1zXE3ktbGmj1X+nCQ3o6Q7EnNattC7/KC6osqvonpfFDxpjEZP4cMyb3H1wHRIA==
dependencies:
"@abp/ng.theme.shared" "^1.1.0"
"@abp/ng.theme.shared" "^1.1.1"
tslib "^1.9.0"
"@abp/ng.identity.config@1.1.0", "@abp/ng.identity.config@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@abp/ng.identity.config/-/ng.identity.config-1.1.0.tgz#412254ea011d2dd90ee7ffe26ff4a8f0222117ee"
integrity sha512-c2YVhhodT+gGm25JC/M9U13H+3MBUea/jEB9nvTcxU6c2e/bTzj/I5p9jY23xBO6bw6KHuxScNLRbP89XN/jjA==
"@abp/ng.identity.config@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@abp/ng.identity.config/-/ng.identity.config-1.1.1.tgz#da264272ecebfbce99617443048951de317c23f9"
integrity sha512-d5BJBwfHsBoeEYF6dCHeoNVX/nRy1T7HOF6sjkFQN0Jihhk/XOv/r6CpgxnUKasXF0R2wadHrZZZOme6UL7AIw==
dependencies:
tslib "^1.9.0"
"@abp/ng.identity@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@abp/ng.identity/-/ng.identity-1.1.0.tgz#42a4c19079d4475728ff3ba4276aa0e5ea95ba3c"
integrity sha512-R3L5InMRbp+8JUmoYl+MwuH7bwc3jZ7++cfwUq9dZg80MpBbhrQ2Jl99upq2iObsc7oWKrUefz2Hgy0giFH8Wg==
"@abp/ng.identity@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@abp/ng.identity/-/ng.identity-1.1.1.tgz#0776db2a4efe96953a7d46ea697689686c75fbf2"
integrity sha512-Gzz+/kgsDhTTrEMiNqDLSJvjTgk0ATy6Ud7uswoA3RCDlfcksbS5J7kHEsc6TRh6bZ1bC368Zj1F/XS7QAj/iA==
dependencies:
"@abp/ng.identity.config" "^1.1.0"
"@abp/ng.permission-management" "^1.1.0"
"@abp/ng.theme.shared" "^1.1.0"
"@abp/ng.identity.config" "^1.1.1"
"@abp/ng.permission-management" "^1.1.1"
"@abp/ng.theme.shared" "^1.1.1"
tslib "^1.9.0"
"@abp/ng.permission-management@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@abp/ng.permission-management/-/ng.permission-management-1.1.0.tgz#5d1d834b55e8adfa7d412020c1fe5e54f914713f"
integrity sha512-sM0ckVJWylwff0PNnxvZ+7DDNCFW62n5F1A/ydkG8SalByYSVhh8I327fMlKL1WI1gx2cuzWMaZ6gsy90Vx9zw==
"@abp/ng.permission-management@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@abp/ng.permission-management/-/ng.permission-management-1.1.1.tgz#f0184639f9bf37a24c7dc3b18953bac0a521f926"
integrity sha512-3Omhdf/VrYjd4RA9R74ttFP4T+J4Kit8A/PjJIaiwV5j8DJ0WQeBek82P3Q3+EfhuS2ehWuSuz/DYmkcxkt1dw==
dependencies:
"@abp/ng.theme.shared" "^1.1.0"
"@abp/ng.theme.shared" "^1.1.1"
tslib "^1.9.0"
"@abp/ng.setting-management.config@1.1.0", "@abp/ng.setting-management.config@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@abp/ng.setting-management.config/-/ng.setting-management.config-1.1.0.tgz#a6234b3fcc7d6e37de14a4594aaed9ce2a202034"
integrity sha512-YACTSTn8dpCGs0nVBV1EmZM0YTuhY56JSs9wcB8Inmk/y61mtgtorZPSqHxEeJdvuoofQ4w1RTw9MwPgV36aLg==
"@abp/ng.setting-management.config@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@abp/ng.setting-management.config/-/ng.setting-management.config-1.1.1.tgz#6e19cb5f7894d2b6c5193f2e72abdac5be076356"
integrity sha512-QvWo8r+dL+IcQW0nRC7sPNhMCScSHcYPqJotUY1QCanEpXU56JIfPYkOKOtt3cJTA9U2jE2hBmv7fi8yTEy6Pg==
dependencies:
tslib "^1.9.0"
"@abp/ng.setting-management@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@abp/ng.setting-management/-/ng.setting-management-1.1.0.tgz#fec72f72d3e100e3d832dc2929b90c9b0faa40ed"
integrity sha512-8VPk6YoeN/OPJgeZhwYSsIUV+V3vFw/HhAM3pTcg37BSOiW7RI+SyCBrWymkkDzvTy4KtOQmHueo9fa6GvstCQ==
"@abp/ng.setting-management@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@abp/ng.setting-management/-/ng.setting-management-1.1.1.tgz#38cfd7c8b6cc0e29bd3a655e1aecff7e35aca10a"
integrity sha512-kwW9xC7xERo5ZDqGC4TaEXZKiHYZ3lIwGn8wVktX53ulGXrKT9N7BSVP8bBMJnJlIMNg7MpxjOYAR90gXrXdZw==
dependencies:
"@abp/ng.setting-management.config" "^1.1.0"
"@abp/ng.theme.shared" "^1.1.0"
"@abp/ng.setting-management.config" "^1.1.1"
"@abp/ng.theme.shared" "^1.1.1"
tslib "^1.9.0"
"@abp/ng.tenant-management.config@1.1.0", "@abp/ng.tenant-management.config@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@abp/ng.tenant-management.config/-/ng.tenant-management.config-1.1.0.tgz#57c5dfb12a4f93220e56a2ba1af2cf47c11085fc"
integrity sha512-V5pVN0NxYjxq69KDoK2fRqKxeyfnXuICKQQtbf6gqZj4F2X3MwaWuzNVpIJxws8CVW5FfwIf5xtQALrvsmw6rA==
"@abp/ng.tenant-management.config@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@abp/ng.tenant-management.config/-/ng.tenant-management.config-1.1.1.tgz#1aee4705e6ec06954d5d04ad78bb02c636dc36ae"
integrity sha512-KoYPIqsm7a/VrMZumfFKBKYwzZm1zzJeyoWpf84PZ2gvhkuh45gYwvXzMHzQu/HQ6FpJ9+NL7ro/uee1ka+DzQ==
dependencies:
tslib "^1.9.0"
"@abp/ng.tenant-management@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@abp/ng.tenant-management/-/ng.tenant-management-1.1.0.tgz#61ff9f2027a904987c9de747bc7d320f73b81a32"
integrity sha512-90WjxPQJ3mo8+tC/7CIx6JIL4r3EnaaBJqSCPMwbdT7soonKD0vZZZeJwUW+4NTyMMWBqF6eujGLkWYNiJtokg==
"@abp/ng.tenant-management@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@abp/ng.tenant-management/-/ng.tenant-management-1.1.1.tgz#b08a9498957f8dd54a2089d7d4cffafb48753508"
integrity sha512-hjs8U+lRA0y2yVa1tVZgm02kxyQdsmyMtzG8ZB76MFJThmMtf3ogrLHRGZ0etgQHe0bmMjkpdC84wS1VtyK5VA==
dependencies:
"@abp/ng.feature-management" "^1.1.0"
"@abp/ng.tenant-management.config" "^1.1.0"
"@abp/ng.theme.shared" "^1.1.0"
"@abp/ng.feature-management" "^1.1.1"
"@abp/ng.tenant-management.config" "^1.1.1"
"@abp/ng.theme.shared" "^1.1.1"
tslib "^1.9.0"
"@abp/ng.theme.basic@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@abp/ng.theme.basic/-/ng.theme.basic-1.1.0.tgz#70c3ec486affa7c833f56127392adf7989400922"
integrity sha512-Z1TTlv4WmEhXtDE24IPC4BF3/PPCbfE+N/7qSuUMKC1kZ3TRx9Cz8ojKwR8LVW4YsfhDCFmr0u7lI4uAXYnrUA==
"@abp/ng.theme.basic@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@abp/ng.theme.basic/-/ng.theme.basic-1.1.1.tgz#ee3c3a35f4254a0f727b11bb343ceab3aa975773"
integrity sha512-1z13+H2UhIGDsbsd5uyhuBi3v4lxim1yIECZ3HxFJxIKthHO1wlVb8ka8WrIrxj7JBOl6f9srMCzuCNm2rMGLg==
dependencies:
"@abp/ng.theme.shared" "^1.1.0"
"@abp/ng.theme.shared" "^1.1.1"
tslib "^1.9.0"
"@abp/ng.theme.shared@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@abp/ng.theme.shared/-/ng.theme.shared-1.1.0.tgz#8c2eddfd954a43a800c50b62376c224f6d293010"
integrity sha512-MYM2bGAbGeDmalaUWz2S1YITua0jOQ9ZEed2TkwXr6zxnl1/WOcR7cbz8PCwGFPYSmy8e4WwGBVG2QDXW7nf3Q==
"@abp/ng.theme.shared@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@abp/ng.theme.shared/-/ng.theme.shared-1.1.1.tgz#436b9c909a25cc5722c2a639399d05668a241262"
integrity sha512-eQDrznFKwD63cdO/HPSyGMwIFPmGhv4MAEgITyZkUY76g+owYa/tK+GEjpSqsvQsL//qrHqcG+nwuK9RrCBy+A==
dependencies:
"@abp/ng.core" "^1.1.0"
"@abp/ng.core" "^1.1.1"
"@angular/cdk" "^8.2.3"
"@fortawesome/fontawesome-free" "^5.11.2"
"@ng-bootstrap/ng-bootstrap" "^5.1.4"

1
templates/app/angular/src/styles.scss

@ -21,7 +21,6 @@
position: fixed;
top: 50%;
left: 50%;
/* bring your own prefixes */
transform: translate(-50%, -50%);
}
}

6
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20191022082740_Initial.Designer.cs → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20191218090017_Initial.Designer.cs

@ -10,14 +10,14 @@ using MyCompanyName.MyProjectName.EntityFrameworkCore;
namespace MyCompanyName.MyProjectName.Migrations
{
[DbContext(typeof(MyProjectNameMigrationsDbContext))]
[Migration("20191022082740_Initial")]
[Migration("20191218090017_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.0.0")
.HasAnnotation("ProductVersion", "3.1.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
@ -512,6 +512,7 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasColumnType("datetime2");
b.Property<string>("Email")
.IsRequired()
.HasColumnName("Email")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
@ -555,6 +556,7 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasMaxLength(64);
b.Property<string>("NormalizedEmail")
.IsRequired()
.HasColumnName("NormalizedEmail")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20191022082740_Initial.cs → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20191218090017_Initial.cs

@ -184,8 +184,8 @@ namespace MyCompanyName.MyProjectName.Migrations
NormalizedUserName = table.Column<string>(maxLength: 256, nullable: false),
Name = table.Column<string>(maxLength: 64, nullable: true),
Surname = table.Column<string>(maxLength: 64, nullable: true),
Email = table.Column<string>(maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(maxLength: 256, nullable: true),
Email = table.Column<string>(maxLength: 256, nullable: false),
NormalizedEmail = table.Column<string>(maxLength: 256, nullable: false),
EmailConfirmed = table.Column<bool>(nullable: false, defaultValue: false),
PasswordHash = table.Column<string>(maxLength: 256, nullable: true),
SecurityStamp = table.Column<string>(maxLength: 256, nullable: false),

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/MyProjectNameMigrationsDbContextModelSnapshot.cs

@ -15,7 +15,7 @@ namespace MyCompanyName.MyProjectName.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.0.0")
.HasAnnotation("ProductVersion", "3.1.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
@ -510,6 +510,7 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasColumnType("datetime2");
b.Property<string>("Email")
.IsRequired()
.HasColumnName("Email")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
@ -553,6 +554,7 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasMaxLength(64);
b.Property<string>("NormalizedEmail")
.IsRequired()
.HasColumnName("NormalizedEmail")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);

6
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20191127123650_Initial.Designer.cs → templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20191218090727_Initial.Designer.cs

@ -10,14 +10,14 @@ using MyCompanyName.MyProjectName.EntityFrameworkCore;
namespace MyCompanyName.MyProjectName.Migrations
{
[DbContext(typeof(UnifiedDbContext))]
[Migration("20191127123650_Initial")]
[Migration("20191218090727_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.0.0")
.HasAnnotation("ProductVersion", "3.1.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
@ -426,6 +426,7 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasColumnType("datetime2");
b.Property<string>("Email")
.IsRequired()
.HasColumnName("Email")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
@ -469,6 +470,7 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasMaxLength(64);
b.Property<string>("NormalizedEmail")
.IsRequired()
.HasColumnName("NormalizedEmail")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);

4
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20191127123650_Initial.cs → templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20191218090727_Initial.cs

@ -148,8 +148,8 @@ namespace MyCompanyName.MyProjectName.Migrations
NormalizedUserName = table.Column<string>(maxLength: 256, nullable: false),
Name = table.Column<string>(maxLength: 64, nullable: true),
Surname = table.Column<string>(maxLength: 64, nullable: true),
Email = table.Column<string>(maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(maxLength: 256, nullable: true),
Email = table.Column<string>(maxLength: 256, nullable: false),
NormalizedEmail = table.Column<string>(maxLength: 256, nullable: false),
EmailConfirmed = table.Column<bool>(nullable: false, defaultValue: false),
PasswordHash = table.Column<string>(maxLength: 256, nullable: true),
SecurityStamp = table.Column<string>(maxLength: 256, nullable: false),

4
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs

@ -15,7 +15,7 @@ namespace MyCompanyName.MyProjectName.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.0.0")
.HasAnnotation("ProductVersion", "3.1.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
@ -424,6 +424,7 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasColumnType("datetime2");
b.Property<string>("Email")
.IsRequired()
.HasColumnName("Email")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
@ -467,6 +468,7 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasMaxLength(64);
b.Property<string>("NormalizedEmail")
.IsRequired()
.HasColumnName("NormalizedEmail")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);

Loading…
Cancel
Save