Browse Source

Merge branch 'dev' into maliming/mongodb-patch

pull/3982/head
maliming 6 years ago
parent
commit
6bf068d5c4
  1. 19
      docs/en/Tutorials/Part-1.md
  2. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.csproj
  3. 5
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/Default.cshtml
  4. 3
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/_MenuItem.cshtml
  5. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/LanguageSwitch/Default.cshtml
  6. 3
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/UserMenu/Default.cshtml
  7. 5
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml
  8. 6
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml
  9. 6
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Empty.cshtml
  10. 8
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj
  11. 5
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.csproj
  12. 19
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Pages/Shared/Components/AbpApplicationPath/AbpApplicationPathViewComponent.cs
  13. 7
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Pages/Shared/Components/AbpApplicationPath/AbpApplicationPathViewComponentModel.cs
  14. 4
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Pages/Shared/Components/AbpApplicationPath/Default.cshtml
  15. 13
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Pages/Shared/Components/AbpPageSearchBox/AbpPageSearchBoxViewComponent.cs
  16. 13
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Pages/Shared/Components/AbpPageSearchBox/Default.cshtml
  17. 6
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj
  18. 5
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo.Abp.AspNetCore.Mvc.UI.Widgets.csproj
  19. 5
      framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj
  20. 17
      framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/Extensions/DependencyInjection/AbpMvcBuilderExtensions.cs
  21. 26
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs
  22. 167
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationPartSorter.cs
  23. 4
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs
  24. 6
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Localization/AbpLanguagesController.cs
  25. 21
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GetSourceCommand.cs
  26. 22
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
  27. 5
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/SourceCodeDownloadService.cs
  28. 25
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ProjectReferenceReplaceStep.cs
  29. 5
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs
  30. 3
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NuGetPackageTarget.cs
  31. 4
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectFinder.cs
  32. 1
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs
  33. 5
      framework/src/Volo.Abp.Core/System/Collections/Generic/AbpListExtensions.cs
  34. 74
      framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationBase.cs
  35. 70
      framework/src/Volo.Abp.Core/Volo/Abp/Modularity/ModuleLoader.cs
  36. 8
      framework/src/Volo.Abp.Http/Volo/Abp/Http/ProxyScripting/Generators/JQuery/JQueryProxyScriptGenerator.cs
  37. 3
      framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs
  38. 3
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/ar.json
  39. 3
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/cs.json
  40. 3
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json
  41. 3
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json
  42. 3
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/nl.json
  43. 3
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/pt-BR.json
  44. 3
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/ru.json
  45. 3
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/sl.json
  46. 3
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/tr.json
  47. 3
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/zh-Hans.json
  48. 3
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/zh-Hant.json
  49. 34
      framework/test/Volo.Abp.Core.Tests/System/Collections/Generic/AbpListExtensions_Tests.cs
  50. 2
      modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/_ViewImports.cshtml
  51. 4
      modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/_ViewImports.cshtml
  52. 2
      modules/account/src/Volo.Abp.Account.Web.IdentityServer/Volo.Abp.Account.Web.IdentityServer.csproj
  53. 4
      modules/account/src/Volo.Abp.Account.Web/AbpAccountUserMenuContributor.cs
  54. 2
      modules/account/src/Volo.Abp.Account.Web/Modules/Account/Components/Toolbar/UserLoginLink/Default.cshtml
  55. 3
      modules/account/src/Volo.Abp.Account.Web/Pages/Account/AccountPageModel.cs
  56. 2
      modules/account/src/Volo.Abp.Account.Web/Pages/Account/Register.cshtml.cs
  57. 4
      modules/account/src/Volo.Abp.Account.Web/Pages/Account/_ViewImports.cshtml
  58. 6
      modules/account/src/Volo.Abp.Account.Web/Volo.Abp.Account.Web.csproj
  59. 14
      modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/MongoDbFixture.cs
  60. 12
      modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/MongoDbFixture.cs
  61. 12
      modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/MongoDbFixture.cs
  62. 2
      modules/blogging/src/Volo.Blogging.Web/BloggingMenuContributor.cs
  63. 0
      modules/blogging/src/Volo.Blogging.Web/Pages/_ViewImports.cshtml
  64. 2
      modules/blogging/src/Volo.Blogging.Web/Volo.Blogging.Web.csproj
  65. 12
      modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/MongoDbFixture.cs
  66. 2
      modules/client-simulation/src/Volo.ClientSimulation.Web/Volo.ClientSimulation.Web.csproj
  67. 2
      modules/docs/src/Volo.Docs.Admin.Web/Navigation/DocsMenuContributor.cs
  68. 5
      modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/_ViewImports.cshtml
  69. 2
      modules/docs/src/Volo.Docs.Admin.Web/Volo.Docs.Admin.Web.csproj
  70. 6
      modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj
  71. 12
      modules/docs/test/Volo.Docs.MongoDB.Tests/Volo/Docs/MongoDB/MongoDbFixture.cs
  72. 2
      modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Volo.Abp.FeatureManagement.Web.csproj
  73. 12
      modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo/Abp/FeatureManagement/MongoDB/MongoDbFixture.cs
  74. 11
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IOrganizationUnitRepository.cs
  75. 4
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserManager.cs
  76. 10
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/OrganizationUnitManager.cs
  77. 43
      modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs
  78. 21
      modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreOrganizationUnitRepository.cs
  79. 29
      modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoOrganizationUnitRepository.cs
  80. 4
      modules/identity/src/Volo.Abp.Identity.Web/Navigation/AbpIdentityWebMainMenuContributor.cs
  81. 2
      modules/identity/src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.csproj
  82. 12
      modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/MongoDbFixture.cs
  83. 24
      modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/OrganizationUnitRepository_Tests.cs
  84. 12
      modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo/Abp/IdentityServer/MongoDbFixture.cs
  85. 4
      modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/_ViewImports.cshtml
  86. 2
      modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Volo.Abp.PermissionManagement.Web.csproj
  87. 12
      modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/MongoDbFixture.cs
  88. 2
      modules/setting-management/src/Volo.Abp.SettingManagement.Web/Navigation/SettingManagementMainMenuContributor.cs
  89. 2
      modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj
  90. 12
      modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo/Abp/SettingManagement/MongoDB/MongoDbFixture.cs
  91. 2
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Navigation/AbpTenantManagementWebMainMenuContributor.cs
  92. 4
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/_ViewImports.cshtml
  93. 2
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Volo.Abp.TenantManagement.Web.csproj
  94. 12
      modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/MongoDbFixture.cs
  95. 1
      modules/users/test/Volo.Abp.Users.MongoDB.Tests/Volo/Abp/Users/MongoDB/AbpUserRepository_Tests.cs
  96. 4
      modules/users/test/Volo.Abp.Users.MongoDB.Tests/Volo/Abp/Users/MongoDB/AbpUsersMongoDbTestModule.cs
  97. 5
      modules/users/test/Volo.Abp.Users.MongoDB.Tests/Volo/Abp/Users/MongoDB/ExternalUserLookupService_Tests.cs
  98. 5
      modules/users/test/Volo.Abp.Users.MongoDB.Tests/Volo/Abp/Users/MongoDB/LocalUserLookupService_Tests.cs
  99. 22
      modules/users/test/Volo.Abp.Users.MongoDB.Tests/Volo/Abp/Users/MongoDB/MongoDbFixture.cs
  100. 10
      modules/users/test/Volo.Abp.Users.MongoDB.Tests/Volo/Abp/Users/MongoDB/MongoTestCollection.cs

19
docs/en/Tutorials/Part-1.md

