From b8ae3ffefd76e307aae28429804fa527daf2cb67 Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 9 Apr 2019 20:17:48 +0800 Subject: [PATCH 01/13] AbpIdentityServerTestDataBuilder AddClaimTypes. --- .../AbpIdentityServerTestDataBuilder.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs index 0c18e85350..1a614e36ea 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs @@ -1,6 +1,8 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using Volo.Abp.DependencyInjection; using Volo.Abp.Guids; +using Volo.Abp.Identity; using Volo.Abp.IdentityServer.ApiResources; using Volo.Abp.IdentityServer.Clients; using Volo.Abp.IdentityServer.Grants; @@ -14,6 +16,7 @@ namespace Volo.Abp.IdentityServer private readonly IApiResourceRepository _apiResourceRepository; private readonly IClientRepository _clientRepository; private readonly IIdentityResourceRepository _identityResourceRepository; + private readonly IIdentityClaimTypeRepository _identityClaimTypeRepository; //private readonly IPersistentGrantRepository _persistentGrantRepository; private readonly AbpIdentityServerTestData _testData; @@ -22,6 +25,7 @@ namespace Volo.Abp.IdentityServer IApiResourceRepository apiResourceRepository, IClientRepository clientRepository, IIdentityResourceRepository identityResourceRepository, + IIdentityClaimTypeRepository identityClaimTypeRepository, AbpIdentityServerTestData testData /*IPersistentGrantRepository persistentGrantRepository*/) { @@ -30,6 +34,7 @@ namespace Volo.Abp.IdentityServer _apiResourceRepository = apiResourceRepository; _clientRepository = clientRepository; _identityResourceRepository = identityResourceRepository; + _identityClaimTypeRepository = identityClaimTypeRepository; //_persistentGrantRepository = persistentGrantRepository; } @@ -39,6 +44,7 @@ namespace Volo.Abp.IdentityServer AddIdentityResources(); AddApiResources(); AddClients(); + AddClaimTypes(); } private void AddPersistedGrants() @@ -105,5 +111,12 @@ namespace Volo.Abp.IdentityServer _clientRepository.Insert(new Client(_guidGenerator.Create(), "ClientId2")); _clientRepository.Insert(new Client(_guidGenerator.Create(), "ClientId3")); } + + private void AddClaimTypes() + { + var ageClaim = new IdentityClaimType(Guid.NewGuid(), "Age", false, false, null, null, null, + IdentityClaimValueType.Int); + _identityClaimTypeRepository.Insert(ageClaim); + } } } From 1b8bd9fa367f3a541dcd8cea2a7680aad18423e1 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 11 Apr 2019 13:45:00 +0800 Subject: [PATCH 02/13] Add PersistentGrantRepository tests. --- .../Clients/ClientStore_Tests.cs | 0 .../Clients/IdentityResourceStore_Tests.cs | 0 .../Clients/PersistentGrant_Tests.cs | 0 .../PersistentGrantRepository_Tests.cs | 11 ++++ .../PersistentGrantRepository_Tests.cs | 11 ++++ .../AbpIdentityServerTestDataBuilder.cs | 30 ++++++--- .../PersistentGrantRepository_Tests.cs | 62 +++++++++++++++++++ 7 files changed, 107 insertions(+), 7 deletions(-) rename modules/identityserver/test/{Volo.Abp.IdentityServer.EntityFrameworkCore.Tests => Volo.Abp.IdentityServer.Domain.Tests}/Volo/Abp/IdentityServer/Clients/ClientStore_Tests.cs (100%) rename modules/identityserver/test/{Volo.Abp.IdentityServer.EntityFrameworkCore.Tests => Volo.Abp.IdentityServer.Domain.Tests}/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs (100%) rename modules/identityserver/test/{Volo.Abp.IdentityServer.EntityFrameworkCore.Tests => Volo.Abp.IdentityServer.Domain.Tests}/Volo/Abp/IdentityServer/Clients/PersistentGrant_Tests.cs (100%) create mode 100644 modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/PersistentGrantRepository_Tests.cs create mode 100644 modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo/Abp/IdentityServer/PersistentGrantRepository_Tests.cs create mode 100644 modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/PersistentGrantRepository_Tests.cs diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/Clients/ClientStore_Tests.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/ClientStore_Tests.cs similarity index 100% rename from modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/Clients/ClientStore_Tests.cs rename to modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/ClientStore_Tests.cs diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs similarity index 100% rename from modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs rename to modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/Clients/PersistentGrant_Tests.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/PersistentGrant_Tests.cs similarity index 100% rename from modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/Clients/PersistentGrant_Tests.cs rename to modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/PersistentGrant_Tests.cs diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/PersistentGrantRepository_Tests.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/PersistentGrantRepository_Tests.cs new file mode 100644 index 0000000000..79bab1d23a --- /dev/null +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/PersistentGrantRepository_Tests.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Volo.Abp.IdentityServer +{ + public class PersistentGrantRepository_Tests : PersistentGrantRepository_Tests + { + + } +} diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo/Abp/IdentityServer/PersistentGrantRepository_Tests.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo/Abp/IdentityServer/PersistentGrantRepository_Tests.cs new file mode 100644 index 0000000000..fd2763dc6c --- /dev/null +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo/Abp/IdentityServer/PersistentGrantRepository_Tests.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Volo.Abp.IdentityServer +{ + public class PersistentGrantRepository_Tests : PersistentGrantRepository_Tests + { + + } +} diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs index 1a614e36ea..016820af49 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs @@ -17,7 +17,7 @@ namespace Volo.Abp.IdentityServer private readonly IClientRepository _clientRepository; private readonly IIdentityResourceRepository _identityResourceRepository; private readonly IIdentityClaimTypeRepository _identityClaimTypeRepository; - //private readonly IPersistentGrantRepository _persistentGrantRepository; + private readonly IPersistentGrantRepository _persistentGrantRepository; private readonly AbpIdentityServerTestData _testData; public AbpIdentityServerTestDataBuilder( @@ -26,8 +26,8 @@ namespace Volo.Abp.IdentityServer IClientRepository clientRepository, IIdentityResourceRepository identityResourceRepository, IIdentityClaimTypeRepository identityClaimTypeRepository, - AbpIdentityServerTestData testData - /*IPersistentGrantRepository persistentGrantRepository*/) + AbpIdentityServerTestData testData, + IPersistentGrantRepository persistentGrantRepository) { _testData = testData; _guidGenerator = guidGenerator; @@ -35,7 +35,7 @@ namespace Volo.Abp.IdentityServer _clientRepository = clientRepository; _identityResourceRepository = identityResourceRepository; _identityClaimTypeRepository = identityClaimTypeRepository; - //_persistentGrantRepository = persistentGrantRepository; + _persistentGrantRepository = persistentGrantRepository; } public void Build() @@ -49,9 +49,25 @@ namespace Volo.Abp.IdentityServer private void AddPersistedGrants() { - //_persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create())); - //_persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create())); - //_persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create())); + _persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create()) + { + + Key = "PersistedGrantKey1", + SubjectId = "PersistedGrantSubjectId1", + ClientId = "PersistedGrantClientId1", + Type = "PersistedGrantType1" + }); + _persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create()) + { + Key = "PersistedGrantKey2", + SubjectId = "PersistedGrantSubjectId2" + }); + + _persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create()) + { + Key = "PersistedGrantKey3", + SubjectId = "PersistedGrantSubjectId3" + }); } private void AddIdentityResources() diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/PersistentGrantRepository_Tests.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/PersistentGrantRepository_Tests.cs new file mode 100644 index 0000000000..20f6674515 --- /dev/null +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/PersistentGrantRepository_Tests.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using Shouldly; +using Volo.Abp.IdentityServer.Grants; +using Volo.Abp.Modularity; +using Xunit; + +namespace Volo.Abp.IdentityServer +{ + public abstract class PersistentGrantRepository_Tests : AbpIdentityServerTestBase + where TStartupModule : IAbpModule + { + private readonly IPersistentGrantRepository _persistentGrantRepository; + + protected PersistentGrantRepository_Tests() + { + _persistentGrantRepository = GetRequiredService(); + } + + [Fact] + public async Task FindByKeyAsync() + { + (await _persistentGrantRepository.FindByKeyAsync("PersistedGrantKey1")).ShouldNotBeNull(); + } + + [Fact] + public async Task GetListBySubjectIdAsync() + { + var persistedGrants = await _persistentGrantRepository.GetListBySubjectIdAsync("PersistedGrantSubjectId1"); + persistedGrants.ShouldNotBeEmpty(); + persistedGrants.ShouldContain(x => x.Key == "PersistedGrantKey1"); + } + + [Fact] + public async Task DeleteBySubjectIdAndClientId() + { + await _persistentGrantRepository.DeleteAsync("PersistedGrantSubjectId1", "PersistedGrantClientId1"); + + var persistedGrants = await _persistentGrantRepository.GetListAsync(); + persistedGrants.ShouldNotBeEmpty(); + persistedGrants.ShouldNotContain(x => + x.Key == "PersistedGrantKey1" && x.SubjectId == "PersistedGrantSubjectId1" && + x.ClientId == "PersistedGrantClientId1"); + } + + [Fact] + public async Task DeleteBySubjectIdAndClientIdAndType() + { + await _persistentGrantRepository.DeleteAsync("PersistedGrantSubjectId1", "PersistedGrantClientId1", + "PersistedGrantClientId1"); + + var persistedGrants = await _persistentGrantRepository.GetListAsync(); + persistedGrants.ShouldNotBeEmpty(); + persistedGrants.ShouldNotContain(x => + x.Key == "PersistedGrantKey1" && x.SubjectId == "PersistedGrantSubjectId1" && + x.ClientId == "PersistedGrantClientId1" && x.Type == "PersistedGrantClientId1"); + + } + } +} From 724cdc18d8a243431c0b51f20bf432ecc0c0ebd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=B6=9B?= Date: Fri, 12 Apr 2019 11:30:01 +0800 Subject: [PATCH 03/13] Improved Chinese translation Improved Chinese translation for Bundling-Minification.md doc file --- .../AspNetCore/Bundling-Minification.md | 46 +++++++++++++++---- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/docs/zh-Hans/AspNetCore/Bundling-Minification.md b/docs/zh-Hans/AspNetCore/Bundling-Minification.md index 7454bd3c17..b7c8c0a1b1 100644 --- a/docs/zh-Hans/AspNetCore/Bundling-Minification.md +++ b/docs/zh-Hans/AspNetCore/Bundling-Minification.md @@ -196,7 +196,7 @@ services.Configure(options => options .ScriptBundles .Configure("MyGlobalBundle", bundle => { - bundle.AddContributors(typeof(MyExtensionStyleBundleContributor)); + bundle.AddContributors(typeof(MyExtensionGlobalStyleContributor)); }); }); ```` @@ -214,7 +214,7 @@ services.Configure(options => `abp-style`和`abp-script`标签可以使用`type`属性(而不是`src`属性), 如本示例所示. 添加bundle贡献者时, 其依赖关系也会自动添加到bundle中. -#### Contributor Dependencies +#### 贡献者依赖关系 bundle贡献者可以与其他贡献者具有一个或多个依赖关系. 例如: @@ -227,9 +227,39 @@ public class MyExtensionStyleBundleContributor : BundleContributor } ```` -添加bundle贡献者时,其依赖关系将 **自动并递归** 添加. **依赖顺序** 通过阻止 **重复** 添加的依赖关系. 即使它们处于分离的束中,也会阻止重复. ABP在页面中组织所有bundle并消除重复. +添加bundle贡献者时,其依赖关系将 **自动并递归** 添加. **依赖顺序** 通过阻止 **重复** 添加的依赖关系. 即使它们处于分离的bundle中,也会阻止重复. ABP在页面中组织所有bundle并消除重复. -创建贡献者和定义依赖关系是一种跨不同模块组织包创建的方法. +创建贡献者和定义依赖关系是一种跨不同模块组织bundle创建的方法. + + +#### 贡献者扩展 + +在某些高级应用场景中, 当用到一个bundle贡献者时,你可能想做一些额外的配置. 贡献者扩展可以和被扩展的贡献者无缝衔接. + +下面的示例为 prism.js 脚本库添加一些样式: + +````csharp +public class MyPrismjsStyleExtension : BundleContributor +{ + public override void ConfigureBundle(BundleConfigurationContext context) + { + context.Files.AddIfNotContains("/libs/prismjs/plugins/toolbar/prism-toolbar.css"); + } +} +```` + +然后你可以配置 `BundleContributorOptions` 去扩展已存在的 `PrismjsStyleBundleContributor`. + +````csharp +Configure(options => +{ + options + .Extensions() + .Add(); +}); +```` + +任何时候当 `PrismjsStyleBundleContributor` 被添加到bundle中时, `MyPrismjsStyleExtension` 也会被自动添加. #### 访问 IServiceProvider @@ -239,7 +269,7 @@ public class MyExtensionStyleBundleContributor : BundleContributor 将特定的NPM包资源(js,css文件)添加到包中对于该包非常简单. 例如, 你总是为bootstrap NPM包添加`bootstrap.css`文件. -所有[标准NPM包](Client-Side-Package-Management.md)都有内置的贡献者. 例如,如果你的贡献者依赖于引导程序,你可以声明它,而不是自己添加bootstrap.css. +所有[标准NPM包](Client-Side-Package-Management.md)都有内置的贡献者. 例如,如果你的贡献者依赖于bootstrap,你可以声明它,而不是自己添加bootstrap.css. ````C# [DependsOn(typeof(BootstrapStyleContributor))] //Define the bootstrap style dependency @@ -261,7 +291,7 @@ public class MyExtensionStyleBundleContributor : BundleContributor > 默认情况下已在启动模板安装此软件包. 大多数情况下,你不需要手动安装它. 标准包贡献者在`Volo.Abp.AspNetCore.Mvc.UI.Packages` NuGet包中定义. -安装到你的项目中: +将它安装到你的项目中: ```` install-package Volo.Abp.AspNetCore.Mvc.UI.Packages @@ -283,9 +313,9 @@ namespace MyCompany.MyProject } ```` -#### Bundle Inheritance +#### Bundle 继承 -在某些特定情况下, 可能需要从其他bundle创建一个 **新** bundle **继承**, 从bundle继承(递归)继承该bundle的所有文件/贡献者. 然后派生的bundle可以添加或修改文件/贡献者**而无需修改**原始包. +在某些特定情况下, 可能需要从其他bundle创建一个 **新** bundle **继承**, 从bundle继承(递归)会继承该bundle的所有文件/贡献者. 然后派生的bundle可以添加或修改文件/贡献者**而无需修改**原始bundle. 例如: ````c# From cb182aada7a7d1c18d0e2094101c288f97f83065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=B6=9B?= Date: Fri, 12 Apr 2019 11:36:05 +0800 Subject: [PATCH 04/13] Fixed typo in doc files --- docs/en/AspNetCore/Auto-API-Controllers.md | 4 ++-- docs/en/AspNetCore/Bundling-Minification.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/en/AspNetCore/Auto-API-Controllers.md b/docs/en/AspNetCore/Auto-API-Controllers.md index 48567b6919..db7fb63642 100644 --- a/docs/en/AspNetCore/Auto-API-Controllers.md +++ b/docs/en/AspNetCore/Auto-API-Controllers.md @@ -80,7 +80,7 @@ Then the route for getting a book will be '**/api/volosoft/book-store/book/{id}* * Removing '**Async**' postfix. If the method name is 'GetPhonesAsync' then it becomes 'GetPhones'. * Removing **HTTP method prefix**. 'GetList', 'GetAll', 'Get', 'Put', 'Update', 'Delete', 'Remove', 'Create', 'Add', 'Insert', 'Post' and 'Patch' prefixes are removed based on the selected HTTP method. So, 'GetPhones' becomes 'Phones' since 'Get' prefix is a duplicate for a GET request. * Converting the result to **camelCase**. - * If the resulting action name is **empty** then it's not added to the route. If it's not empty, it's added to the route (like '/phones'). For 'GetAllAsync' method name it will be empty, for 'GetPhonesAsync' method name is will be 'phones'. + * If the resulting action name is **empty** then it's not added to the route. If it's not empty, it's added to the route (like '/phones'). For 'GetAllAsync' method name it will be empty, for 'GetPhonesAsync' method name it will be 'phones'. * Normalization can be customized by setting the `UrlActionNameNormalizer` option. It's an action delegate that is called for every method. * If there is another parameter with 'Id' postfix, then it's also added to the route as the final route segment (like '/phoneId'). @@ -135,4 +135,4 @@ public class PersonAppService : ApplicationService } ```` -Disabled `IsMetadataEnabled` which hides this service from API explorer and it will not be discoverable. However, it still can be usable for the clients know the exact API path/route. \ No newline at end of file +Disabled `IsMetadataEnabled` which hides this service from API explorer and it will not be discoverable. However, it still can be usable for the clients know the exact API path/route. diff --git a/docs/en/AspNetCore/Bundling-Minification.md b/docs/en/AspNetCore/Bundling-Minification.md index 7170690ef3..220562935d 100644 --- a/docs/en/AspNetCore/Bundling-Minification.md +++ b/docs/en/AspNetCore/Bundling-Minification.md @@ -194,7 +194,7 @@ services.Configure(options => options .ScriptBundles .Configure("MyGlobalBundle", bundle => { - bundle.AddContributors(typeof(MyExtensionStyleBundleContributor)); + bundle.AddContributors(typeof(MyExtensionGlobalStyleContributor)); }); }); ```` @@ -279,9 +279,9 @@ public class MyExtensionStyleBundleContributor : BundleContributor Using the built-in contributors for standard packages; -* Prevents you typing **invalid the resource paths**. +* Prevents you typing **the invalid resource paths**. * Prevents changing your contributor if the resource **path changes** (the dependant contributor will handle it). -* Prevents multiple modules adding the **duplicate the files**. +* Prevents multiple modules adding the **duplicate files**. * Manages **dependencies recursively** (adds dependencies of dependencies, if necessary). #### Volo.Abp.AspNetCore.Mvc.UI.Packages Package From 3d57eb11eff6738ddbaf343da897696d63b835ed Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 12 Apr 2019 08:37:28 +0300 Subject: [PATCH 05/13] Update AbpSelectTagHelperService.cs --- .../TagHelpers/Form/AbpSelectTagHelperService.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs index 5a095d561c..cd3294d66f 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs @@ -124,8 +124,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form return GetLabelAsHtmlUsingTagHelper(context, output) + GetRequiredSymbol(context, output); } - - + protected virtual string GetRequiredSymbol(TagHelperContext context, TagHelperOutput output) { if (!TagHelper.DisplayRequiredSymbol) From 1743e426f4fa4f0c94706cc1e209d4d2c9012206 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 12 Apr 2019 09:10:44 +0300 Subject: [PATCH 06/13] Permission modal: moved css and js files --- .../Pages/Identity/Roles/Index.cshtml | 5 ++++ .../Pages/Identity/Users/Index.cshtml | 5 ++++ .../PermissionManagementModal.cshtml | 24 ------------------- .../permission-management-modal.css | 12 ++++++++++ .../permission-management-modal.js | 9 +++++++ 5 files changed, 31 insertions(+), 24 deletions(-) create mode 100644 modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.css diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/Index.cshtml b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/Index.cshtml index 1979c87bb2..d2758f05d4 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/Index.cshtml +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/Index.cshtml @@ -12,6 +12,11 @@ PageLayout.Content.BreadCrumb.Add(L["Menu:IdentityManagement"].Value); PageLayout.Content.MenuItemName = IdentityMenuNames.Roles; } +@section styles { + + + +} @section scripts { diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml index bcef02cc72..23f7747ac8 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml @@ -15,6 +15,11 @@ PageLayout.Content.BreadCrumb.Add(L["Menu:IdentityManagement"].Value); PageLayout.Content.MenuItemName = IdentityMenuNames.Users; } +@section styles { + + + +} @section scripts { diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml index b78bb499d3..e95e56abe9 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml @@ -9,30 +9,6 @@ Layout = null; } -@*TO DO : Following styles and scripts will move*@ - -
diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.css b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.css new file mode 100644 index 0000000000..d1f8731614 --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.css @@ -0,0 +1,12 @@ +.custom-scroll-container > .col-4 { + overflow: hidden; + overflow-y: auto; + max-height: 499px; + display: block; + position: relative; + z-index: 123; +} + +.custom-scroll-content { + max-height: 440px; +} diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js index f32b00720e..cde7903a2e 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js @@ -49,6 +49,15 @@ }); }); }); + + $(function () { + $(".custom-scroll-content").mCustomScrollbar({ + theme: "minimal-dark" + }); + $(".custom-scroll-container > .col-4").mCustomScrollbar({ + theme: "minimal-dark" + }); + }); }; }; })(jQuery); \ No newline at end of file From c6af83d0703e2a37ee18e987fadad5605c573d04 Mon Sep 17 00:00:00 2001 From: Alper Ebicoglu Date: Fri, 12 Apr 2019 10:43:35 +0300 Subject: [PATCH 07/13] Added logo --- .../docs/app/VoloDocs.Web/Assets/Images/Logo.png | Bin 3149 -> 0 bytes .../docs/app/VoloDocs.Web/VoloDocs.Web.csproj | 5 ++++- modules/docs/app/VoloDocs.Web/appsettings.json | 2 +- .../VoloDocs.Web/wwwroot/assets/images/Logo.png | Bin 0 -> 4515 bytes 4 files changed, 5 insertions(+), 2 deletions(-) delete mode 100644 modules/docs/app/VoloDocs.Web/Assets/Images/Logo.png create mode 100644 modules/docs/app/VoloDocs.Web/wwwroot/assets/images/Logo.png diff --git a/modules/docs/app/VoloDocs.Web/Assets/Images/Logo.png b/modules/docs/app/VoloDocs.Web/Assets/Images/Logo.png deleted file mode 100644 index d22a97e34baada9c30929e44ef052a637cb8c9a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3149 zcmeHJ_ct317Y<(9s`1enrL?w~)z+v{jRZlp#3(f?rB-XSDB3DTf<%qjv-YS_F=97} zplZ~pCbrmWH1_s+|BCOI@1Aq#dCqyxx%b?2Z-mi9T~=m3W&i-dst1F@0RXyxW4ntC z=XQ{_$LrkDdBJtH0Oftxmd}%aoWO=)000+#`53_n05AZI9++we1_lNN1%3SZF*rCl zBqSs>G!%(MqEM)?u(0s(@Q8>AG#ZV;U?L+UKYjWX6%`d79UT)B6B`?g#bV>);^O1u z6A}^<6BCn?l9H2?Q&Lh=Q&ZE@(lRnKGBYzjfBu}6m6e^Hos*N3o12@LmzSTPUrA+l9H0r($ccBvhwosuV24bR8-(_xXQ}Ps;a8$>gt-B8ay6fTU%RK zS65$O-_X#|*x1ys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v=QZdsAHPhI96Gk@M}IpJP^gGMsTed?ZUdUmKJ52 z&7z&%8aRiN*V6Agnx*epZb(mls4n7*Qwii7NO0M0jM@)3jJvQR7W6i}{Ex6%&JD-J zC(O}bOXMyY^r<5mBI2GETDY-^JU6P-J($C{^}HKHxJW%o)0yQmQ!%}}xYyhvOh{zI zJ&=BFqI2>dRKE4~^P<Y9m}r$nrn5$Nj}uiwpYq)X^bS77#hdf~!+W z@%5lbq@kFCqhie+3|%>-PbUDR^+LK-p$zW55+qc%L*F%D_n6sbVBSB>PKs~twZzpI zFK;(O=0hMYE`D3xQ^soMUY-zUkM`?RY4M@lpi%d%NE6fb;Gxx8|49MGlXx7z68Sn0 zg2gV{&&juFPSjhrwcU7zex-kfqdmS&`sp|kqg-tb)`6i%QO#~V*R%dnZ+QD3WG8*q zvYJM?7uN&6FVl~C);xyG3X1_sdnq_;Wv`^EEADwRF!~?}A zB#s;@s=`BQ%$s|UdFMP7Y2T-Oa$k*PI|eeqcY7;$K0c?>onPYNZ1XLA^|8QPrh_yt zMK;x8*QweR0`ga9eQ)LT8;fu#Xj55 - + + + + PreserveNewest diff --git a/modules/docs/app/VoloDocs.Web/appsettings.json b/modules/docs/app/VoloDocs.Web/appsettings.json index e328aa93f4..e893a26c7c 100644 --- a/modules/docs/app/VoloDocs.Web/appsettings.json +++ b/modules/docs/app/VoloDocs.Web/appsettings.json @@ -1,5 +1,5 @@ { "ConnectionString": "Server=localhost;Database=VoloDocs;Trusted_Connection=True;MultipleActiveResultSets=true", "Title": "Volo Documents", - "LogoUrl": "/Assets/Images/Logo.png" + "LogoUrl": "/assets/images/Logo.png" } \ No newline at end of file diff --git a/modules/docs/app/VoloDocs.Web/wwwroot/assets/images/Logo.png b/modules/docs/app/VoloDocs.Web/wwwroot/assets/images/Logo.png new file mode 100644 index 0000000000000000000000000000000000000000..30a85a0ca09225fc09700142e6d1fba38756827a GIT binary patch literal 4515 zcmbVQ`9Bj5{8lNsLyjD|OLG;PV~&vf&N*l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Xc@-;GUmEf96&Kc+es54ucLI`WIp+2thiJ?u0Gkw~b|+oPXF2#tcijB+!)WS*Y!_EPqy@ah%G)ECTw;6m&f#dDpQ+dkvMy;5ErwyA%#9B65dC*dRt=utOf^t>-2}QK z+^6rZ01_DPZ2qhG^jC-B0kqm63UYwvL0W>UwY>k@zJjY}RRtTz1uUa1!=jc84YDsJ zJ#0U?9^>9vWt@mkk{r|b@MQR=IYhJs8w_MHZu+rXC=HVR{=1FBj?HdU-6fz`7>Nry zYGTU7e^I3Vp&iRjrJVUvI3Yc(l^k;Py(t<{M+ELuNRHcl&rP2bbbneLjOiMhx v1q5|C0Xi?8aDt1? Date: Fri, 12 Apr 2019 11:30:20 +0300 Subject: [PATCH 08/13] typo fixed in volodocs --- docs/en/Apps/VoloDocs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/Apps/VoloDocs.md b/docs/en/Apps/VoloDocs.md index 25fb0482c7..d2192a7a7c 100644 --- a/docs/en/Apps/VoloDocs.md +++ b/docs/en/Apps/VoloDocs.md @@ -9,7 +9,7 @@ VoloDocs is a cross-platform web application that allows you to easily create be - Serves documents from your GitHub repository. - Supports Markdown / HTML document formatting. - Supports versioning (integrated to GitHub releases). -- Support multiple projects. +- Supports multiple projects. - Allows users to edit a document on GitHub. - Cross-platform; deployable to Windows / Linux / macOS. From 9a6e207da3d819c153d661b11f8c5102b4623281 Mon Sep 17 00:00:00 2001 From: Alper Ebicoglu Date: Fri, 12 Apr 2019 11:31:35 +0300 Subject: [PATCH 09/13] Update README.md --- modules/docs/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/docs/README.md b/modules/docs/README.md index 993e009110..f43c4e3edf 100644 --- a/modules/docs/README.md +++ b/modules/docs/README.md @@ -1,4 +1,4 @@ -# docs module +# Docs Module This module is used to create technical documentation web sites. [abp.io](https://abp.io) web site uses this module for its documentation. ### Screenshot @@ -10,4 +10,4 @@ This module is used to create technical documentation web sites. [abp.io](https: * Can read documents from a Github repository. * Supports Markdown document formatting. * Supports versioning (integrated to Github releases). -* Support multiple projects. \ No newline at end of file +* Support multiple projects. From d776a93c9b3113b205d57666a82a914d27843d82 Mon Sep 17 00:00:00 2001 From: Alper Ebicoglu Date: Fri, 12 Apr 2019 11:31:51 +0300 Subject: [PATCH 10/13] typo fixed on readme --- modules/docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/docs/README.md b/modules/docs/README.md index f43c4e3edf..c9c45c9f71 100644 --- a/modules/docs/README.md +++ b/modules/docs/README.md @@ -10,4 +10,4 @@ This module is used to create technical documentation web sites. [abp.io](https: * Can read documents from a Github repository. * Supports Markdown document formatting. * Supports versioning (integrated to Github releases). -* Support multiple projects. +* Supports multiple projects. From 8b9141f2e6ff69151697b9eebe37785c68673de9 Mon Sep 17 00:00:00 2001 From: Alper Ebicoglu Date: Fri, 12 Apr 2019 11:32:26 +0300 Subject: [PATCH 11/13] Update README.md --- modules/docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/docs/README.md b/modules/docs/README.md index c9c45c9f71..ee4e33a785 100644 --- a/modules/docs/README.md +++ b/modules/docs/README.md @@ -7,7 +7,7 @@ This module is used to create technical documentation web sites. [abp.io](https: ### Main Features -* Can read documents from a Github repository. +* Retrieves documents from a Github repository. * Supports Markdown document formatting. * Supports versioning (integrated to Github releases). * Supports multiple projects. From 6f50c1a0114dfa44ad1087f11986a2885a418908 Mon Sep 17 00:00:00 2001 From: Alper Ebicoglu Date: Fri, 12 Apr 2019 11:49:02 +0300 Subject: [PATCH 12/13] download link will be ready soon --- docs/en/Apps/VoloDocs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/Apps/VoloDocs.md b/docs/en/Apps/VoloDocs.md index d2192a7a7c..936f7f10d4 100644 --- a/docs/en/Apps/VoloDocs.md +++ b/docs/en/Apps/VoloDocs.md @@ -23,7 +23,7 @@ https://github.com/abpframework/abp/tree/master/modules/docs You can download the VoloDocs release from the following link: -http://apps.abp.io/VoloDocs/VoloDocs.zip +http://apps.abp.io/VoloDocs/VoloDocs.zip *(will be ready soon...)* ## Folder Structure From 2be65dd72009a436725ca26a8c044be360f59125 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 12 Apr 2019 14:26:03 +0300 Subject: [PATCH 13/13] Select all / deselect all on the permission moda Resolved https://github.com/abpframework/abp/issues/981 --- ...ermissionManagementWebAutoMapperProfile.cs | 3 +- .../Resources/AbpPermissionManagement/en.json | 4 +- .../Resources/AbpPermissionManagement/tr.json | 4 +- .../PermissionManagementModal.cshtml | 17 +- .../PermissionManagementModal.cshtml.cs | 13 ++ .../permission-management-modal.js | 147 +++++++++++++++++- 6 files changed, 177 insertions(+), 11 deletions(-) diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/AbpPermissionManagementWebAutoMapperProfile.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/AbpPermissionManagementWebAutoMapperProfile.cs index 631779b8ae..e707ba0676 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/AbpPermissionManagementWebAutoMapperProfile.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/AbpPermissionManagementWebAutoMapperProfile.cs @@ -1,4 +1,5 @@ using AutoMapper; +using Volo.Abp.AutoMapper; using Volo.Abp.PermissionManagement.Web.Pages.AbpPermissionManagement; namespace Volo.Abp.PermissionManagement.Web @@ -7,7 +8,7 @@ namespace Volo.Abp.PermissionManagement.Web { public AbpPermissionManagementWebAutoMapperProfile() { - CreateMap(); + CreateMap().Ignore(p=>p.IsAllPermissionsGranted); CreateMap() .ForMember(p => p.Depth, opts => opts.Ignore()); diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/en.json b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/en.json index bb6999c100..ba775f3ab0 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/en.json +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/en.json @@ -3,6 +3,8 @@ "texts": { "Permissions": "Permissions", "OnlyProviderPermissons": "Only this provider", - "All": "All" + "All": "All", + "SelectAllInAllTabs": "Grant all permissions", + "SelectAllInThisTab": "Select all" } } \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/tr.json b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/tr.json index 8da6bccd95..7f278ce6c1 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/tr.json +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/tr.json @@ -3,6 +3,8 @@ "texts": { "Permissions": "İzinler", "OnlyProviderPermissons": "Sadece bu sağlayıcı", - "All": "Hepsi" + "All": "Hepsi", + "SelectAllInAllTabs": "Tüm izinleri ver", + "SelectAllInThisTab": "Hepsini seç" } } \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml index e95e56abe9..dd2c73eb23 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml @@ -13,16 +13,23 @@ - - + +
+ + @for (var i = 0; i < Model.Groups.Count; i++) {

@Model.Groups[i].DisplayName

-
+
+ +
@for (var j = 0; j < Model.Groups[i].Permissions.Count; j++) { - + group-style="margin-left: @(Model.Groups[i].Permissions[j].Depth * 20)px"/> + }
diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml.cs index 0702c1e766..3bc688a6f1 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml.cs @@ -25,6 +25,10 @@ namespace Volo.Abp.PermissionManagement.Web.Pages.AbpPermissionManagement public string EntityDisplayName { get; set; } + public bool SelectAllInThisTab { get; set; } + + public bool SelectAllInAllTabs { get; set; } + private readonly IPermissionAppService _permissionAppService; public PermissionManagementModal(IPermissionAppService permissionAppService) @@ -49,6 +53,13 @@ namespace Volo.Abp.PermissionManagement.Web.Pages.AbpPermissionManagement { new FlatTreeDepthFinder().SetDepths(group.Permissions); } + + foreach (var group in Groups) + { + group.IsAllPermissionsGranted = group.Permissions.All(p => p.IsGranted); + } + + SelectAllInAllTabs = Groups.All(g => g.IsAllPermissionsGranted); } public async Task OnPostAsync() @@ -80,6 +91,8 @@ namespace Volo.Abp.PermissionManagement.Web.Pages.AbpPermissionManagement { public string Name { get; set; } + public bool IsAllPermissionsGranted { get; set; } + public string DisplayName { get; set; } public List Permissions { get; set; } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js index cde7903a2e..2972ccfffb 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js @@ -12,7 +12,7 @@ $tab.find('.custom-checkbox') .filter('[data-permission-name="' + parentName + '"]') .find('input[type="checkbox"]') - .each(function() { + .each(function () { var $parent = $(this); $parent.prop('checked', true); checkParents($tab, $parent); @@ -35,21 +35,159 @@ }); } - this.initDom = function($el) { + function handleUncheck($tab) { + var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); + + if ($checkBox.is(':checked')) { + if ($tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]').length > 1) { + $($checkBox).prop('indeterminate', true); + } + else { + $checkBox.prop('checked', false); + } + } + else if ($checkBox.is(':indeterminate')) { + var allUnchecked = true; + + $tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]').each(function () { + if ($(this).is(':checked') === true) { + allUnchecked = false; + } + }); + + if (allUnchecked) { + $($checkBox).prop('indeterminate', false); + $checkBox.prop('checked', false); + } + } + } + + function handleCheck($tab) { + var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); + + var allChecked = true; + + $tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]').each(function () { + if ($(this).is(':checked') === false) { + allChecked = false; + } + }); + + if (allChecked) { + $($checkBox).prop('indeterminate', false); + $checkBox.prop('checked', true); + } + else { + $($checkBox).prop('indeterminate', true); + } + } + + function initSelectAllInThisTab() { + var tabs = $('.tab-pane'); + for (var i = 0; i < tabs.length; i++) { + var $tab = $(tabs[i]); + var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); + + var allChecked = true; + var allUnChecked = true; + + $tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]').each(function () { + if ($(this).is(':checked') === true) { + allUnChecked = false; + } else { + allChecked = false; + } + }); + + if (allChecked) { + $($checkBox).prop('checked', true); + } + else if (allUnChecked) { + $($checkBox).prop('checked', false); + } + else { + $($checkBox).prop('indeterminate', true); + } + } + } + + function setSelectAllInAllTabs() { + var $checkBox = $('#SelectAllInAllTabs'); + + var anyIndeterminate = false; + var allChecked = true; + var allUnChecked = true; + + $('input[name="SelectAllInThisTab"]').each(function () { + if ($(this).is(':checked') === true) { + allUnChecked = false; + } else { + allChecked = false; + } + + if ($(this).is(':indeterminate') === true) { + anyIndeterminate = true; + } + }); + + if (anyIndeterminate) { + $($checkBox).prop('indeterminate', true); + return; + } else { + $($checkBox).prop('indeterminate', false); + } + + if (allChecked) { + $($checkBox).prop('checked', true); + } + else if (allUnChecked) { + $($checkBox).prop('checked', false); + } + else { + $($checkBox).prop('indeterminate', true); + } + } + + this.initDom = function ($el) { $el.find('.tab-pane').each(function () { var $tab = $(this); - $tab.find('input[type="checkbox"]').each(function () { + $tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]').each(function () { var $checkBox = $(this); $checkBox.change(function () { if ($checkBox.is(':checked')) { checkParents($tab, $checkBox); + handleCheck($tab); } else { uncheckChildren($tab, $checkBox); + handleUncheck($tab); } + setSelectAllInAllTabs(); }); }); }); + $('input[name="SelectAllInThisTab"]').change(function () { + var $checkBox = $(this); + var $tab = $('#' + $checkBox.attr('data-tab-id')); + if ($checkBox.is(':checked')) { + $tab.find('input[type="checkbox"]').prop('checked', true); + } else { + $tab.find('input[type="checkbox"]').prop('checked', false); + } + $($checkBox).prop('indeterminate', false); + setSelectAllInAllTabs(); + }); + + $('input[name="SelectAllInAllTabs"]').change(function () { + var $checkBox = $(this); + if ($checkBox.is(':checked')) { + $('.tab-pane input[type="checkbox"]').prop('checked', true); + } else { + $('.tab-pane input[type="checkbox"]').prop('checked', false); + } + $($checkBox).prop('indeterminate', false); + }); + $(function () { $(".custom-scroll-content").mCustomScrollbar({ theme: "minimal-dark" @@ -58,6 +196,9 @@ theme: "minimal-dark" }); }); + + initSelectAllInThisTab(); + setSelectAllInAllTabs(); }; }; })(jQuery); \ No newline at end of file