Browse Source

Merge branch 'dev' into studio-dev

pull/10363/head
Yunus Emre Kalkan 5 years ago
parent
commit
225abfa94e
  1. 7
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Response/AbpNoContentActionFilter.cs
  2. 42
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs
  3. 17
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AddModuleInfoOutput.cs
  4. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ModuleInfo.cs
  5. 10
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs
  6. 3
      modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs
  7. 3
      modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj
  8. 3123
      modules/blogging/app/Volo.BloggingTestApp/wwwroot/libs/sweetalert2/sweetalert2.all.js
  9. 2
      modules/blogging/app/Volo.BloggingTestApp/wwwroot/libs/sweetalert2/sweetalert2.all.min.js
  10. 1319
      modules/blogging/app/Volo.BloggingTestApp/wwwroot/libs/sweetalert2/sweetalert2.css
  11. 3121
      modules/blogging/app/Volo.BloggingTestApp/wwwroot/libs/sweetalert2/sweetalert2.js
  12. 1
      modules/blogging/app/Volo.BloggingTestApp/wwwroot/libs/sweetalert2/sweetalert2.min.css
  13. 1
      modules/blogging/app/Volo.BloggingTestApp/wwwroot/libs/sweetalert2/sweetalert2.min.js
  14. 11
      modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Files/ImageFormatHelper.cs
  15. 2
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiScopes/IApiScopeRepository.cs
  16. 2
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/ApiScopes/ApiScopeRepository.cs
  17. 2
      modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/MongoApiScopeRepository.cs
  18. 2
      modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Cache/IdentityServerCacheItemInvalidator_Tests.cs
  19. 2
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/IdentityServer/IdentityServerDataSeedContributor.cs
  20. 2
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/IdentityServer/IdentityServerDataSeedContributor.cs

7
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Response/AbpNoContentActionFilter.cs

@ -18,8 +18,9 @@ namespace Volo.Abp.AspNetCore.Mvc.Response
await next();
if (context.HttpContext.Response.StatusCode == (int)HttpStatusCode.OK
&& context.Result == null)
if (!context.HttpContext.Response.HasStarted &&
context.HttpContext.Response.StatusCode == (int)HttpStatusCode.OK &&
context.Result == null)
{
var returnType = context.ActionDescriptor.GetReturnType();
if (returnType == typeof(Task) || returnType == typeof(void))
@ -29,4 +30,4 @@ namespace Volo.Abp.AspNetCore.Mvc.Response
}
}
}
}
}

42
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs

@ -14,11 +14,25 @@ namespace Volo.Abp.Cli.Commands
{
public class AddModuleCommand : IConsoleCommand, ITransientDependency
{
private AddModuleInfoOutput _lastAddedModuleInfo;
public ILogger<AddModuleCommand> Logger { get; set; }
protected SolutionModuleAdder SolutionModuleAdder { get; }
public SolutionAbpVersionFinder SolutionAbpVersionFinder { get; }
public AddModuleInfoOutput LastAddedModuleInfo
{
get
{
if (_lastAddedModuleInfo == null)
{
throw new Exception("You need to add a module first to get the last added module info!");
}
return _lastAddedModuleInfo;
}
}
public AddModuleCommand(SolutionModuleAdder solutionModuleAdder, SolutionAbpVersionFinder solutionAbpVersionFinder)
{
SolutionModuleAdder = solutionModuleAdder;
@ -51,16 +65,24 @@ namespace Volo.Abp.Cli.Commands
version = SolutionAbpVersionFinder.Find(solutionFile);
}
await SolutionModuleAdder.AddAsync(
solutionFile,
commandLineArgs.Target,
version,
skipDbMigrations,
withSourceCode,
addSourceCodeToSolutionFile,
newTemplate,
newProTemplate
);
var moduleInfo = await SolutionModuleAdder.AddAsync(
solutionFile,
commandLineArgs.Target,
version,
skipDbMigrations,
withSourceCode,
addSourceCodeToSolutionFile,
newTemplate,
newProTemplate
);
_lastAddedModuleInfo = new AddModuleInfoOutput
{
DisplayName = moduleInfo.DisplayName,
Name = moduleInfo.Name,
DocumentationLinks = moduleInfo.DocumentationLinks,
InstallationCompleteMessage = moduleInfo.InstallationCompleteMessage
};
}
public string GetUsageInfo()

17
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AddModuleInfoOutput.cs

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace Volo.Abp.Cli.ProjectModification
{
public class AddModuleInfoOutput
{
public string Name { get; set; }
public string DisplayName { get; set; }
public string DocumentationLinks { get; set; }
public string InstallationCompleteMessage { get; set; }
}
}

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ModuleInfo.cs

@ -18,6 +18,8 @@ namespace Volo.Abp.Cli.ProjectModification
public List<NpmPackageInfo> NpmPackages { get; set; }
public string InstallationCompleteMessage { get; set; }
public string GetFirstDocumentationLinkOrNull()
{
if (string.IsNullOrWhiteSpace(DocumentationLinks))
@ -26,8 +28,8 @@ namespace Volo.Abp.Cli.ProjectModification
}
var docs = DocumentationLinks.Split(" ", StringSplitOptions.RemoveEmptyEntries);
return docs.Any() ?
docs.First() :
return docs.Any() ?
docs.First() :
null;
}
}