@ -607,7 +607,7 @@ namespace Acme.BookStore.Web.Menus
{
//<-- added the below code
context.Menu.AddItem(
new ApplicationMenuItem("BooksStore", l["Menu:BookStore"])
new ApplicationMenuItem("BooksStore", l["Menu:BookStore"], icon: "fa fa-book")
.AddItem(
new ApplicationMenuItem("BooksStore.Books", l["Menu:Books"], url: "/Books")
)
@ -646,7 +646,16 @@ Open the `en.json` (*English translations*) file and add the below localization
"Type": "Type",
"Price": "Price",
"CreationTime": "Creation time",
"AreYouSureToDelete": "Are you sure you want to delete this item?"
"AreYouSureToDelete": "Are you sure you want to delete this item?",
"Enum:BookType:0": "Undefined",
"Enum:BookType:1": "Adventure",
"Enum:BookType:2": "Biography",
"Enum:BookType:3": "Dystopia",
"Enum:BookType:4": "Fantastic",
"Enum:BookType:5": "Horror",
"Enum:BookType:6": "Science",
"Enum:BookType:7": "ScienceFiction",
"Enum:BookType:8": "Poetry"
}
}
````
@ -716,7 +725,11 @@ $(function () {
ajax: abp.libs.datatables.createAjax(acme.bookStore.book.getList),
columnDefs: [
{ data: "name" },
{ data: "type" },
{ data: "type",
render: function(data){
return l('Enum:BookType:' + data);
}
},
{ data: "publishDate" },
{ data: "price" },
{ data: "creationTime" }

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.csproj

@ -18,10 +18,8 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\**\*.cshtml" />
<EmbeddedResource Include="Pages\**\*.js" />
<EmbeddedResource Include="Volo\Abp\AspNetCore\Mvc\UI\MultiTenancy\Localization\*.json" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Volo\Abp\AspNetCore\Mvc\UI\MultiTenancy\Localization\*.json" />
</ItemGroup>

5
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/Default.cshtml

@ -5,12 +5,13 @@
var elementId = string.IsNullOrEmpty(menuItem.ElementId) ? string.Empty : $"id=\"{menuItem.ElementId}\"";
var cssClass = string.IsNullOrEmpty(menuItem.CssClass) ? string.Empty : menuItem.CssClass;
var disabled = menuItem.IsDisabled ? "disabled" : string.Empty;
var url = string.IsNullOrEmpty(menuItem.Url) ? "#" : Url.Content(menuItem.Url);
if (menuItem.IsLeaf)
{
if (menuItem.Url != null)
{
<li class="nav-item @cssClass @disabled" @elementId>
<a class="nav-link" href="@(menuItem.Url ?? "#")">
<a class="nav-link" href="@url">
@if (menuItem.Icon != null)
{
if (menuItem.Icon.StartsWith("fa"))
@ -46,4 +47,4 @@
</div>
</li>
}
}
}

3
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/_MenuItem.cshtml

@ -4,12 +4,13 @@
var elementId = string.IsNullOrEmpty(Model.ElementId) ? string.Empty : $"id=\"{Model.ElementId}\"";
var cssClass = string.IsNullOrEmpty(Model.CssClass) ? string.Empty : Model.CssClass;
var disabled = Model.IsDisabled ? "disabled" : string.Empty;
var url = string.IsNullOrEmpty(Model.Url) ? "#" : Url.Content(Model.Url);
}
@if (Model.IsLeaf)
{
if (Model.Url != null)
{
<a class="dropdown-item @cssClass @disabled" href="@(Model.Url ?? "#")" @Html.Raw(elementId)>
<a class="dropdown-item @cssClass @disabled" href="@url" @Html.Raw(elementId)>
@if (Model.Icon != null)
{
if (Model.Icon.StartsWith("fa"))

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/LanguageSwitch/Default.cshtml

@ -12,7 +12,7 @@
<div class="dropdown-menu dropdown-menu-right border-0 shadow-sm" aria-labelledby="dropdownMenuLink">
@foreach (var language in Model.OtherLanguages)
{
<a class="dropdown-item" href="/Abp/Languages/Switch?culture=@(language.CultureName)&uiCulture=@(language.UiCultureName)&returnUrl=@(System.Net.WebUtility.UrlEncode(Context.Request.GetEncodedPathAndQuery()))">@language.DisplayName</a>
<a class="dropdown-item" href="~/Abp/Languages/Switch?culture=@(language.CultureName)&uiCulture=@(language.UiCultureName)&returnUrl=@(System.Net.WebUtility.UrlEncode(Context.Request.GetEncodedPathAndQuery()))">@language.DisplayName</a>
}
</div>
</div>

3
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/UserMenu/Default.cshtml

@ -27,8 +27,9 @@
var elementId = string.IsNullOrEmpty(menuItem.ElementId) ? string.Empty : $"id=\"{menuItem.ElementId}\"";
var cssClass = string.IsNullOrEmpty(menuItem.CssClass) ? string.Empty : menuItem.CssClass;
var disabled = menuItem.IsDisabled ? "disabled" : string.Empty;
var url = string.IsNullOrEmpty(menuItem.Url) ? "#" : Url.Content(menuItem.Url);
<a class="dropdown-item @cssClass @disabled" href="@(menuItem.Url ?? "#")" target="@menuItem.Target" @Html.Raw(elementId)>
<a class="dropdown-item @cssClass @disabled" href="@url" target="@menuItem.Target" @Html.Raw(elementId)>
@if (menuItem.Icon != null)
{
if (menuItem.Icon.StartsWith("fa"))

5
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml

@ -24,11 +24,12 @@
Layout = null;
AbpAntiForgeryManager.SetCookie();
var containerClass = ViewBag.FluidLayout == true ? "container-fluid" : "container"; //TODO: Better and type-safe options
var rtl = CultureHelper.IsRtl ? "rtl" : string.Empty;
}
<!DOCTYPE html>
<html lang="@CultureInfo.CurrentCulture.Name" dir=@(CultureHelper.IsRtl ? "rtl" : "")>
<html lang="@CultureInfo.CurrentCulture.Name" dir="@rtl">
<head>
@await Component.InvokeLayoutHookAsync(LayoutHooks.Head.First, StandardLayouts.Account)
@ -48,7 +49,7 @@
@await Component.InvokeLayoutHookAsync(LayoutHooks.Head.Last, StandardLayouts.Account)
</head>
<body class="abp-account-layout bg-light">
<body class="abp-account-layout bg-light @rtl">
@await Component.InvokeLayoutHookAsync(LayoutHooks.Body.First, StandardLayouts.Account)
@(await Component.InvokeAsync<MainNavbarViewComponent>())

6
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml

@ -28,11 +28,13 @@
pageTitle = PageLayout.Content.Title + pageTitle;
}
var rtl = CultureHelper.IsRtl ? "rtl" : string.Empty;
}
<!DOCTYPE html>
<html lang="@CultureInfo.CurrentCulture.Name" dir=@(CultureHelper.IsRtl ? "rtl" : "")>
<html lang="@CultureInfo.CurrentCulture.Name" dir="@rtl">
<head>
@await Component.InvokeLayoutHookAsync(LayoutHooks.Head.First, StandardLayouts.Application)
@ -50,7 +52,7 @@
@await Component.InvokeLayoutHookAsync(LayoutHooks.Head.Last, StandardLayouts.Application)
</head>
<body class="abp-application-layout bg-light">
<body class="abp-application-layout bg-light @rtl">
@await Component.InvokeLayoutHookAsync(LayoutHooks.Body.First, StandardLayouts.Application)
@(await Component.InvokeAsync<MainNavbarViewComponent>())

6
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Empty.cshtml

@ -27,11 +27,13 @@
pageTitle = PageLayout.Content.Title + pageTitle;
}
var rtl = CultureHelper.IsRtl ? "rtl" : string.Empty;
}
<!DOCTYPE html>
<html lang="@CultureInfo.CurrentCulture.Name" dir=@(CultureHelper.IsRtl ? "rtl" : "")>
<html lang="@CultureInfo.CurrentCulture.Name" dir="@rtl">
<head>
@await Component.InvokeLayoutHookAsync(LayoutHooks.Head.First, StandardLayouts.Empty)
@ -52,7 +54,7 @@
@await Component.InvokeLayoutHookAsync(LayoutHooks.Head.Last, StandardLayouts.Empty)
</head>
<body class="abp-empty-layout">
<body class="abp-empty-layout @rtl">
@await Component.InvokeLayoutHookAsync(LayoutHooks.Body.First, StandardLayouts.Empty)
<div class="@containerClass">

8
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj

@ -17,17 +17,11 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Themes\**\*.cshtml" />
<EmbeddedResource Include="Pages\**\*.cshtml" />
<EmbeddedResource Include="Views\**\*.cshtml" />
<EmbeddedResource Include="wwwroot\**\*.*" />
</ItemGroup>
<ItemGroup>
<Content Remove="wwwroot\**\*.*" />
<Content Remove="Themes\**\*.cshtml" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Views\**\*.cshtml" />
<Content Remove="Properties\launchSettings.json" />
<None Include="Properties\launchSettings.json" />
</ItemGroup>
@ -36,5 +30,5 @@
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy\Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.csproj" />
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj" />
</ItemGroup>
</Project>

5
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.csproj

@ -17,11 +17,6 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Views\**\*.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Remove="Views\**\*.cshtml" />
<Content Remove="compilerconfig.json" />
<Content Remove="Properties\launchSettings.json" />
<None Include="Properties\launchSettings.json" />

19
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Pages/Shared/Components/AbpApplicationPath/AbpApplicationPathViewComponent.cs

@ -0,0 +1,19 @@
using System;
using Microsoft.AspNetCore.Mvc;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Pages.Shared.Components.AbpApplicationPath
{
public class AbpApplicationPathViewComponent : AbpViewComponent
{
public IViewComponentResult Invoke()
{
var applicationPath = ViewContext.HttpContext.Request.PathBase.Value;
var model = new AbpApplicationPathViewComponentModel
{
ApplicationPath = applicationPath == null ? "/" : applicationPath.EnsureEndsWith('/')
};
return View("~/Pages/Shared/Components/AbpApplicationPath/Default.cshtml",model);
}
}
}

7
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Pages/Shared/Components/AbpApplicationPath/AbpApplicationPathViewComponentModel.cs

@ -0,0 +1,7 @@
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Pages.Shared.Components.AbpApplicationPath
{
public class AbpApplicationPathViewComponentModel
{
public string ApplicationPath { get; set; }
}
}

4
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Pages/Shared/Components/AbpApplicationPath/Default.cshtml

@ -0,0 +1,4 @@
@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Pages.Shared.Components.AbpApplicationPath.AbpApplicationPathViewComponentModel
<script type="text/javascript">
var abp = abp || {}; abp.appPath = '@Model.ApplicationPath';
</script>

13
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Pages/Shared/Components/AbpPageSearchBox/AbpPageSearchBoxViewComponent.cs

@ -0,0 +1,13 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Pages.Shared.Components.AbpPageSearchBox
{
public class AbpPageSearchBoxViewComponent : AbpViewComponent
{
public IViewComponentResult Invoke()
{
return View("~/Pages/Shared/Components/AbpPageSearchBox/Default.cshtml");
}
}
}

13
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Pages/Shared/Components/AbpPageSearchBox/Default.cshtml

@ -0,0 +1,13 @@
@using Localization.Resources.AbpUi
@using Microsoft.Extensions.Localization
@inject IStringLocalizer<AbpUiResource> L
<form method="post" class="page-search-form">
<div class="input-group">
<input class="form-control page-search-filter-text" placeholder="@L["Search"].Value">
<div class="input-group-append">
<abp-button button-type="Primary" type="submit">
<i class="fa fa-search" aria-hidden="true"></i>
</abp-button>
</div>
</div>
</form>

6
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj

@ -18,16 +18,10 @@
<ItemGroup>
<EmbeddedResource Include="wwwroot\**\*.*" />
<EmbeddedResource Include="Pages\**\*.cshtml" />
<EmbeddedResource Include="Views\**\*.cshtml" />
<EmbeddedResource Include="Areas\**\*.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Remove="wwwroot\**\*.*" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Views\**\*.cshtml" />
<Content Remove="Areas\**\*.cshtml" />
<Content Remove="compilerconfig.json" />
<Content Remove="Properties\launchSettings.json" />
<None Include="compilerconfig.json" />

5
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo.Abp.AspNetCore.Mvc.UI.Widgets.csproj

@ -17,9 +17,4 @@
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Bundling\Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Volo\Abp\AspNetCore\Mvc\UI\Widgets\Components\**\*.cshtml" />
<Content Remove="Volo\Abp\AspNetCore\Mvc\UI\Widgets\Components\**\*.cshtml" />
</ItemGroup>
</Project>

5
framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj

@ -14,11 +14,6 @@
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Volo\**\*.cshtml" />
<Content Remove="Volo\**\*.cshtml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NUglify" Version="1.5.13" />
</ItemGroup>

17
framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/Extensions/DependencyInjection/AbpMvcBuilderExtensions.cs

@ -1,4 +1,5 @@
using System.Linq;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Microsoft.AspNetCore.Mvc.ApplicationParts;
@ -8,13 +9,23 @@ namespace Microsoft.Extensions.DependencyInjection
{
public static void AddApplicationPartIfNotExists(this IMvcBuilder mvcBuilder, Assembly assembly)
{
if (mvcBuilder.PartManager.ApplicationParts.Any(
mvcBuilder.PartManager.ApplicationParts.AddIfNotContains(assembly);
}
public static void AddApplicationPartIfNotExists(this IMvcCoreBuilder mvcCoreBuilder, Assembly assembly)
{
mvcCoreBuilder.PartManager.ApplicationParts.AddIfNotContains(assembly);
}
public static void AddIfNotContains(this IList<ApplicationPart> applicationParts, Assembly assembly)
{
if (applicationParts.Any(
p => p is AssemblyPart assemblyPart && assemblyPart.Assembly == assembly))
{
return;
}
mvcBuilder.PartManager.ApplicationParts.Add(new AssemblyPart(assembly));
applicationParts.Add(new AssemblyPart(assembly));
}
}
}

26
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs

@ -10,6 +10,7 @@ using Microsoft.Extensions.Options;
using Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Reflection;
@ -75,14 +76,14 @@ namespace Volo.Abp.AspNetCore.Mvc
(int) HttpStatusCode.NotImplemented,
(int) HttpStatusCode.InternalServerError
};
options.SupportedResponseTypes.AddIfNotContains(statusCodes.Select(statusCode => new ApiResponseType
{
Type = typeof(RemoteServiceErrorResponse),
StatusCode = statusCode
}));
});
context.Services.PostConfigure<AbpAspNetCoreMvcOptions>(options =>
{
if (options.MinifyGeneratedScript == null)
@ -126,10 +127,10 @@ namespace Volo.Abp.AspNetCore.Mvc
return factory.Create(resourceType);
}
return factory.CreateDefaultOrNull() ??
return factory.CreateDefaultOrNull() ??
factory.Create(type);
};
})
})
.AddViewLocalization(); //TODO: How to configure from the application? Also, consider to move to a UI module since APIs does not care about it.
Configure<MvcRazorRuntimeCompilationOptions>(options =>
@ -161,7 +162,7 @@ namespace Volo.Abp.AspNetCore.Mvc
var application = context.Services.GetSingletonInstance<IAbpApplication>();
partManager.FeatureProviders.Add(new AbpConventionalControllerFeatureProvider(application));
partManager.ApplicationParts.Add(new AssemblyPart(typeof(AbpAspNetCoreMvcModule).Assembly));
partManager.ApplicationParts.AddIfNotContains(typeof(AbpAspNetCoreMvcModule).Assembly);
Configure<MvcOptions>(mvcOptions =>
{
@ -179,6 +180,14 @@ namespace Volo.Abp.AspNetCore.Mvc
});
}
public override void PostConfigureServices(ServiceConfigurationContext context)
{
ApplicationPartSorter.Sort(
context.Services.GetSingletonInstance<ApplicationPartManager>(),
context.Services.GetSingletonInstance<IModuleContainer>()
);
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
AddApplicationParts(context);
@ -220,12 +229,7 @@ namespace Volo.Abp.AspNetCore.Mvc
{
foreach (var moduleAssembly in moduleAssemblies)
{
if (partManager.ApplicationParts.OfType<AssemblyPart>().Any(p => p.Assembly == moduleAssembly))
{
continue;
}
partManager.ApplicationParts.Add(new AssemblyPart(moduleAssembly));
partManager.ApplicationParts.AddIfNotContains(moduleAssembly);
}
}
}

