diff --git a/modules/cms-kit/host/Volo.CmsKit.Host.Shared/FeatureConfigurer.cs b/modules/cms-kit/host/Volo.CmsKit.Host.Shared/FeatureConfigurer.cs index d600e99cd9..9046c60aca 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Host.Shared/FeatureConfigurer.cs +++ b/modules/cms-kit/host/Volo.CmsKit.Host.Shared/FeatureConfigurer.cs @@ -1,12 +1,18 @@ using Volo.Abp.GlobalFeatures; +using Volo.Abp.Threading; namespace Volo.CmsKit { public static class FeatureConfigurer { + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + public static void Configure() { - GlobalFeatureManager.Instance.Modules.CmsKit().EnableAll(); + OneTimeRunner.Run(() => + { + GlobalFeatureManager.Instance.Modules.CmsKit().EnableAll(); + }); } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/Abp/GlobalFeatures/GlobalFeatureManagerModuleConfiguratorCmsKitExtensions.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/Abp/GlobalFeatures/GlobalModuleFeaturesDictionaryCmsKitExtensions.cs similarity index 92% rename from modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/Abp/GlobalFeatures/GlobalFeatureManagerModuleConfiguratorCmsKitExtensions.cs rename to modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/Abp/GlobalFeatures/GlobalModuleFeaturesDictionaryCmsKitExtensions.cs index e73c91e8b2..72701d5e4d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/Abp/GlobalFeatures/GlobalFeatureManagerModuleConfiguratorCmsKitExtensions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/Abp/GlobalFeatures/GlobalModuleFeaturesDictionaryCmsKitExtensions.cs @@ -5,7 +5,7 @@ using Volo.CmsKit.GlobalFeatures; namespace Volo.Abp.GlobalFeatures { - public static class GlobalFeatureManagerModuleConfiguratorCmsKitExtensions + public static class GlobalModuleFeaturesDictionaryCmsKitExtensions { public static GlobalCmsKitFeatures CmsKit( [NotNull] this GlobalModuleFeaturesDictionary modules) diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/CmsKitDomainSharedModule.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/CmsKitDomainSharedModule.cs index f624f65957..925acdaf79 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/CmsKitDomainSharedModule.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/CmsKitDomainSharedModule.cs @@ -1,12 +1,10 @@ -using Volo.Abp.GlobalFeatures; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; using Volo.Abp.Localization; using Volo.CmsKit.Localization; using Volo.Abp.Localization.ExceptionHandling; using Volo.Abp.Validation; using Volo.Abp.Validation.Localization; using Volo.Abp.VirtualFileSystem; -using Volo.CmsKit.GlobalFeatures; namespace Volo.CmsKit { @@ -17,19 +15,6 @@ namespace Volo.CmsKit { public override void ConfigureServices(ServiceConfigurationContext context) { - GlobalFeatureManager.Instance.Modules.CmsKit().EnableAll(); - GlobalFeatureManager.Instance.Modules.CmsKit().DisableAll(); - GlobalFeatureManager.Instance.Modules.CmsKit().Reactions.Enable(); - GlobalFeatureManager.Instance.Modules.CmsKit().Reactions.Enable(); - GlobalFeatureManager.Instance.Modules.CmsKit(cmsKit => - { - cmsKit.Reactions.Disable(); - cmsKit.Comments.Enable(); - }); - - GlobalFeatureManager.Instance.IsEnabled("qweasd"); - GlobalFeatureManager.Instance.IsEnabled(); - Configure(options => { options.FileSets.AddEmbedded(); diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/GlobalFeatures/GlobalCmsKitFeatures.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/GlobalFeatures/GlobalCmsKitFeatures.cs index dcdef4e8c2..646a91ef4f 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/GlobalFeatures/GlobalCmsKitFeatures.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/GlobalFeatures/GlobalCmsKitFeatures.cs @@ -8,6 +8,7 @@ namespace Volo.CmsKit.GlobalFeatures public const string ModuleName = "CmsKit"; public ReactionsFeature Reactions => GetFeature(); + public CommentsFeature Comments => GetFeature(); public GlobalCmsKitFeatures([NotNull] GlobalFeatureManager featureManager) diff --git a/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitTestBaseModule.cs b/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitTestBaseModule.cs index a6da60876c..8e5049f55e 100644 --- a/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitTestBaseModule.cs +++ b/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitTestBaseModule.cs @@ -17,9 +17,14 @@ namespace Volo.CmsKit )] public class CmsKitTestBaseModule : AbpModule { + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + public override void ConfigureServices(ServiceConfigurationContext context) { - GlobalFeatureManager.Instance.Modules.CmsKit().EnableAll(); + OneTimeRunner.Run(() => + { + GlobalFeatureManager.Instance.Modules.CmsKit().EnableAll(); + }); context.Services.AddAlwaysAllowAuthorization(); }