Browse Source

Merge remote-tracking branch 'abpframework/dev' into Translate

pull/2905/head
liangshiwei 7 years ago
parent
commit
eb7d27abfd
  1. 7
      abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json
  2. 1
      framework/src/Volo.Abp.Authorization/Microsoft/Extensions/DependencyInjection/AbpAuthorizationServiceCollectionExtensions.cs
  3. 12
      framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AlwaysAllowMethodInvocationAuthorizationService.cs
  4. 48
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/AbpNuGetIndexUrlService.cs
  5. 38
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs
  6. 4
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedAggregateRootWithUser.cs
  7. 4
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedEntityWithUser.cs
  8. 4
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedEntityWithUser.cs
  9. 3
      modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs
  10. 6
      modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Index.cshtml
  11. 2
      modules/users/src/Volo.Abp.Users.Domain/Volo/Abp/Users/UserLookupService.cs

7
abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json

@ -5,8 +5,9 @@
"OrganizationList": "Organization list", "OrganizationList": "Organization list",
"Volo.AbpIo.Commercial:010003": "You are not owner of this organization!", "Volo.AbpIo.Commercial:010003": "You are not owner of this organization!",
"OrganizationNotFoundMessage": "No organization found!", "OrganizationNotFoundMessage": "No organization found!",
"DeveloperCount": "Developer count", "DeveloperCount": "Allocated / total developers",
"QuestionCount": "Question count", "QuestionCount": "Remaining / total questions",
"Unlimited": "Unlimited",
"Owners": "Owners", "Owners": "Owners",
"AddMember": "Add member", "AddMember": "Add member",
"AddOwner": "Add owner", "AddOwner": "Add owner",
@ -30,5 +31,5 @@
"SuccessfullyAddedToNewsletter": "Thanks you for subscribing to our newsletter!", "SuccessfullyAddedToNewsletter": "Thanks you for subscribing to our newsletter!",
"ManageProfile": "Manage your profile", "ManageProfile": "Manage your profile",
"EmailNotValid": "Please enter a valid email address." "EmailNotValid": "Please enter a valid email address."
} }
} }

1
framework/src/Volo.Abp.Authorization/Microsoft/Extensions/DependencyInjection/AbpAuthorizationServiceCollectionExtensions.cs

@ -11,6 +11,7 @@ namespace Microsoft.Extensions.DependencyInjection
{ {
services.Replace(ServiceDescriptor.Singleton<IAuthorizationService, AlwaysAllowAuthorizationService>()); services.Replace(ServiceDescriptor.Singleton<IAuthorizationService, AlwaysAllowAuthorizationService>());
services.Replace(ServiceDescriptor.Singleton<IAbpAuthorizationService, AlwaysAllowAuthorizationService>()); services.Replace(ServiceDescriptor.Singleton<IAbpAuthorizationService, AlwaysAllowAuthorizationService>());
services.Replace(ServiceDescriptor.Singleton<IMethodInvocationAuthorizationService, AlwaysAllowMethodInvocationAuthorizationService>());
return services.Replace(ServiceDescriptor.Singleton<IPermissionChecker, AlwaysAllowPermissionChecker>()); return services.Replace(ServiceDescriptor.Singleton<IPermissionChecker, AlwaysAllowPermissionChecker>());
} }
} }

12
framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AlwaysAllowMethodInvocationAuthorizationService.cs

@ -0,0 +1,12 @@
using System.Threading.Tasks;
namespace Volo.Abp.Authorization
{
public class AlwaysAllowMethodInvocationAuthorizationService : IMethodInvocationAuthorizationService
{
public Task CheckAsync(MethodInvocationAuthorizationContext context)
{
return Task.CompletedTask;
}
}
}

48
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/AbpNuGetIndexUrlService.cs