167
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationPartSorter.cs

@ -0,0 +1,167 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Mvc
{
/// <summary>
/// This class is used to align order of the MVC Application Parts with the order of
/// ABP module dependencies.
/// </summary>
public static class ApplicationPartSorter
{
public static void Sort(ApplicationPartManager partManager, IModuleContainer moduleContainer)
{
/* Performing a double Reverse() to preserve the original order for non-sorted parts
*/
var dependencyDictionary = CreateDependencyDictionary(partManager, moduleContainer);
var sortedParts = partManager
.ApplicationParts
.Reverse() //First Revers
.SortByDependencies(p => dependencyDictionary[p]);
sortedParts.Reverse(); //Reverse again
//Replace the original parts with the sorted parts
partManager.ApplicationParts.Clear();
foreach (var applicationPart in sortedParts)
{
partManager.ApplicationParts.Add(applicationPart);
}
}
private static Dictionary<ApplicationPart, List<ApplicationPart>> CreateDependencyDictionary(
ApplicationPartManager partManager, IModuleContainer moduleContainer)
{
var dependencyDictionary = new Dictionary<ApplicationPart, List<ApplicationPart>>();
foreach (var applicationPart in partManager.ApplicationParts)
{
dependencyDictionary[applicationPart] =
CreateDependencyList(applicationPart, partManager, moduleContainer);
}
return dependencyDictionary;
}
private static List<ApplicationPart> CreateDependencyList(
ApplicationPart applicationPart,
ApplicationPartManager partManager,
IModuleContainer moduleContainer)
{
var list = new List<ApplicationPart>();
if (applicationPart is AssemblyPart assemblyPart)
{
AddDependencies(list, assemblyPart, partManager, moduleContainer);
}
else if (applicationPart is CompiledRazorAssemblyPart compiledRazorAssemblyPart)
{
AddDependencies(list, compiledRazorAssemblyPart, partManager, moduleContainer);
}
return list;
}
private static void AddDependencies(
List<ApplicationPart> list,
AssemblyPart assemblyPart,
ApplicationPartManager partManager,
IModuleContainer moduleContainer)
{
var dependedAssemblyParts = GetDependedAssemblyParts(
partManager,
moduleContainer,
assemblyPart
);
list.AddRange(dependedAssemblyParts);
foreach (var dependedAssemblyPart in dependedAssemblyParts)
{
var viewsPart = GetViewsPartOrNull(partManager, dependedAssemblyPart);
if (viewsPart != null)
{
list.Add(viewsPart);
}
}
}
private static void AddDependencies(
List<ApplicationPart> list,
CompiledRazorAssemblyPart compiledRazorAssemblyPart,
ApplicationPartManager partManager,
IModuleContainer moduleContainer)
{
if (!compiledRazorAssemblyPart.Name.EndsWith(".Views"))
{
return;
}
var originalAssemblyPart = GetOriginalAssemblyPartOrNull(compiledRazorAssemblyPart, partManager);
if (originalAssemblyPart == null)
{
return;
}
list.Add(originalAssemblyPart);
}
private static AssemblyPart[] GetDependedAssemblyParts(
ApplicationPartManager partManager,
IModuleContainer moduleContainer,
AssemblyPart assemblyPart)
{
var moduleDescriptor = GetModuleDescriptorForAssemblyOrNull(moduleContainer, assemblyPart.Assembly);
if (moduleDescriptor == null)
{
return Array.Empty<AssemblyPart>();
}
var moduleDependedAssemblies = moduleDescriptor
.Dependencies
.Select(d => d.Assembly)
.ToArray();
return partManager.ApplicationParts
.OfType<AssemblyPart>()
.Where(a => a.Assembly.IsIn(moduleDependedAssemblies))
.Distinct()
.ToArray();
}
private static CompiledRazorAssemblyPart GetViewsPartOrNull(ApplicationPartManager partManager,
ApplicationPart assemblyPart)
{
var viewsAssemblyName = assemblyPart.Name + ".Views";
return partManager
.ApplicationParts
.OfType<CompiledRazorAssemblyPart>()
.FirstOrDefault(p => p.Name == viewsAssemblyName);
}
private static AssemblyPart GetOriginalAssemblyPartOrNull(
CompiledRazorAssemblyPart compiledRazorAssemblyPart,
ApplicationPartManager partManager)
{
var originalAssemblyName = compiledRazorAssemblyPart.Name.RemovePostFix(".Views");
return partManager.ApplicationParts
.OfType<AssemblyPart>()
.FirstOrDefault(p => p.Name == originalAssemblyName);
}
private static IAbpModuleDescriptor GetModuleDescriptorForAssemblyOrNull(
IModuleContainer moduleContainer,
Assembly assembly)
{
return moduleContainer
.Modules
.FirstOrDefault(m => m.Assembly == assembly);
}
}
}

4
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs

@ -86,7 +86,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Authentication
protected virtual string GetAppHomeUrl()
{
return "/";
return "~/";
}
}
}
}

6
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Localization/AbpLanguagesController.cs

@ -32,14 +32,14 @@ namespace Volo.Abp.AspNetCore.Mvc.Localization
return Redirect(GetRedirectUrl(returnUrl));
}
return Redirect("/");
return Redirect("~/");
}
private string GetRedirectUrl(string returnUrl)
{
if (returnUrl.IsNullOrEmpty())
{
return "/";
return "~/";
}
if (Url.IsLocalUrl(returnUrl))
@ -47,7 +47,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Localization
return returnUrl;
}
return "/";
return "~/";
}
}
}

21
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GetSourceCommand.cs

