Browse Source

Move AddViewLocalization to the framework.

pull/217/head
Halil İbrahim Kalkan 8 years ago
parent
commit
429d80f379
  1. 1
      src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs
  2. 16
      src/MicroserviceDemo/MicroserviceDemo.Web/Controllers/AccountController.cs
  3. 8
      src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs
  4. 2
      src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs
  5. 3
      src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs
  6. 8
      test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs

1
src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs

@ -61,7 +61,6 @@ namespace AbpDesk.Web.Mvc
services.PreConfigure<IMvcBuilder>(builder =>
{
builder
.AddViewLocalization() //TODO: Move to the framework!
.AddRazorPagesOptions(options =>
{
options.Conventions.AuthorizeFolder("/App");

16
src/MicroserviceDemo/MicroserviceDemo.Web/Controllers/AccountController.cs

@ -0,0 +1,16 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Identity;
using Volo.Abp.AspNetCore.Mvc;
namespace MicroserviceDemo.Web.Controllers
{
public class AccountController : AbpController
{
public async Task Logout()
{
await HttpContext.SignOutAsync(IdentityConstants.ApplicationScheme);
await HttpContext.SignOutAsync("oidc");
}
}
}

8
src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs

@ -36,14 +36,6 @@ namespace MicroserviceDemo.Web
[DependsOn(typeof(AbpAspNetCoreAuthenticationOAuthModule))]
public class MicroservicesDemoWebModule : AbpModule
{
public override void PreConfigureServices(IServiceCollection services)
{
services.PreConfigure<IMvcBuilder>(builder =>
{
builder.AddViewLocalization(); //TODO: To the framework!
});
}
public override void ConfigureServices(IServiceCollection services)
{
var hostingEnvironment = services.GetSingletonInstance<IHostingEnvironment>();

2
src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs

@ -12,6 +12,8 @@ namespace Microsoft.AspNetCore.Authentication.OAuth.Claims
claimActions.MapJsonKey(AbpClaimTypes.EmailVerified, "email_verified");
claimActions.MapJsonKey(AbpClaimTypes.PhoneNumber, "phone_number");
claimActions.MapJsonKey(AbpClaimTypes.PhoneNumberVerified, "phone_number_verified");
claimActions.DeleteClaim("name");
claimActions.DeleteClaim("email");
}
}
}

3
src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs

@ -81,7 +81,8 @@ namespace Volo.Abp.AspNetCore.Mvc
var resourceType = assemblyResources.GetOrDefault(type.Assembly);
return factory.Create(resourceType ?? type);
};
});
})
.AddViewLocalization(); //TODO: How to configure from the application? Also, consider to move to a UI module since APIs does not care about it.
services.ExecutePreConfiguredActions(mvcBuilder);

8
test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs

@ -20,14 +20,6 @@ namespace Volo.Abp.AspNetCore.Mvc
)]
public class AbpAspNetCoreMvcTestModule : AbpModule
{
public override void PreConfigureServices(IServiceCollection services)
{
services.PreConfigure<IMvcBuilder>(builder =>
{
builder.AddViewLocalization();
});
}
public override void ConfigureServices(IServiceCollection services)
{
services.AddLocalization(); //TODO: Move to the framework..?

Loading…
Cancel
Save