From 622deac5bb8a0d9a1537688d22aed491683d4a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 23 Feb 2017 17:11:17 +0300 Subject: [PATCH] Moved identity users page to it's own assembly. --- Volo.Abp.sln | 7 ++++ .../AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs | 4 ++- .../Navigation/MainMenuContributor.cs | 8 ++--- src/AbpDesk/AbpDesk.Web.Mvc/project.json | 3 +- .../Identity/AbpIdentityHttpProxyModule.cs | 1 + .../AbpIdentityWebMainMenuContributor.cs | 24 +++++++++++++ .../AbpIdentityWebModule.cs | 34 +++++++++++++++++++ .../Controllers/UsersController.cs | 5 ++- .../Properties/launchSettings.json | 27 +++++++++++++++ .../Views/Users/Index.cshtml | 0 .../Volo.Abp.Identity.Web.xproj | 25 ++++++++++++++ src/Volo.Abp.Identity.Web/project.json | 23 +++++++++++++ 12 files changed, 150 insertions(+), 11 deletions(-) create mode 100644 src/Volo.Abp.Identity.Web/AbpIdentityWebMainMenuContributor.cs create mode 100644 src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs rename src/{AbpDesk/AbpDesk.Web.Mvc => Volo.Abp.Identity.Web}/Controllers/UsersController.cs (76%) create mode 100644 src/Volo.Abp.Identity.Web/Properties/launchSettings.json rename src/{AbpDesk/AbpDesk.Web.Mvc => Volo.Abp.Identity.Web}/Views/Users/Index.cshtml (100%) create mode 100644 src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.xproj create mode 100644 src/Volo.Abp.Identity.Web/project.json diff --git a/Volo.Abp.sln b/Volo.Abp.sln index 145ac79b5c..a8886451ec 100644 --- a/Volo.Abp.sln +++ b/Volo.Abp.sln @@ -102,6 +102,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Volo.Abp.Identity.HttpApi.H EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Volo.Abp.Identity.HttpProxy", "src\Volo.Abp.Identity.HttpProxy\Volo.Abp.Identity.HttpProxy.xproj", "{00B240B6-EC44-461A-9578-EF4F1BE9C688}" EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Volo.Abp.Identity.Web", "src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.xproj", "{17B14A48-5248-4F4C-A8E6-6926AA94EB7C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -244,6 +246,10 @@ Global {00B240B6-EC44-461A-9578-EF4F1BE9C688}.Debug|Any CPU.Build.0 = Debug|Any CPU {00B240B6-EC44-461A-9578-EF4F1BE9C688}.Release|Any CPU.ActiveCfg = Release|Any CPU {00B240B6-EC44-461A-9578-EF4F1BE9C688}.Release|Any CPU.Build.0 = Release|Any CPU + {17B14A48-5248-4F4C-A8E6-6926AA94EB7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {17B14A48-5248-4F4C-A8E6-6926AA94EB7C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {17B14A48-5248-4F4C-A8E6-6926AA94EB7C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {17B14A48-5248-4F4C-A8E6-6926AA94EB7C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -291,5 +297,6 @@ Global {57FCA6CB-9D99-411E-8ABF-20ACFBD61D61} = {1895A5C9-50D4-4568-9A3A-14657E615A5E} {EB902D57-C047-4CDF-828B-FDC204AC7398} = {1895A5C9-50D4-4568-9A3A-14657E615A5E} {00B240B6-EC44-461A-9578-EF4F1BE9C688} = {1895A5C9-50D4-4568-9A3A-14657E615A5E} + {17B14A48-5248-4F4C-A8E6-6926AA94EB7C} = {1895A5C9-50D4-4568-9A3A-14657E615A5E} EndGlobalSection EndGlobal diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs b/src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs index 458724b924..96ad48ea03 100644 --- a/src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs +++ b/src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs @@ -10,6 +10,7 @@ using Volo.Abp.AspNetCore.EmbeddedFiles; using Volo.Abp.AspNetCore.Modularity; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; using Volo.Abp.Identity; +using Volo.Abp.Identity.Web; using Volo.Abp.Modularity; using Volo.Abp.UI.Navigation; @@ -20,7 +21,8 @@ namespace AbpDesk.Web.Mvc typeof(AbpAspNetCoreMvcUiBootstrapModule), typeof(AbpDeskApplicationModule), typeof(AbpDeskEntityFrameworkCoreModule), - typeof(AbpIdentityHttpProxyModule) + typeof(AbpIdentityHttpProxyModule), + typeof(AbpIdentityWebModule) )] public class AbpDeskWebMvcModule : AbpModule { diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Navigation/MainMenuContributor.cs b/src/AbpDesk/AbpDesk.Web.Mvc/Navigation/MainMenuContributor.cs index d366158885..10f578ff42 100644 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Navigation/MainMenuContributor.cs +++ b/src/AbpDesk/AbpDesk.Web.Mvc/Navigation/MainMenuContributor.cs @@ -14,13 +14,9 @@ namespace AbpDesk.Web.Mvc.Navigation context.Menu.DisplayName = "Main Menu"; + context.Menu.Items.Insert(0, new ApplicationMenuItem("Home", "Home", url: "/")); + context.Menu - .AddItem( - new ApplicationMenuItem("Home", "Home", url: "/") - ) - .AddItem( - new ApplicationMenuItem("Users", "Users", url: "/Users") - ) .AddItem( new ApplicationMenuItem("TicketManagement", "Ticket Management") .AddItem( diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/project.json b/src/AbpDesk/AbpDesk.Web.Mvc/project.json index 2e5f4f9cb8..6a586c11c1 100644 --- a/src/AbpDesk/AbpDesk.Web.Mvc/project.json +++ b/src/AbpDesk/AbpDesk.Web.Mvc/project.json @@ -26,7 +26,8 @@ "AbpDesk.Application": "1.0.0-*", "Volo.Abp.AspNetCore.Mvc.UI.Bootstrap": "1.0.0-*", "Volo.Abp.AspNetCore.EmbeddedFiles": "1.0.0-*", - "Volo.Abp.Identity.HttpProxy": "1.0.0-*" + "Volo.Abp.Identity.HttpProxy": "1.0.0-*", + "Volo.Abp.Identity.Web": "1.0.0-*" }, "tools": { diff --git a/src/Volo.Abp.Identity.HttpProxy/Volo/Abp/Identity/AbpIdentityHttpProxyModule.cs b/src/Volo.Abp.Identity.HttpProxy/Volo/Abp/Identity/AbpIdentityHttpProxyModule.cs index 185fce931a..b68f082dba 100644 --- a/src/Volo.Abp.Identity.HttpProxy/Volo/Abp/Identity/AbpIdentityHttpProxyModule.cs +++ b/src/Volo.Abp.Identity.HttpProxy/Volo/Abp/Identity/AbpIdentityHttpProxyModule.cs @@ -3,6 +3,7 @@ using Volo.Abp.Modularity; namespace Volo.Abp.Identity { + //TODO: Rename to Volo.Abp.Identity.HttpApi.Client / AbpIdentityHttpApiClientModule [DependsOn(typeof(AbpIdentityApplicationContractsModule))] public class AbpIdentityHttpProxyModule : AbpModule { diff --git a/src/Volo.Abp.Identity.Web/AbpIdentityWebMainMenuContributor.cs b/src/Volo.Abp.Identity.Web/AbpIdentityWebMainMenuContributor.cs new file mode 100644 index 0000000000..58f7ab7ee6 --- /dev/null +++ b/src/Volo.Abp.Identity.Web/AbpIdentityWebMainMenuContributor.cs @@ -0,0 +1,24 @@ +using System.Threading.Tasks; +using Volo.Abp.UI.Navigation; + +namespace Volo.Abp.Identity.Web +{ + public class AbpIdentityWebMainMenuContributor : IMenuContributor + { + public Task ConfigureMenuAsync(MenuConfigurationContext context) + { + if (context.Menu.Name != StandardMenus.Main) + { + return Task.CompletedTask; + } + + context.Menu + .AddItem( + new ApplicationMenuItem("Identity", "Identity") + .AddItem(new ApplicationMenuItem("Users", "Users", url: "/Users")) + ); + + return Task.CompletedTask; + } + } +} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs b/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs new file mode 100644 index 0000000000..6cfebf4e88 --- /dev/null +++ b/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs @@ -0,0 +1,34 @@ +using System.Reflection; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.EmbeddedFiles; +using Volo.Abp.Modularity; +using Volo.Abp.UI.Navigation; + +namespace Volo.Abp.Identity.Web +{ + [DependsOn(typeof(AbpAspNetCoreMvcModule), typeof(AbpIdentityApplicationContractsModule))] + public class AbpIdentityWebModule : AbpModule + { + public override void ConfigureServices(IServiceCollection services) + { + services.AddAssemblyOf(); + + services.Configure(options => + { + options.MenuContributors.Add(new AbpIdentityWebMainMenuContributor()); + }); + + services.Configure(options => + { + options.Sources.Add( + new EmbeddedFileSet( + "/Views/", + GetType().GetTypeInfo().Assembly, + "Volo.Abp.Identity.Web.Views" + ) + ); + }); + } + } +} diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Controllers/UsersController.cs b/src/Volo.Abp.Identity.Web/Controllers/UsersController.cs similarity index 76% rename from src/AbpDesk/AbpDesk.Web.Mvc/Controllers/UsersController.cs rename to src/Volo.Abp.Identity.Web/Controllers/UsersController.cs index 1e96f37462..f32e01a873 100644 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Controllers/UsersController.cs +++ b/src/Volo.Abp.Identity.Web/Controllers/UsersController.cs @@ -1,11 +1,10 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.Identity; -namespace AbpDesk.Web.Mvc.Controllers +namespace Volo.Abp.Identity.Web.Controllers { - //TODO: Move to Volo.Abp.Identity.AspNetCore.Mvc or a similar module as a seperated area! + //TODO: to a seperated area, named Identity! public class UsersController : AbpController { private readonly IUserAppService _userAppService; diff --git a/src/Volo.Abp.Identity.Web/Properties/launchSettings.json b/src/Volo.Abp.Identity.Web/Properties/launchSettings.json new file mode 100644 index 0000000000..36ebaa878f --- /dev/null +++ b/src/Volo.Abp.Identity.Web/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:49677/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Volo.Abp.Identity.Web": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Views/Users/Index.cshtml b/src/Volo.Abp.Identity.Web/Views/Users/Index.cshtml similarity index 100% rename from src/AbpDesk/AbpDesk.Web.Mvc/Views/Users/Index.cshtml rename to src/Volo.Abp.Identity.Web/Views/Users/Index.cshtml diff --git a/src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.xproj b/src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.xproj new file mode 100644 index 0000000000..4b46e1b9ea --- /dev/null +++ b/src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.xproj @@ -0,0 +1,25 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + 17b14a48-5248-4f4c-a8e6-6926aa94eb7c + Volo.Abp.Identity.Web + .\obj + .\bin\ + v4.6.1 + + + + 2.0 + + + + + + + diff --git a/src/Volo.Abp.Identity.Web/project.json b/src/Volo.Abp.Identity.Web/project.json new file mode 100644 index 0000000000..835498161f --- /dev/null +++ b/src/Volo.Abp.Identity.Web/project.json @@ -0,0 +1,23 @@ +{ + "dependencies": { + "Volo.Abp.AspNetCore.Mvc": "1.0.0-*", + "Volo.Abp.Identity.Application.Contracts": "1.0.0-*" + }, + + "tools": { + }, + + "frameworks": { + "netstandard1.6": { + "imports": "dnxcore50" + } + }, + + "buildOptions": { + "embed": { + "include": [ + "Views/**/*.*" + ] + } + } +}