@ -48,16 +48,22 @@ namespace Volo.Abp.Cli.Commands
var outputFolder = GetOutPutFolder(commandLineArgs);
Logger.LogInformation("Output folder: " + outputFolder);
var gitHubLocalRepositoryPath = commandLineArgs.Options.GetOrNull(Options.GitHubLocalRepositoryPath.Long);
if (gitHubLocalRepositoryPath != null)
var gitHubAbpLocalRepositoryPath = commandLineArgs.Options.GetOrNull(Options.GitHubAbpLocalRepositoryPath.Long);
if (gitHubAbpLocalRepositoryPath != null)
{
Logger.LogInformation("GitHub Local Repository Path: " + gitHubLocalRepositoryPath);
Logger.LogInformation("GitHub Abp Local Repository Path: " + gitHubAbpLocalRepositoryPath);
}
var gitHubVoloLocalRepositoryPath = commandLineArgs.Options.GetOrNull(Options.GitHubVoloLocalRepositoryPath.Long);
if (gitHubVoloLocalRepositoryPath != null)
{
Logger.LogInformation("GitHub Volo Local Repository Path: " + gitHubVoloLocalRepositoryPath);
}
commandLineArgs.Options.Add(CliConsts.Command, commandLineArgs.Command);
await _sourceCodeDownloadService.DownloadAsync(
commandLineArgs.Target, outputFolder, version, gitHubLocalRepositoryPath, commandLineArgs.Options);
commandLineArgs.Target, outputFolder, version, gitHubAbpLocalRepositoryPath, gitHubVoloLocalRepositoryPath, commandLineArgs.Options);
}
private static string GetOutPutFolder(CommandLineArgs commandLineArgs)
@ -117,11 +123,16 @@ namespace Volo.Abp.Cli.Commands
public const string Long = "output-folder";
}
public static class GitHubLocalRepositoryPath
public static class GitHubAbpLocalRepositoryPath
{
public const string Long = "abp-path";
}
public static class GitHubVoloLocalRepositoryPath
{
public const string Long = "volo-path";
}
public static class Version
{
public const string Short = "v";

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

@ -86,10 +86,16 @@ namespace Volo.Abp.Cli.Commands
Logger.LogInformation("Mobile App: " + mobileApp);
}
var gitHubLocalRepositoryPath = commandLineArgs.Options.GetOrNull(Options.GitHubLocalRepositoryPath.Long);
if (gitHubLocalRepositoryPath != null)
var gitHubAbpLocalRepositoryPath = commandLineArgs.Options.GetOrNull(Options.GitHubAbpLocalRepositoryPath.Long);
if (gitHubAbpLocalRepositoryPath != null)
{
Logger.LogInformation("GitHub Local Repository Path: " + gitHubLocalRepositoryPath);
Logger.LogInformation("GitHub Abp Local Repository Path: " + gitHubAbpLocalRepositoryPath);
}
var gitHubVoloLocalRepositoryPath = commandLineArgs.Options.GetOrNull(Options.GitHubVoloLocalRepositoryPath.Long);
if (gitHubVoloLocalRepositoryPath != null)
{
Logger.LogInformation("GitHub Volo Local Repository Path: " + gitHubVoloLocalRepositoryPath);
}
var templateSource = commandLineArgs.Options.GetOrNull(Options.TemplateSource.Short, Options.TemplateSource.Long);
@ -127,7 +133,8 @@ namespace Volo.Abp.Cli.Commands
databaseProvider,
uiFramework,
mobileApp,
gitHubLocalRepositoryPath,
gitHubAbpLocalRepositoryPath,
gitHubVoloLocalRepositoryPath,
templateSource,
commandLineArgs.Options,
connectionString
@ -299,11 +306,16 @@ namespace Volo.Abp.Cli.Commands
public const string Long = "output-folder";
}
public static class GitHubLocalRepositoryPath
public static class GitHubAbpLocalRepositoryPath
{
public const string Long = "abp-path";
}
public static class GitHubVoloLocalRepositoryPath
{
public const string Long = "volo-path";
}
public static class Version
{
public const string Short = "v";

5
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/SourceCodeDownloadService.cs

@ -25,7 +25,7 @@ namespace Volo.Abp.Cli.Commands.Services
Logger = NullLogger<SourceCodeDownloadService>.Instance;
}
public async Task DownloadAsync(string moduleName, string outputFolder, string version, string gitHubLocalRepositoryPath, AbpCommandLineOptions options)
public async Task DownloadAsync(string moduleName, string outputFolder, string version, string gitHubAbpLocalRepositoryPath, string gitHubVoloLocalRepositoryPath, AbpCommandLineOptions options)
{
Logger.LogInformation("Downloading source code of " + moduleName);
Logger.LogInformation("Version: " + version);
@ -39,7 +39,8 @@ namespace Volo.Abp.Cli.Commands.Services
DatabaseProvider.NotSpecified,
UiFramework.NotSpecified,
null,
gitHubLocalRepositoryPath,
gitHubAbpLocalRepositoryPath,
gitHubVoloLocalRepositoryPath,
null,
options
)

25
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ProjectReferenceReplaceStep.cs

@ -22,10 +22,13 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps
return;
}
var localVoloRepoPath = context.BuildArgs.VoloGitHubLocalRepositoryPath;
new ProjectReferenceReplacer.LocalProjectPathReferenceReplacer(
context.Files,
context.Module?.Namespace ?? "MyCompanyName.MyProjectName",
localAbpRepoPath
localAbpRepoPath,
localVoloRepoPath
).Run();
}
else
@ -177,12 +180,14 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps
public class LocalProjectPathReferenceReplacer : ProjectReferenceReplacer
{
private readonly string _gitHubLocalRepositoryPath;
private readonly string _gitHubAbpLocalRepositoryPath;
private readonly string _gitHubVoloLocalRepositoryPath;
public LocalProjectPathReferenceReplacer(List<FileEntry> entries, string projectName, string gitHubLocalRepositoryPath)
public LocalProjectPathReferenceReplacer(List<FileEntry> entries, string projectName, string gitHubAbpLocalRepositoryPath, string gitHubVoloLocalRepositoryPath)
: base(entries, projectName)
{
_gitHubLocalRepositoryPath = gitHubLocalRepositoryPath;
_gitHubAbpLocalRepositoryPath = gitHubAbpLocalRepositoryPath;
_gitHubVoloLocalRepositoryPath = gitHubVoloLocalRepositoryPath;
}
protected override XmlElement GetNewReferenceNode(XmlDocument doc, string oldNodeIncludeValue)
@ -204,9 +209,17 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps
includeValue = includeValue.TrimStart('\\');
}
includeValue = _gitHubLocalRepositoryPath.EnsureEndsWith('\\') + includeValue;
if (!string.IsNullOrWhiteSpace(_gitHubVoloLocalRepositoryPath))
{
if (includeValue.StartsWith("abp\\", StringComparison.InvariantCultureIgnoreCase))
{
return _gitHubAbpLocalRepositoryPath.EnsureEndsWith('\\') + includeValue.Substring("abp\\".Length);
}
return _gitHubVoloLocalRepositoryPath.EnsureEndsWith('\\') + "abp\\" + includeValue;
}
return includeValue;
return _gitHubAbpLocalRepositoryPath.EnsureEndsWith('\\') + includeValue;
}
}
}

5
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs

@ -24,6 +24,9 @@ namespace Volo.Abp.Cli.ProjectBuilding
[CanBeNull]
public string AbpGitHubLocalRepositoryPath { get; set; }
[CanBeNull]
public string VoloGitHubLocalRepositoryPath { get; set; }
[CanBeNull]
public string TemplateSource { get; set; }
@ -41,6 +44,7 @@ namespace Volo.Abp.Cli.ProjectBuilding
UiFramework uiFramework = UiFramework.NotSpecified,
MobileApp? mobileApp = null,
[CanBeNull] string abpGitHubLocalRepositoryPath = null,
[CanBeNull] string voloGitHubLocalRepositoryPath = null,
[CanBeNull] string templateSource = null,
Dictionary<string, string> extraProperties = null,
[CanBeNull] string connectionString = null)
@ -52,6 +56,7 @@ namespace Volo.Abp.Cli.ProjectBuilding
UiFramework = uiFramework;
MobileApp = mobileApp;
AbpGitHubLocalRepositoryPath = abpGitHubLocalRepositoryPath;
VoloGitHubLocalRepositoryPath = voloGitHubLocalRepositoryPath;
TemplateSource = templateSource;
ExtraProperties = extraProperties ?? new Dictionary<string, string>();
ConnectionString = connectionString;

3
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NuGetPackageTarget.cs

@ -11,6 +11,7 @@
HttpApiClient = 6,
Web = 7,
EntityFrameworkCore = 8,
MongoDB = 9
MongoDB = 9,
SignalR = 10
}
}

4
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectFinder.cs

@ -41,6 +41,10 @@ namespace Volo.Abp.Cli.ProjectModification
return FindProjectEndsWith(projectFiles, assemblyNames, ".HttpApi");
case NuGetPackageTarget.HttpApiClient:
return FindProjectEndsWith(projectFiles, assemblyNames, ".HttpApi.Client");
case NuGetPackageTarget.SignalR:
return FindProjectEndsWith(projectFiles, assemblyNames, ".SignalR") ??
FindProjectEndsWith(projectFiles, assemblyNames, ".Web") ??
FindProjectEndsWith(projectFiles, assemblyNames, ".HttpApi.Host");
default:
return null;
}

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

@ -129,6 +129,7 @@ namespace Volo.Abp.Cli.ProjectModification
targetModuleFolder,
version,
null,
null,
null
);

5
framework/src/Volo.Abp.Core/System/Collections/Generic/AbpListExtensions.cs