@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.Cli.Licensing;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.Cli.Commands.Services
{
public class AbpNuGetIndexUrlService : ITransientDependency
{
private readonly IApiKeyService _apiKeyService;
public ILogger<AbpNuGetIndexUrlService> Logger { get; set; }
public AbpNuGetIndexUrlService(IApiKeyService apiKeyService)
{
_apiKeyService = apiKeyService;
Logger = NullLogger<AbpNuGetIndexUrlService>.Instance;
}
public async Task<string> GetAsync()
{
var apiKeyResult = await _apiKeyService.GetApiKeyOrNullAsync();
if (apiKeyResult == null)
{
Logger.LogWarning("You are not signed in! Use the CLI command \"abp login <username>\" to sign in, then try again.");
return null;
}
if (!string.IsNullOrWhiteSpace(apiKeyResult.ErrorMessage))
{
Logger.LogWarning(apiKeyResult.ErrorMessage);
return null;
}
if (string.IsNullOrEmpty(apiKeyResult.ApiKey))
{
Logger.LogError("Couldn't retrieve your NuGet API key! You can re-sign in with the CLI command \"abp login <username>\".");
return null;
}
return CliUrls.GetNuGetServiceIndexUrl(apiKeyResult.ApiKey);
}
}
}

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

@ -1,11 +1,10 @@
using System; using System;
using System.IO;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.Cli.Args; using Volo.Abp.Cli.Args;
using Volo.Abp.Cli.Licensing; using Volo.Abp.Cli.Commands.Services;
using Volo.Abp.Cli.Utils; using Volo.Abp.Cli.Utils;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
@ -13,13 +12,13 @@ namespace Volo.Abp.Cli.Commands
{ {
public class SuiteCommand : IConsoleCommand, ITransientDependency public class SuiteCommand : IConsoleCommand, ITransientDependency
{ {
private readonly AbpNuGetIndexUrlService _nuGetIndexUrlService;
private const string SuitePackageName = "Volo.Abp.Suite"; private const string SuitePackageName = "Volo.Abp.Suite";
public ILogger<SuiteCommand> Logger { get; set; } public ILogger<SuiteCommand> Logger { get; set; }
private readonly IApiKeyService _apiKeyService;
public SuiteCommand(IApiKeyService apiKeyService) public SuiteCommand(AbpNuGetIndexUrlService nuGetIndexUrlService)
{ {
_apiKeyService = apiKeyService; _nuGetIndexUrlService = nuGetIndexUrlService;
Logger = NullLogger<SuiteCommand>.Instance; Logger = NullLogger<SuiteCommand>.Instance;
} }
@ -53,7 +52,7 @@ namespace Volo.Abp.Cli.Commands
private async Task InstallSuiteAsync() private async Task InstallSuiteAsync()
{ {
var nugetIndexUrl = await GetNuGetIndexUrlAsync(); var nugetIndexUrl = await _nuGetIndexUrlService.GetAsync();
if (nugetIndexUrl == null) if (nugetIndexUrl == null)
{ {
@ -71,7 +70,7 @@ namespace Volo.Abp.Cli.Commands
private async Task UpdateSuiteAsync() private async Task UpdateSuiteAsync()
{ {
var nugetIndexUrl = await GetNuGetIndexUrlAsync(); var nugetIndexUrl = await _nuGetIndexUrlService.GetAsync();
if (nugetIndexUrl == null) if (nugetIndexUrl == null)
{ {
@ -104,31 +103,6 @@ namespace Volo.Abp.Cli.Commands
CmdHelper.RunCmd("abp-suite"); CmdHelper.RunCmd("abp-suite");
} }
private async Task<string> GetNuGetIndexUrlAsync()
{
var apiKeyResult = await _apiKeyService.GetApiKeyOrNullAsync();
if (apiKeyResult == null)
{
Logger.LogWarning("You are not signed in! Use the CLI command \"abp login <username>\" to sign in, then try again.");
return null;
}
if (!string.IsNullOrWhiteSpace(apiKeyResult.ErrorMessage))
{
Logger.LogWarning(apiKeyResult.ErrorMessage);
return null;
}
if (string.IsNullOrEmpty(apiKeyResult.ApiKey))
{
Logger.LogError("Couldn't retrieve your NuGet API key! You can re-sign in with the CLI command \"abp login <username>\".");
return null;
}
return CliUrls.GetNuGetServiceIndexUrl(apiKeyResult.ApiKey);
}
public string GetUsageInfo() public string GetUsageInfo()
{ {
var sb = new StringBuilder(); var sb = new StringBuilder();

4
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedAggregateRootWithUser.cs

@ -9,7 +9,7 @@ namespace Volo.Abp.Domain.Entities.Auditing
/// <typeparam name="TUser">Type of the user</typeparam> /// <typeparam name="TUser">Type of the user</typeparam>
[Serializable] [Serializable]
public abstract class AuditedAggregateRootWithUser<TUser> : AuditedAggregateRoot, IAuditedObject<TUser> public abstract class AuditedAggregateRootWithUser<TUser> : AuditedAggregateRoot, IAuditedObject<TUser>
where TUser : IEntity<long> where TUser : IEntity<Guid>
{ {
/// <inheritdoc /> /// <inheritdoc />
public virtual TUser Creator { get; set; } public virtual TUser Creator { get; set; }
@ -25,7 +25,7 @@ namespace Volo.Abp.Domain.Entities.Auditing
/// <typeparam name="TUser">Type of the user</typeparam> /// <typeparam name="TUser">Type of the user</typeparam>
[Serializable] [Serializable]
public abstract class AuditedAggregateRootWithUser<TKey, TUser> : AuditedAggregateRoot<TKey>, IAuditedObject<TUser> public abstract class AuditedAggregateRootWithUser<TKey, TUser> : AuditedAggregateRoot<TKey>, IAuditedObject<TUser>
where TUser : IEntity<long> where TUser : IEntity<Guid>
{ {
/// <inheritdoc /> /// <inheritdoc />
public virtual TUser Creator { get; set; } public virtual TUser Creator { get; set; }

4
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedEntityWithUser.cs

@ -9,7 +9,7 @@ namespace Volo.Abp.Domain.Entities.Auditing
/// <typeparam name="TUser">Type of the user</typeparam> /// <typeparam name="TUser">Type of the user</typeparam>
[Serializable] [Serializable]
public abstract class AuditedEntityWithUser<TUser> : AuditedEntity, IAuditedObject<TUser> public abstract class AuditedEntityWithUser<TUser> : AuditedEntity, IAuditedObject<TUser>
where TUser : IEntity<long> where TUser : IEntity<Guid>
{ {
/// <inheritdoc /> /// <inheritdoc />
public virtual TUser Creator { get; set; } public virtual TUser Creator { get; set; }
@ -25,7 +25,7 @@ namespace Volo.Abp.Domain.Entities.Auditing
/// <typeparam name="TUser">Type of the user</typeparam> /// <typeparam name="TUser">Type of the user</typeparam>
[Serializable] [Serializable]
public abstract class AuditedEntityWithUser<TKey, TUser> : AuditedEntity<TKey>, IAuditedObject<TUser> public abstract class AuditedEntityWithUser<TKey, TUser> : AuditedEntity<TKey>, IAuditedObject<TUser>
where TUser : IEntity<long> where TUser : IEntity<Guid>
{ {
/// <inheritdoc /> /// <inheritdoc />
public virtual TUser Creator { get; set; } public virtual TUser Creator { get; set; }

4
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedEntityWithUser.cs

@ -9,7 +9,7 @@ namespace Volo.Abp.Domain.Entities.Auditing
/// <typeparam name="TUser">Type of the user</typeparam> /// <typeparam name="TUser">Type of the user</typeparam>
[Serializable] [Serializable]
public abstract class FullAuditedEntityWithUser<TUser> : FullAuditedEntity, IFullAuditedObject<TUser> public abstract class FullAuditedEntityWithUser<TUser> : FullAuditedEntity, IFullAuditedObject<TUser>
where TUser : IEntity<long> where TUser : IEntity<Guid>
{ {
/// <inheritdoc /> /// <inheritdoc />
public virtual TUser Deleter { get; set; } public virtual TUser Deleter { get; set; }
@ -28,7 +28,7 @@ namespace Volo.Abp.Domain.Entities.Auditing
/// <typeparam name="TUser">Type of the user</typeparam> /// <typeparam name="TUser">Type of the user</typeparam>
[Serializable] [Serializable]
public abstract class FullAuditedEntityWithUser<TKey, TUser> : FullAuditedEntity<TKey>, IFullAuditedObject<TUser> public abstract class FullAuditedEntityWithUser<TKey, TUser> : FullAuditedEntity<TKey>, IFullAuditedObject<TUser>
where TUser : IEntity<long> where TUser : IEntity<Guid>
{ {
/// <inheritdoc /> /// <inheritdoc />
public virtual TUser Deleter { get; set; } public virtual TUser Deleter { get; set; }

3
modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs

@ -106,6 +106,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
HttpStatusCode? httpStatusCode = null, HttpStatusCode? httpStatusCode = null,
bool includeDetails = false) bool includeDetails = false)
{ {
var nHttpStatusCode = (int?) httpStatusCode;
return DbSet.AsNoTracking() return DbSet.AsNoTracking()
.IncludeDetails(includeDetails) .IncludeDetails(includeDetails)
.WhereIf(startTime.HasValue, auditLog => auditLog.ExecutionTime >= startTime) .WhereIf(startTime.HasValue, auditLog => auditLog.ExecutionTime >= startTime)
@ -117,7 +118,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
.WhereIf(userName != null, auditLog => auditLog.UserName == userName) .WhereIf(userName != null, auditLog => auditLog.UserName == userName)
.WhereIf(applicationName != null, auditLog => auditLog.ApplicationName == applicationName) .WhereIf(applicationName != null, auditLog => auditLog.ApplicationName == applicationName)
.WhereIf(correlationId != null, auditLog => auditLog.CorrelationId == correlationId) .WhereIf(correlationId != null, auditLog => auditLog.CorrelationId == correlationId)
.WhereIf(httpStatusCode != null && httpStatusCode > 0, auditLog => auditLog.HttpStatusCode == (int?)httpStatusCode) .WhereIf(httpStatusCode != null && httpStatusCode > 0, auditLog => auditLog.HttpStatusCode == nHttpStatusCode)
.WhereIf(maxExecutionDuration != null && maxExecutionDuration.Value > 0, auditLog => auditLog.ExecutionDuration <= maxExecutionDuration) .WhereIf(maxExecutionDuration != null && maxExecutionDuration.Value > 0, auditLog => auditLog.ExecutionDuration <= maxExecutionDuration)
.WhereIf(minExecutionDuration != null && minExecutionDuration.Value > 0, auditLog => auditLog.ExecutionDuration >= minExecutionDuration); .WhereIf(minExecutionDuration != null && minExecutionDuration.Value > 0, auditLog => auditLog.ExecutionDuration >= minExecutionDuration);
} }

6
modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Index.cshtml

@ -142,15 +142,15 @@
var oddPost = index % 2 == 1; var oddPost = index % 2 == 1;
<div class="list-group-item"> <div class="list-group-item">
<div class="row @(oddPost ? "align-middle" : "")"> <div class="row">
<div class="col-md-4 order-md-@(oddPost ? "last" : "first")"> <div class="col-md-4">
<div class="img-container"> <div class="img-container">
<a asp-page="./Detail" asp-route-postUrl="@post.Url" asp-route-blogShortName="@Model.BlogShortName"> <a asp-page="./Detail" asp-route-postUrl="@post.Url" asp-route-blogShortName="@Model.BlogShortName">
<img src="@post.CoverImage" class="box-article-img"> <img src="@post.CoverImage" class="box-article-img">
</a> </a>
</div> </div>
</div> </div>
<div class="col order-md-@(oddPost ? "first" : "last")"> <div class="col">
<h3> <h3>
<a asp-page="./Detail" asp-route-postUrl="@post.Url" asp-route-blogShortName="@Model.BlogShortName">@post.Title</a> <a asp-page="./Detail" asp-route-postUrl="@post.Url" asp-route-blogShortName="@Model.BlogShortName">@post.Title</a>
</h3> </h3>

2
modules/users/src/Volo.Abp.Users.Domain/Volo/Abp/Users/UserLookupService.cs

@ -149,4 +149,4 @@ namespace Volo.Abp.Users
} }
} }
} }
} }

Loading…
Cancel
Save