10
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs

@ -81,8 +81,7 @@ namespace Volo.Abp.Cli.ProjectModification
Logger = NullLogger<SolutionModuleAdder>.Instance;
}
public virtual async Task AddAsync(
[NotNull] string solutionFile,
public virtual async Task<ModuleWithMastersInfo> AddAsync([NotNull] string solutionFile,
[NotNull] string moduleName,
string version,
bool skipDbMigrations = false,
@ -97,8 +96,7 @@ namespace Volo.Abp.Cli.ProjectModification
var module = await GetModuleInfoAsync(moduleName, newTemplate, newProTemplate);
module = RemoveIncompatiblePackages(module, version);
Logger.LogInformation(
$"Installing module '{module.Name}' to the solution '{Path.GetFileNameWithoutExtension(solutionFile)}'");
Logger.LogInformation($"Installing module '{module.Name}' to the solution '{Path.GetFileNameWithoutExtension(solutionFile)}'");
var projectFiles = ProjectFinder.GetProjectFiles(solutionFile);
@ -140,6 +138,8 @@ namespace Volo.Abp.Cli.ProjectModification
{
CmdHelper.OpenWebPage(documentationLink);
}
return module;
}
private ModuleWithMastersInfo RemoveIncompatiblePackages(ModuleWithMastersInfo module, string version)
@ -149,7 +149,7 @@ namespace Volo.Abp.Cli.ProjectModification
return module;
}
private bool IsPackageInCompatible(string minVersion, string maxVersion, string version)
private static bool IsPackageInCompatible(string minVersion, string maxVersion, string version)
{
try
{

3
modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs

@ -44,8 +44,10 @@ namespace Volo.BloggingTestApp
{
[DependsOn(
typeof(BloggingWebModule),
typeof(BloggingHttpApiModule),
typeof(BloggingApplicationModule),
typeof(BloggingAdminWebModule),
typeof(BloggingAdminHttpApiModule),
typeof(BloggingAdminApplicationModule),
#if MONGODB
typeof(BloggingTestAppMongoDbModule),
@ -55,6 +57,7 @@ namespace Volo.BloggingTestApp
typeof(AbpAccountWebModule),
typeof(AbpAccountApplicationModule),
typeof(AbpIdentityWebModule),
typeof(AbpIdentityHttpApiModule),
typeof(AbpIdentityApplicationModule),
typeof(AbpPermissionManagementDomainIdentityModule),
typeof(AbpPermissionManagementApplicationModule),

3
modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj

@ -24,12 +24,15 @@
<ProjectReference Include="..\Volo.BloggingTestApp.EntityFrameworkCore\Volo.BloggingTestApp.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\src\Volo.Blogging.Application\Volo.Blogging.Application.csproj" />
<ProjectReference Include="..\..\src\Volo.Blogging.Web\Volo.Blogging.Web.csproj" />
<ProjectReference Include="..\..\src\Volo.Blogging.HttpApi\Volo.Blogging.HttpApi.csproj" />
<ProjectReference Include="..\..\src\Volo.Blogging.Admin.Application\Volo.Blogging.Admin.Application.csproj" />
<ProjectReference Include="..\..\src\Volo.Blogging.Admin.Web\Volo.Blogging.Admin.Web.csproj" />
<ProjectReference Include="..\..\src\Volo.Blogging.Admin.HttpApi\Volo.Blogging.Admin.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.HttpApi\Volo.Abp.Identity.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.PermissionManagement.Domain.Identity\Volo.Abp.PermissionManagement.Domain.Identity.csproj" />
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application\Volo.Abp.PermissionManagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Web\Volo.Abp.Account.Web.csproj" />

3123
modules/blogging/app/Volo.BloggingTestApp/wwwroot/libs/sweetalert2/sweetalert2.all.js

File diff suppressed because one or more lines are too long

2
modules/blogging/app/Volo.BloggingTestApp/wwwroot/libs/sweetalert2/sweetalert2.all.min.js

File diff suppressed because one or more lines are too long

1319
modules/blogging/app/Volo.BloggingTestApp/wwwroot/libs/sweetalert2/sweetalert2.css

File diff suppressed because it is too large

3121
modules/blogging/app/Volo.BloggingTestApp/wwwroot/libs/sweetalert2/sweetalert2.js

File diff suppressed because it is too large

1
modules/blogging/app/Volo.BloggingTestApp/wwwroot/libs/sweetalert2/sweetalert2.min.css

File diff suppressed because one or more lines are too long

1
modules/blogging/app/Volo.BloggingTestApp/wwwroot/libs/sweetalert2/sweetalert2.min.js

File diff suppressed because one or more lines are too long

11
modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Files/ImageFormatHelper.cs

@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Drawing.Imaging;
using System.IO;
using System.Runtime.InteropServices;
namespace Volo.Blogging.Areas.Blog.Helpers
{
@ -16,8 +17,14 @@ namespace Volo.Blogging.Areas.Blog.Helpers
public static bool IsValidImage(byte[] fileBytes, ICollection<ImageFormat> validFormats)
{
var imageFormat = GetImageRawFormat(fileBytes);
return validFormats.Contains(imageFormat);
// System.Drawing only works on windows => https://docs.microsoft.com/en-us/dotnet/api/system.drawing.image?view=net-5.0#remarks
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
var imageFormat = GetImageRawFormat(fileBytes);
return validFormats.Contains(imageFormat);
}
return true;
}
}
}

2
modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiScopes/IApiScopeRepository.cs

@ -8,7 +8,7 @@ namespace Volo.Abp.IdentityServer.ApiScopes
{
public interface IApiScopeRepository : IBasicRepository<ApiScope, Guid>
{
Task<ApiScope> GetByNameAsync(
Task<ApiScope> FindByNameAsync(
string scopeName,
bool includeDetails = true,
CancellationToken cancellationToken = default

2
modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/ApiScopes/ApiScopeRepository.cs

@ -18,7 +18,7 @@ namespace Volo.Abp.IdentityServer.ApiScopes
{
}
public async Task<ApiScope> GetByNameAsync(string scopeName, bool includeDetails = true, CancellationToken cancellationToken = default)
public async Task<ApiScope> FindByNameAsync(string scopeName, bool includeDetails = true, CancellationToken cancellationToken = default)
{
return await (await GetDbSetAsync())
.OrderBy(x=>x.Id)

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

@ -20,7 +20,7 @@ namespace Volo.Abp.IdentityServer.MongoDB
{
}
public async Task<ApiScope> GetByNameAsync(string scopeName, bool includeDetails = true, CancellationToken cancellationToken = default)
public async Task<ApiScope> FindByNameAsync(string scopeName, bool includeDetails = true, CancellationToken cancellationToken = default)
{
return await (await GetMongoQueryableAsync(cancellationToken))
.Where(x => x.Name == scopeName)

2
modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Cache/IdentityServerCacheItemInvalidator_Tests.cs

@ -121,7 +121,7 @@ namespace Volo.Abp.IdentityServer.Cache
await _resourceStore.FindApiScopesByNameAsync(testApiScopeNames);
(await _apiScopeCache.GetAsync(testApiScopeName)).ShouldNotBeNull();
var testApiScope = await _apiScopeRepository.GetByNameAsync(testApiScopeName);
var testApiScope = await _apiScopeRepository.FindByNameAsync(testApiScopeName);
await _apiScopeRepository.DeleteAsync(testApiScope);
(await _apiScopeCache.GetAsync(testApiScopeName)).ShouldBeNull();

2
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/IdentityServer/IdentityServerDataSeedContributor.cs

@ -111,7 +111,7 @@ namespace MyCompanyName.MyProjectName.IdentityServer
private async Task<ApiScope> CreateApiScopeAsync(string name)
{
var apiScope = await _apiScopeRepository.GetByNameAsync(name);
var apiScope = await _apiScopeRepository.FindByNameAsync(name);
if (apiScope == null)
{
apiScope = await _apiScopeRepository.InsertAsync(

2
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/IdentityServer/IdentityServerDataSeedContributor.cs

@ -111,7 +111,7 @@ namespace MyCompanyName.MyProjectName.IdentityServer
private async Task<ApiScope> CreateApiScopeAsync(string name)
{
var apiScope = await _apiScopeRepository.GetByNameAsync(name);
var apiScope = await _apiScopeRepository.FindByNameAsync(name);
if (apiScope == null)
{
apiScope = await _apiScopeRepository.InsertAsync(

Loading…
Cancel
Save