@ -180,7 +180,10 @@ namespace System.Collections.Generic
/// <typeparam name="T">The type of the members of values.</typeparam>
/// <param name="source">A list of objects to sort</param>
/// <param name="getDependencies">Function to resolve the dependencies</param>
/// <returns></returns>
/// <returns>
/// Returns a new list ordered by dependencies.
/// If A depends on B, then B will come before than A in the resulting list.
/// </returns>
public static List<T> SortByDependencies<T>(this IEnumerable<T> source, Func<T, IEnumerable<T>> getDependencies)
{
/* See: http://www.codeproject.com/Articles/869059/Topological-sorting-in-Csharp

74
framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationBase.cs

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.DependencyInjection;
@ -42,6 +43,7 @@ namespace Volo.Abp
services.AddCoreAbpServices(this, options);
Modules = LoadModules(services, options);
ConfigureServices();
}
public virtual void Shutdown()
@ -75,7 +77,7 @@ namespace Volo.Abp
}
}
private IReadOnlyList<IAbpModuleDescriptor> LoadModules(IServiceCollection services, AbpApplicationCreationOptions options)
protected virtual IReadOnlyList<IAbpModuleDescriptor> LoadModules(IServiceCollection services, AbpApplicationCreationOptions options)
{
return services
.GetSingletonInstance<IModuleLoader>()
@ -85,5 +87,75 @@ namespace Volo.Abp
options.PlugInSources
);
}
//TODO: We can extract a new class for this
protected virtual void ConfigureServices()
{
var context = new ServiceConfigurationContext(Services);
Services.AddSingleton(context);
foreach (var module in Modules)
{
if (module.Instance is AbpModule abpModule)
{
abpModule.ServiceConfigurationContext = context;
}
}
//PreConfigureServices
foreach (var module in Modules.Where(m => m.Instance is IPreConfigureServices))
{
try
{
((IPreConfigureServices)module.Instance).PreConfigureServices(context);
}
catch (Exception ex)
{
throw new AbpInitializationException($"An error occurred during {nameof(IPreConfigureServices.PreConfigureServices)} phase of the module {module.Type.AssemblyQualifiedName}. See the inner exception for details.", ex);
}
}
//ConfigureServices
foreach (var module in Modules)
{
if (module.Instance is AbpModule abpModule)
{
if (!abpModule.SkipAutoServiceRegistration)
{
Services.AddAssembly(module.Type.Assembly);
}
}
try
{
module.Instance.ConfigureServices(context);
}
catch (Exception ex)
{
throw new AbpInitializationException($"An error occurred during {nameof(IAbpModule.ConfigureServices)} phase of the module {module.Type.AssemblyQualifiedName}. See the inner exception for details.", ex);
}
}
//PostConfigureServices
foreach (var module in Modules.Where(m => m.Instance is IPostConfigureServices))
{
try
{
((IPostConfigureServices)module.Instance).PostConfigureServices(context);
}
catch (Exception ex)
{
throw new AbpInitializationException($"An error occurred during {nameof(IPostConfigureServices.PostConfigureServices)} phase of the module {module.Type.AssemblyQualifiedName}. See the inner exception for details.", ex);
}
}
foreach (var module in Modules)
{
if (module.Instance is AbpModule abpModule)
{
abpModule.ServiceConfigurationContext = null;
}
}
}
}
}

70
framework/src/Volo.Abp.Core/Volo/Abp/Modularity/ModuleLoader.cs

@ -20,7 +20,6 @@ namespace Volo.Abp.Modularity
var modules = GetDescriptors(services, startupModuleType, plugInSources);
modules = SortByDependency(modules, startupModuleType);
ConfigureServices(modules, services);
return modules.ToArray();
}
@ -89,75 +88,6 @@ namespace Volo.Abp.Modularity
return module;
}
protected virtual void ConfigureServices(List<IAbpModuleDescriptor> modules, IServiceCollection services)
{
var context = new ServiceConfigurationContext(services);
services.AddSingleton(context);
foreach (var module in modules)
{
if (module.Instance is AbpModule abpModule)
{
abpModule.ServiceConfigurationContext = context;
}
}
//PreConfigureServices
foreach (var module in modules.Where(m => m.Instance is IPreConfigureServices))
{
try
{
((IPreConfigureServices)module.Instance).PreConfigureServices(context);
}
catch (Exception ex)
{
throw new AbpInitializationException($"An error occurred during {nameof(IPreConfigureServices.PreConfigureServices)} phase of the module {module.Type.AssemblyQualifiedName}. See the inner exception for details.", ex);
}
}
//ConfigureServices
foreach (var module in modules)
{
if (module.Instance is AbpModule abpModule)
{
if (!abpModule.SkipAutoServiceRegistration)
{
services.AddAssembly(module.Type.Assembly);
}
}
try
{
module.Instance.ConfigureServices(context);
}
catch (Exception ex)
{
throw new AbpInitializationException($"An error occurred during {nameof(IAbpModule.ConfigureServices)} phase of the module {module.Type.AssemblyQualifiedName}. See the inner exception for details.", ex);
}
}
//PostConfigureServices
foreach (var module in modules.Where(m => m.Instance is IPostConfigureServices))
{
try
{
((IPostConfigureServices)module.Instance).PostConfigureServices(context);
}
catch (Exception ex)
{
throw new AbpInitializationException($"An error occurred during {nameof(IPostConfigureServices.PostConfigureServices)} phase of the module {module.Type.AssemblyQualifiedName}. See the inner exception for details.", ex);
}
}
foreach (var module in modules)
{
if (module.Instance is AbpModule abpModule)
{
abpModule.ServiceConfigurationContext = null;
}
}
}
protected virtual void SetDependencies(List<AbpModuleDescriptor> modules, AbpModuleDescriptor module)
{
foreach (var dependedModuleType in AbpModuleHelper.FindDependedModuleTypes(module.Type))

8
framework/src/Volo.Abp.Http/Volo/Abp/Http/ProxyScripting/Generators/JQuery/JQueryProxyScriptGenerator.cs

@ -32,6 +32,8 @@ namespace Volo.Abp.Http.ProxyScripting.Generators.JQuery
AddModuleScript(script, module);
}
AddInitializedEventTrigger(script);
return script.ToString();
}
@ -189,6 +191,12 @@ namespace Volo.Abp.Http.ProxyScripting.Generators.JQuery
return result;
}
private static void AddInitializedEventTrigger(StringBuilder script)
{
script.AppendLine();
script.AppendLine("abp.event.trigger('abp.serviceProxyScriptInitialized');");
}
private static string GetNormalizedTypeName(string typeWithAssemblyName)
{

3
framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using JetBrains.Annotations;
@ -133,4 +134,4 @@ namespace Volo.Abp.UI.Navigation
return $"[ApplicationMenuItem] Name = {Name}";
}
}
}
}

3
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/ar.json

@ -58,6 +58,7 @@
"404Message": "الصفحة غير موجودة",
"500Message": "خطأ في الخادم الداخلي",
"GoHomePage": "اذهب الى الصفحة الرئيسية",
"GoBack": "عد"
"GoBack": "عد",
"Search": "بحث"
}
}

3
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/cs.json

@ -58,6 +58,7 @@
"404Message": "Stránka nenalezena",
"500Message": "Interní chyba serveru",
"GoHomePage": "Přejít na domovskou stránku",
"GoBack": "Jít zpět"
"GoBack": "Jít zpět",
"Search": "Vyhledávání"
}
}

3
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json

@ -58,6 +58,7 @@
"404Message": "Page not found",
"500Message": "Internal Server Error",
"GoHomePage": "Go to the homepage",
"GoBack": "Go back"
"GoBack": "Go back",
"Search" : "Search"
}
}

3
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json

@ -54,6 +54,7 @@
"404Message": "La página no existe",
"500Message": "Error interno del servidor",
"GoHomePage": "Ir a la página principal",
"GoBack": "Atras"
"GoBack": "Atras",
"Search": "Buscar"
}
}

3
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/nl.json

@ -58,6 +58,7 @@
"404Message": "Pagina niet gevonden",
"500Message": "Interne Server Fout",
"GoHomePage": "Ga naar de homepage",
"GoBack": "Ga terug"
"GoBack": "Ga terug",
"Search": "Zoeken"
}
}

3
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/pt-BR.json

@ -54,6 +54,7 @@
"404Message": "Página não encontrada",
"500Message": "Erro interno do servidor",
"GoHomePage": "Voltar à página principal",
"GoBack": "Voltar"
"GoBack": "Voltar",
"Search": "Procurar"
}
}

3
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/ru.json

@ -57,6 +57,7 @@
"404Message": "Страница не найдена",
"500Message": "Внутренняя ошибка сервера",
"GoHomePage": "Вернуться на главную страницу",
"GoBack": "Вернуться назад"
"GoBack": "Вернуться назад",
"Search": "поиск"
}
}

3
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/sl.json

@ -58,6 +58,7 @@
"404Message": "Strani ni mogoče najti",
"500Message": "Napaka na strani strežnika",
"GoHomePage": "Pojdi na osnovno stran",
"GoBack": "Nazaj"
"GoBack": "Nazaj",
"Search": "Iskanje"
}
}

3
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/tr.json

@ -58,6 +58,7 @@
"404Message": "Sayfa bulunamadı",
"500Message": "Sunucu tarafında hata",
"GoHomePage": "Ana sayfaya git",
"GoBack": "Geri dön"
"GoBack": "Geri dön",
"Search": "Arama"
}
}

3
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/zh-Hans.json

@ -55,6 +55,7 @@
"404Message": "网页未找到",
"500Message": "内部服务器错误",
"GoHomePage": "返回主页",
"GoBack": "返回"
"GoBack": "返回",
"Search" : "搜索"
}
}

3
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/zh-Hant.json

@ -54,6 +54,7 @@
"404Message": "網頁未找到",
"500Message": "內部伺服器錯誤",
"GoHomePage": "返回首頁",
"GoBack": "返回"
"GoBack": "返回",
"Search": "搜索"
}
}

34
framework/test/Volo.Abp.Core.Tests/System/Collections/Generic/AbpListExtensions_Tests.cs

@ -1,5 +1,6 @@
using System.Linq;
using Shouldly;
using Volo.Abp;
using Xunit;
namespace System.Collections.Generic
@ -171,5 +172,36 @@ namespace System.Collections.Generic
list[1].ShouldBe(42);
list[2].ShouldBe(3);
}
[Fact]
public void SortByDependencies()
{
var dependencies = new Dictionary<char, char[]>
{
{'A', new[] {'B', 'G'}},
{'B', new[] {'C', 'E'}},
{'C', new[] {'D'}},
{'D', new char[0]},
{'E', new[] {'C', 'F'}},
{'F', new[] {'C'}},
{'G', new[] {'F'}}
};
for (int i = 0; i < 3; i++)
{
var list = RandomHelper
.GenerateRandomizedList(new char[] {'A', 'B', 'C', 'D', 'E', 'F', 'G'});
list = list.SortByDependencies(c => dependencies[c]);
foreach (var dependency in dependencies)
{
foreach (var dependedValue in dependency.Value)
{
list.IndexOf(dependency.Key).ShouldBeGreaterThan(list.IndexOf(dependedValue));
}
}
}
}
}
}
}

2
modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/_ViewImports.cshtml

@ -1,2 +0,0 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap

4
modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/_ViewImports.cshtml

@ -0,0 +1,4 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling

2
modules/account/src/Volo.Abp.Account.Web.IdentityServer/Volo.Abp.Account.Web.IdentityServer.csproj

@ -17,10 +17,8 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\**\*.cshtml" />
<EmbeddedResource Include="Pages\**\*.css" />
<EmbeddedResource Include="Pages\**\*.js" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Pages\**\*.css" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Properties\launchSettings.json" />

4
modules/account/src/Volo.Abp.Account.Web/AbpAccountUserMenuContributor.cs

@ -19,8 +19,8 @@ namespace Volo.Abp.Account.Web
var uiResource = context.GetLocalizer<AbpUiResource>();
var accountResource = context.GetLocalizer<AccountResource>();
context.Menu.AddItem(new ApplicationMenuItem("Account.Manage", accountResource["ManageYourProfile"], url: "/Account/Manage", icon: "fa fa-cog", order: 1000, null));
context.Menu.AddItem(new ApplicationMenuItem("Account.Logout", uiResource["Logout"], url: "/Account/Logout", icon: "fa fa-power-off", order: int.MaxValue - 1000));
context.Menu.AddItem(new ApplicationMenuItem("Account.Manage", accountResource["ManageYourProfile"], url: "~/Account/Manage", icon: "fa fa-cog", order: 1000, null));
context.Menu.AddItem(new ApplicationMenuItem("Account.Logout", uiResource["Logout"], url: "~/Account/Logout", icon: "fa fa-power-off", order: int.MaxValue - 1000));
return Task.CompletedTask;
}

2
modules/account/src/Volo.Abp.Account.Web/Modules/Account/Components/Toolbar/UserLoginLink/Default.cshtml

@ -1,4 +1,4 @@
@using Localization.Resources.AbpUi
@using Microsoft.AspNetCore.Mvc.Localization
@inject IHtmlLocalizer<AbpUiResource> L
<a href="/Account/Login">@L["Login"]</a>
<a href="~/Account/Login">@L["Login"]</a>

3
modules/account/src/Volo.Abp.Account.Web/Pages/Account/AccountPageModel.cs

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Account.Localization;
@ -73,7 +74,7 @@ namespace Volo.Abp.Account.Web.Pages.Account
protected virtual string GetAppHomeUrl()
{
return "/"; //TODO: ???
return "~/"; //TODO: ???
}
}
}

2
modules/account/src/Volo.Abp.Account.Web/Pages/Account/Register.cshtml.cs

@ -59,7 +59,7 @@ namespace Volo.Abp.Account.Web.Pages.Account
await SignInManager.SignInAsync(user, isPersistent: false);
return Redirect(ReturnUrl ?? "/"); //TODO: How to ensure safety? IdentityServer requires it however it should be checked somehow!
return Redirect(ReturnUrl ?? "~/"); //TODO: How to ensure safety? IdentityServer requires it however it should be checked somehow!
}
protected virtual async Task CheckSelfRegistrationAsync()

4
modules/account/src/Volo.Abp.Account.Web/Pages/Account/_ViewImports.cshtml

@ -1,2 +1,4 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling

6
modules/account/src/Volo.Abp.Account.Web/Volo.Abp.Account.Web.csproj

@ -17,22 +17,18 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Modules\**\*.cshtml" />
<EmbeddedResource Include="Modules\**\*.js" />
<EmbeddedResource Include="Modules\**\*.css" />
<EmbeddedResource Include="Pages\**\*.cshtml" />
<EmbeddedResource Include="Pages\**\*.js" />
<EmbeddedResource Include="Pages\**\*.css" />
<Content Remove="Modules\**\*.cshtml" />
<Content Remove="Modules\**\*.js" />
<Content Remove="Modules\**\*.css" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Pages\**\*.css" />
<Content Remove="Properties\launchSettings.json" />
<None Include="Properties\launchSettings.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\identity\src\Volo.Abp.Identity.AspNetCore\Volo.Abp.Identity.AspNetCore.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj" />

14
modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/MongoDbFixture.cs

@ -5,12 +5,18 @@ namespace Volo.Abp.AuditLogging.MongoDB
{
public class MongoDbFixture : IDisposable
{
private static readonly MongoDbRunner MongoDbRunner = MongoDbRunner.Start();
public static readonly string ConnectionString = MongoDbRunner.ConnectionString;
private static readonly MongoDbRunner MongoDbRunner;
public static readonly string ConnectionString;
static MongoDbFixture()
{
MongoDbRunner = MongoDbRunner.Start();
ConnectionString = MongoDbRunner.ConnectionString;
}
public void Dispose()
{
MongoDbRunner?.Dispose();
}
}
}
}

12
modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/MongoDbFixture.cs

@ -5,12 +5,18 @@ namespace Volo.Abp.BackgroundJobs.MongoDB
{
public class MongoDbFixture : IDisposable
{
private static readonly MongoDbRunner MongoDbRunner = MongoDbRunner.Start();
public static readonly string ConnectionString = MongoDbRunner.ConnectionString;
private static readonly MongoDbRunner MongoDbRunner;
public static readonly string ConnectionString;
static MongoDbFixture()
{
MongoDbRunner = MongoDbRunner.Start();
ConnectionString = MongoDbRunner.ConnectionString;
}
public void Dispose()
{
MongoDbRunner?.Dispose();
}
}
}
}

12
modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/MongoDbFixture.cs

@ -5,12 +5,18 @@ namespace Volo.Abp.BlobStoring.Database.MongoDB
{
public class MongoDbFixture : IDisposable
{
private static readonly MongoDbRunner MongoDbRunner = MongoDbRunner.Start();
public static readonly string ConnectionString = MongoDbRunner.ConnectionString;
private static readonly MongoDbRunner MongoDbRunner;
public static readonly string ConnectionString;
static MongoDbFixture()
{
MongoDbRunner = MongoDbRunner.Start();
ConnectionString = MongoDbRunner.ConnectionString;
}
public void Dispose()
{
MongoDbRunner?.Dispose();
}
}
}
}

2
modules/blogging/src/Volo.Blogging.Web/BloggingMenuContributor.cs

@ -28,7 +28,7 @@ namespace Volo.Blogging
//TODO: Using the same permission. Reconsider.
if (await context.IsGrantedAsync(BloggingPermissions.Blogs.Management))
{
managementRootMenuItem.AddItem(new ApplicationMenuItem("BlogManagement.Blogs", l["Menu:Blogs"], "/Admin/Blogs"));
managementRootMenuItem.AddItem(new ApplicationMenuItem("BlogManagement.Blogs", l["Menu:Blogs"], "~/Admin/Blogs"));
}
context.Menu.AddItem(managementRootMenuItem);

0
modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/_ViewImports.cshtml → modules/blogging/src/Volo.Blogging.Web/Pages/_ViewImports.cshtml

2
modules/blogging/src/Volo.Blogging.Web/Volo.Blogging.Web.csproj

@ -23,10 +23,8 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\**\*.cshtml" />
<EmbeddedResource Include="Pages\**\*.js" />
<EmbeddedResource Include="Pages\**\*.css" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Pages\**\*.css" />
<Content Remove="compilerconfig.json" />

12
modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/MongoDbFixture.cs

@ -5,12 +5,18 @@ namespace Volo.Blogging.MongoDB
{
public class MongoDbFixture : IDisposable
{
private static readonly MongoDbRunner MongoDbRunner = MongoDbRunner.Start();
public static readonly string ConnectionString = MongoDbRunner.ConnectionString;
private static readonly MongoDbRunner MongoDbRunner;
public static readonly string ConnectionString;
static MongoDbFixture()
{
MongoDbRunner = MongoDbRunner.Start();
ConnectionString = MongoDbRunner.ConnectionString;
}
public void Dispose()
{
MongoDbRunner?.Dispose();
}
}
}
}

2
modules/client-simulation/src/Volo.ClientSimulation.Web/Volo.ClientSimulation.Web.csproj

@ -20,11 +20,9 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\**\*.cshtml" />
<EmbeddedResource Include="Pages\**\*.js" />
<EmbeddedResource Include="Pages\**\*.css" />
<EmbeddedResource Include="Pages\**\*.scss" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Pages\**\*.css" />
<Content Remove="Pages\**\*.scss" />

2
modules/docs/src/Volo.Docs.Admin.Web/Navigation/DocsMenuContributor.cs

@ -29,7 +29,7 @@ namespace Volo.Docs.Admin.Navigation
if (await context.IsGrantedAsync(DocsAdminPermissions.Projects.Default))
{
rootMenuItem.AddItem(new ApplicationMenuItem(DocsMenuNames.Projects, l["Menu:ProjectManagement"], "/Docs/Admin/Projects"));
rootMenuItem.AddItem(new ApplicationMenuItem(DocsMenuNames.Projects, l["Menu:ProjectManagement"], "~/Docs/Admin/Projects"));
}
}

5
modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/_ViewImports.cshtml

@ -0,0 +1,5 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling
@addTagHelper *, Volo.Docs.Admin.Web

2
modules/docs/src/Volo.Docs.Admin.Web/Volo.Docs.Admin.Web.csproj

@ -23,10 +23,8 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\**\*.cshtml" />
<EmbeddedResource Include="Pages\**\*.css" />
<EmbeddedResource Include="Pages\**\*.js" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Pages\**\*.css" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Properties\launchSettings.json" />

6
modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj

@ -24,14 +24,12 @@
<PackageReference Include="Markdig.Signed" Version="0.18.0" />
<PackageReference Include="Scriban" Version="2.1.1" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\**\*.cshtml" />
<EmbeddedResource Include="Pages\**\*.css" />
<EmbeddedResource Include="Pages\**\*.js" />
<EmbeddedResource Include="Localization\Resources\**\*.json" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Pages\**\*.css" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Localization\Resources\**\*.json" />

12
modules/docs/test/Volo.Docs.MongoDB.Tests/Volo/Docs/MongoDB/MongoDbFixture.cs

@ -5,12 +5,18 @@ namespace Volo.Docs.MongoDB
{
public class MongoDbFixture : IDisposable
{
private static readonly MongoDbRunner MongoDbRunner = MongoDbRunner.Start();
public static readonly string ConnectionString = MongoDbRunner.ConnectionString;
private static readonly MongoDbRunner MongoDbRunner;
public static readonly string ConnectionString;
static MongoDbFixture()
{
MongoDbRunner = MongoDbRunner.Start();
ConnectionString = MongoDbRunner.ConnectionString;
}
public void Dispose()
{
MongoDbRunner?.Dispose();
}
}
}
}

2
modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Volo.Abp.FeatureManagement.Web.csproj

@ -12,10 +12,8 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\**\*.cshtml" />
<EmbeddedResource Include="Pages\**\*.js" />
<EmbeddedResource Include="Pages\**\*.css" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Pages\**\*.css" />
</ItemGroup>

12
modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo/Abp/FeatureManagement/MongoDB/MongoDbFixture.cs

@ -5,12 +5,18 @@ namespace Volo.Abp.FeatureManagement.MongoDB
{
public class MongoDbFixture : IDisposable
{
private static readonly MongoDbRunner MongoDbRunner = MongoDbRunner.Start();
public static readonly string ConnectionString = MongoDbRunner.ConnectionString;
private static readonly MongoDbRunner MongoDbRunner;
public static readonly string ConnectionString;
static MongoDbFixture()
{
MongoDbRunner = MongoDbRunner.Start();
ConnectionString = MongoDbRunner.ConnectionString;
}
public void Dispose()
{
MongoDbRunner?.Dispose();
}
}
}
}

11
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IOrganizationUnitRepository.cs

@ -64,9 +64,20 @@ namespace Volo.Abp.Identity
bool includeDetails = false,
CancellationToken cancellationToken = default
);
Task<int> GetMembersCountAsync(
OrganizationUnit organizationUnit,
CancellationToken cancellationToken = default
);
Task RemoveAllRolesAsync(
OrganizationUnit organizationUnit,
CancellationToken cancellationToken = default
);
Task RemoveAllMembersAsync(
OrganizationUnit organizationUnit,
CancellationToken cancellationToken = default
);
}
}

4
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserManager.cs

@ -96,7 +96,6 @@ namespace Volo.Abp.Identity
return IdentityResult.Success;
}
public virtual async Task<bool> IsInOrganizationUnitAsync(Guid userId, Guid ouId)
{
var user = await IdentityUserRepository.GetAsync(userId, cancellationToken: CancellationToken);
@ -191,12 +190,13 @@ namespace Volo.Abp.Identity
}
[UnitOfWork]
public virtual async Task<List<OrganizationUnit>> GetOrganizationUnitsAsync(IdentityUser user)
public virtual async Task<List<OrganizationUnit>> GetOrganizationUnitsAsync(IdentityUser user, bool includeDetails = false)
{
await IdentityUserRepository.EnsureCollectionLoadedAsync(user, u => u.OrganizationUnits, CancellationTokenProvider.Token);
return await OrganizationUnitRepository.GetListAsync(
user.OrganizationUnits.Select(t => t.OrganizationUnitId),
includeDetails,
cancellationToken: CancellationToken
);
}

10
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/OrganizationUnitManager.cs

@ -77,9 +77,15 @@ namespace Volo.Abp.Identity
foreach (var child in children)
{
await OrganizationUnitRepository.RemoveAllMembersAsync(child);
await OrganizationUnitRepository.RemoveAllRolesAsync(child);
await OrganizationUnitRepository.DeleteAsync(child);
}
var organizationUnit = await OrganizationUnitRepository.GetAsync(id);
await OrganizationUnitRepository.RemoveAllMembersAsync(organizationUnit);
await OrganizationUnitRepository.RemoveAllRolesAsync(organizationUnit);
await OrganizationUnitRepository.DeleteAsync(id);
}
@ -133,7 +139,7 @@ namespace Volo.Abp.Identity
{
if (!recursive)
{
return await OrganizationUnitRepository.GetChildrenAsync(parentId);
return await OrganizationUnitRepository.GetChildrenAsync(parentId, includeDetails: true);
}
if (!parentId.HasValue)
@ -143,7 +149,7 @@ namespace Volo.Abp.Identity
var code = await GetCodeOrDefaultAsync(parentId.Value);
return await OrganizationUnitRepository.GetAllChildrenWithParentCodeAsync(code, parentId);
return await OrganizationUnitRepository.GetAllChildrenWithParentCodeAsync(code, parentId, includeDetails: true);
}
public virtual Task<bool> IsInOrganizationUnitAsync(IdentityUser user, OrganizationUnit ou)

43
modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs

@ -41,7 +41,14 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
where userRole.UserId == id
select role.Name;
var organizationUnitIds = DbContext.Set<IdentityUserOrganizationUnit>().Where(q => q.UserId == id).Select(q => q.OrganizationUnitId).ToArray();
var organizationRoleIds = DbContext.Set<OrganizationUnitRole>().Where(our => organizationUnitIds.Contains(our.OrganizationUnitId)).Select(r => r.RoleId).ToArray();
var organizationRoleIds = await (
from ouRole in DbContext.Set<OrganizationUnitRole>()
join ou in DbContext.Set<OrganizationUnit>() on ouRole.OrganizationUnitId equals ou.Id
where organizationUnitIds.Contains(ouRole.OrganizationUnitId)
select ouRole.RoleId
).ToListAsync(GetCancellationToken(cancellationToken));
var orgUnitRoleNameQuery = DbContext.Roles.Where(r => organizationRoleIds.Contains(r.Id)).Select(n => n.Name);
var resultQuery = query.Union(orgUnitRoleNameQuery);
return await resultQuery.ToListAsync(GetCancellationToken(cancellationToken));
@ -53,11 +60,14 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
{
var query = from userOu in DbContext.Set<IdentityUserOrganizationUnit>()
join roleOu in DbContext.Set<OrganizationUnitRole>() on userOu.OrganizationUnitId equals roleOu.OrganizationUnitId
join ou in DbContext.Set<OrganizationUnit>() on roleOu.OrganizationUnitId equals ou.Id
join userOuRoles in DbContext.Roles on roleOu.RoleId equals userOuRoles.Id
where userOu.UserId == id
select userOuRoles.Name;
return await query.ToListAsync(GetCancellationToken(cancellationToken));
var result = await query.ToListAsync(GetCancellationToken(cancellationToken));
return result;
}
public virtual async Task<IdentityUser> FindByLoginAsync(
@ -152,15 +162,16 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
where userOrg.UserId == id
select ou;
var orgUserRoleQuery = DbContext.Set<OrganizationUnitRole>().Where(q => userOrganizationsQuery.Select(t => t.Id).Contains(q.OrganizationUnitId))
var orgUserRoleQuery = DbContext.Set<OrganizationUnitRole>()
.Where(q => userOrganizationsQuery
.Select(t => t.Id)
.Contains(q.OrganizationUnitId))
.Select(t => t.RoleId);
var orgRoles = DbContext.Roles.Where(q => orgUserRoleQuery.Contains(q.Id));
var resultQuery = query.Union(orgRoles);
return await resultQuery.ToListAsync(GetCancellationToken(cancellationToken));
//return await query.ToListAsync(GetCancellationToken(cancellationToken));
}
public virtual async Task<long> GetCountAsync(
@ -201,22 +212,18 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
where userOu.OrganizationUnitId == organizationUnitId
select user;
return await query.ToListAsync(GetCancellationToken(cancellationToken));
}
public async Task<List<IdentityUser>> GetUsersInOrganizationsListAsync(
List<Guid> organizationUnitIds,
CancellationToken cancellationToken = default
)
{
//var userIds = DbContext.Set<IdentityUserOrganizationUnit>()
// .Where(q => organizationUnitIds.Contains(q.OrganizationUnitId))
// .Select(u => u.UserId);
//var query = DbContext.Users.Where(u => userIds.Contains(u.Id));
}
public async Task<List<IdentityUser>> GetUsersInOrganizationsListAsync(
List<Guid> organizationUnitIds,
CancellationToken cancellationToken = default
)
{
var query = from userOu in DbContext.Set<IdentityUserOrganizationUnit>()
join user in DbSet on userOu.UserId equals user.Id
where organizationUnitIds.Contains(userOu.OrganizationUnitId)
select user;
return await query.ToListAsync(GetCancellationToken(cancellationToken));
return await query.ToListAsync(GetCancellationToken(cancellationToken));
}
public virtual async Task<List<IdentityUser>> GetUsersInOrganizationUnitWithChildrenAsync(
@ -235,6 +242,6 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
public override IQueryable<IdentityUser> WithDetails()
{
return GetQueryable().IncludeDetails();
}
}
}
}

21
modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreOrganizationUnitRepository.cs

@ -102,7 +102,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
public virtual async Task<int> GetRolesCountAsync(
OrganizationUnit organizationUnit,
CancellationToken cancellationToken = default)
{
{
var query = from organizationRole in DbContext.Set<OrganizationUnitRole>()
join role in DbContext.Roles on organizationRole.RoleId equals role.Id
where organizationRole.OrganizationUnitId == organizationUnit.Id
@ -156,5 +156,24 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
{
return GetQueryable().IncludeDetails();
}
public virtual Task RemoveAllRolesAsync(
OrganizationUnit organizationUnit,
CancellationToken cancellationToken = default)
{
organizationUnit.Roles.Clear();
return Task.CompletedTask;
}
public virtual async Task RemoveAllMembersAsync(
OrganizationUnit organizationUnit,
CancellationToken cancellationToken = default)
{
var ouMembersQuery = await DbContext.Set<IdentityUserOrganizationUnit>()
.Where(q => q.OrganizationUnitId == organizationUnit.Id)
.ToListAsync(GetCancellationToken(cancellationToken));
DbContext.Set<IdentityUserOrganizationUnit>().RemoveRange(ouMembersQuery);
}
}
}

29
modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoOrganizationUnitRepository.cs

@ -1,17 +1,22 @@
using MongoDB.Driver;
using MongoDB.Bson;
using MongoDB.Driver;
using MongoDB.Driver.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories.MongoDB;
using Volo.Abp.MongoDB;
using Volo.Abp.Uow;
namespace Volo.Abp.Identity.MongoDB
{
public class MongoOrganizationUnitRepository : MongoDbRepository<IAbpIdentityMongoDbContext, OrganizationUnit, Guid>, IOrganizationUnitRepository
public class MongoOrganizationUnitRepository
: MongoDbRepository<IAbpIdentityMongoDbContext, OrganizationUnit, Guid>,
IOrganizationUnitRepository
{
public MongoOrganizationUnitRepository(
IMongoDbContextProvider<IAbpIdentityMongoDbContext> dbContextProvider)
@ -134,5 +139,25 @@ namespace Volo.Abp.Identity.MongoDB
.As<IMongoQueryable<IdentityUser>>()
.CountAsync(GetCancellationToken(cancellationToken));
}
public virtual Task RemoveAllRolesAsync(OrganizationUnit organizationUnit, CancellationToken cancellationToken = default)
{
organizationUnit.Roles.Clear();
return Task.FromResult(0);
}
public virtual async Task RemoveAllMembersAsync(OrganizationUnit organizationUnit, CancellationToken cancellationToken = default)
{
var users = await DbContext.Users.AsQueryable()
.Where(u => u.OrganizationUnits.Any(uou => uou.OrganizationUnitId == organizationUnit.Id))
.As<IMongoQueryable<IdentityUser>>()
.ToListAsync(GetCancellationToken(cancellationToken));
foreach (var user in users)
{
user.RemoveOrganizationUnit(organizationUnit.Id);
DbContext.Users.ReplaceOne(u => u.Id == user.Id, user);
}
}
}
}

4
modules/identity/src/Volo.Abp.Identity.Web/Navigation/AbpIdentityWebMainMenuContributor.cs

@ -30,12 +30,12 @@ namespace Volo.Abp.Identity.Web.Navigation
if (hasRolePermission)
{
identityMenuItem.AddItem(new ApplicationMenuItem(IdentityMenuNames.Roles, l["Roles"], url: "/Identity/Roles"));
identityMenuItem.AddItem(new ApplicationMenuItem(IdentityMenuNames.Roles, l["Roles"], url: "~/Identity/Roles"));
}
if (hasUserPermission)
{
identityMenuItem.AddItem(new ApplicationMenuItem(IdentityMenuNames.Users, l["Users"], url: "/Identity/Users"));
identityMenuItem.AddItem(new ApplicationMenuItem(IdentityMenuNames.Users, l["Users"], url: "~/Identity/Users"));
}
}
}

2
modules/identity/src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.csproj

@ -16,13 +16,11 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\**\*.cshtml" />
<EmbeddedResource Include="Pages\**\*.js" />
<EmbeddedResource Include="Pages\**\*.css" />
</ItemGroup>
<ItemGroup>
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Pages\**\*.css" />
<Content Remove="compilerconfig.json" />

12
modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/MongoDbFixture.cs

@ -5,12 +5,18 @@ namespace Volo.Abp.Identity.MongoDB
{
public class MongoDbFixture : IDisposable
{
private static readonly MongoDbRunner MongoDbRunner = MongoDbRunner.Start();
public static readonly string ConnectionString = MongoDbRunner.ConnectionString;
private static readonly MongoDbRunner MongoDbRunner;
public static readonly string ConnectionString;
static MongoDbFixture()
{
MongoDbRunner = MongoDbRunner.Start();
ConnectionString = MongoDbRunner.ConnectionString;
}
public void Dispose()
{
MongoDbRunner?.Dispose();
}
}
}
}

24
modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/OrganizationUnitRepository_Tests.cs

@ -151,5 +151,29 @@ namespace Volo.Abp.Identity
rolesCount.ShouldBeGreaterThan(1);
}
[Fact]
public async Task RemoveAllMembersOfOrganizationUnit()
{
OrganizationUnit ou = await _organizationUnitRepository.GetAsync("OU111", true);
var membersCount = await _organizationUnitRepository.GetMembersCountAsync(ou);
membersCount.ShouldBeGreaterThan(1);
await _organizationUnitRepository.RemoveAllMembersAsync(ou);
var newCount = await _organizationUnitRepository.GetMembersCountAsync(ou);
newCount.ShouldBe(0);
}
[Fact]
public async Task RemoveAllRolesOfOrganizationUnit()
{
OrganizationUnit ou = await _organizationUnitRepository.GetAsync("OU111", true);
var rolesCount = await _organizationUnitRepository.GetRolesCountAsync(ou);
rolesCount.ShouldBeGreaterThan(1);
await _organizationUnitRepository.RemoveAllRolesAsync(ou);
var newCount = await _organizationUnitRepository.GetRolesCountAsync(ou);
newCount.ShouldBe(0);
}
}
}

12
modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo/Abp/IdentityServer/MongoDbFixture.cs

@ -5,12 +5,18 @@ namespace Volo.Abp.IdentityServer
{
public class MongoDbFixture : IDisposable
{
private static readonly MongoDbRunner MongoDbRunner = MongoDbRunner.Start();
public static readonly string ConnectionString = MongoDbRunner.ConnectionString;
private static readonly MongoDbRunner MongoDbRunner;
public static readonly string ConnectionString;
static MongoDbFixture()
{
MongoDbRunner = MongoDbRunner.Start();
ConnectionString = MongoDbRunner.ConnectionString;
}
public void Dispose()
{
MongoDbRunner?.Dispose();
}
}
}
}

4
modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/_ViewImports.cshtml

@ -1,2 +1,4 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling

2
modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Volo.Abp.PermissionManagement.Web.csproj

@ -13,10 +13,8 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\**\*.cshtml" />
<EmbeddedResource Include="Pages\**\*.js" />
<EmbeddedResource Include="Pages\**\*.css" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Pages\**\*.css" />
</ItemGroup>

12
modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/MongoDbFixture.cs

@ -5,12 +5,18 @@ namespace Volo.Abp.PermissionManagement.MongoDB
{
public class MongoDbFixture : IDisposable
{
private static readonly MongoDbRunner MongoDbRunner = MongoDbRunner.Start();
public static readonly string ConnectionString = MongoDbRunner.ConnectionString;
private static readonly MongoDbRunner MongoDbRunner;
public static readonly string ConnectionString;
static MongoDbFixture()
{
MongoDbRunner = MongoDbRunner.Start();
ConnectionString = MongoDbRunner.ConnectionString;
}
public void Dispose()
{
MongoDbRunner?.Dispose();
}
}
}
}

2
modules/setting-management/src/Volo.Abp.SettingManagement.Web/Navigation/SettingManagementMainMenuContributor.cs

@ -37,7 +37,7 @@ namespace Volo.Abp.SettingManagement.Web.Navigation
new ApplicationMenuItem(
SettingManagementMenuNames.GroupName,
l["Settings"],
"/SettingManagement",
"~/SettingManagement",
icon: "fa fa-cog"
)
);

2
modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj

@ -20,10 +20,8 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\**\*.cshtml" />
<EmbeddedResource Include="Pages\**\*.js" />
<EmbeddedResource Include="Pages\**\*.css" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Pages\**\*.css" />
<Content Remove="Properties\launchSettings.json" />

12
modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo/Abp/SettingManagement/MongoDB/MongoDbFixture.cs

@ -5,12 +5,18 @@ namespace Volo.Abp.SettingManagement.MongoDB
{
public class MongoDbFixture : IDisposable
{
private static readonly MongoDbRunner MongoDbRunner = MongoDbRunner.Start();
public static readonly string ConnectionString = MongoDbRunner.ConnectionString;
private static readonly MongoDbRunner MongoDbRunner;
public static readonly string ConnectionString;
static MongoDbFixture()
{
MongoDbRunner = MongoDbRunner.Start();
ConnectionString = MongoDbRunner.ConnectionString;
}
public void Dispose()
{
MongoDbRunner?.Dispose();
}
}
}
}

2
modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Navigation/AbpTenantManagementWebMainMenuContributor.cs

@ -25,7 +25,7 @@ namespace Volo.Abp.TenantManagement.Web.Navigation
if (await context.IsGrantedAsync(TenantManagementPermissions.Tenants.Default))
{
tenantManagementMenuItem.AddItem(new ApplicationMenuItem(TenantManagementMenuNames.Tenants, l["Tenants"], url: "/TenantManagement/Tenants"));
tenantManagementMenuItem.AddItem(new ApplicationMenuItem(TenantManagementMenuNames.Tenants, l["Tenants"], url: "~/TenantManagement/Tenants"));
}
}
}

4
modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/_ViewImports.cshtml

@ -1,2 +1,4 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling

2
modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Volo.Abp.TenantManagement.Web.csproj

@ -13,10 +13,8 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\**\*.cshtml" />
<EmbeddedResource Include="Pages\**\*.js" />
<EmbeddedResource Include="Pages\**\*.css" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Pages\**\*.css" />
<Content Remove="compilerconfig.json" />

12
modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/MongoDbFixture.cs

@ -5,12 +5,18 @@ namespace Volo.Abp.TenantManagement.MongoDB
{
public class MongoDbFixture : IDisposable
{
private static readonly MongoDbRunner MongoDbRunner = MongoDbRunner.Start();
public static readonly string ConnectionString = MongoDbRunner.ConnectionString;
private static readonly MongoDbRunner MongoDbRunner;
public static readonly string ConnectionString;
static MongoDbFixture()
{
MongoDbRunner = MongoDbRunner.Start();
ConnectionString = MongoDbRunner.ConnectionString;
}
public void Dispose()
{
MongoDbRunner?.Dispose();
}
}
}
}

1
modules/users/test/Volo.Abp.Users.MongoDB.Tests/Volo/Abp/Users/MongoDB/AbpUserRepository_Tests.cs

@ -1,5 +1,6 @@
namespace Volo.Abp.Users.MongoDB
{
[Collection(MongoTestCollection.Name)]
public class AbpUserRepository_Tests : AbpUserRepository_Tests<AbpUsersMongoDbTestModule>
{

4
modules/users/test/Volo.Abp.Users.MongoDB.Tests/Volo/Abp/Users/MongoDB/AbpUsersMongoDbTestModule.cs

@ -16,9 +16,9 @@ namespace Volo.Abp.Users.MongoDB
public override void ConfigureServices(IServiceCollection services)
{
var connectionString = MongoDbRunner.ConnectionString.EnsureEndsWith('/') +
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");
Guid.NewGuid().ToString("N");
Configure<AbpDbConnectionOptions>(options =>
{

5
modules/users/test/Volo.Abp.Users.MongoDB.Tests/Volo/Abp/Users/MongoDB/ExternalUserLookupService_Tests.cs

@ -1,7 +1,8 @@
namespace Volo.Abp.Users.MongoDB
{
[Collection(MongoTestCollection.Name)]
public class ExternalUserLookupService_Tests : ExternalUserLookupService_Tests<AbpUsersMongoDbTestModule>
{
}
}
}

5
modules/users/test/Volo.Abp.Users.MongoDB.Tests/Volo/Abp/Users/MongoDB/LocalUserLookupService_Tests.cs

@ -1,7 +1,8 @@
namespace Volo.Abp.Users.MongoDB
{
[Collection(MongoTestCollection.Name)]
public class LocalUserLookupService_Tests : LocalUserLookupService_Tests<AbpUsersMongoDbTestModule>
{
}
}
}

22
modules/users/test/Volo.Abp.Users.MongoDB.Tests/Volo/Abp/Users/MongoDB/MongoDbFixture.cs

@ -0,0 +1,22 @@
using System;
using Mongo2Go;
namespace Volo.Abp.Users.MongoDB
{
public class MongoDbFixture : IDisposable
{
private static readonly MongoDbRunner MongoDbRunner;
public static readonly string ConnectionString;
static MongoDbFixture()
{
MongoDbRunner = MongoDbRunner.Start();
ConnectionString = MongoDbRunner.ConnectionString;
}
public void Dispose()
{
MongoDbRunner?.Dispose();
}
}
}

10
modules/users/test/Volo.Abp.Users.MongoDB.Tests/Volo/Abp/Users/MongoDB/MongoTestCollection.cs

@ -0,0 +1,10 @@
using Xunit;
namespace Volo.Abp.Users.MongoDB
{
[CollectionDefinition(Name)]
public class MongoTestCollection : ICollectionFixture<MongoDbFixture>
{
public const string Name = "MongoDB Collection";
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save