I think you can use the Global feature system.
See: https://docs.abp.io/en/abp/latest/Global-Features
For example, the CmsKit
module uses the global feature system. If the relevant feature of CmsKit
is not enabled, even the database tables for the relevant feature are not created.
See: https://github.com/abpframework/abp/blob/6514385e0897a4e3432db9d06ab61bb4fbae8734/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs#L27-L45
I can give the CmsKitDomainModule class as another example. Here, some configurations are made depending on whether the relevant feature is enabled or not.
See: https://github.com/abpframework/abp/blob/6514385e0897a4e3432db9d06ab61bb4fbae8734/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/CmsKitDomainModule.cs#L24-L83
With similar logic, you can depend on both modules, but their configuration depends on whether the feature is enabled or not.
Note: You must enable/disable the feature dynamically before your related startup module class is called, otherwise the feature will always appear disabled because the dependent modules are called first.
I understand, but it seems to me that doing something like the following is against the design of the Module system.
public class ModuleA : AbpModule
{
public override void ConfigureService(ServiceConfigurationContext context)
{
if (...)
{
context.Services.AddDependentModule(typeof(ModuleX));
}
else
{
context.Services.AddDependentModule(typeof(ModuleY));
}
}
}
Because, for example, if your A
module depends on module B
, then module B
is initialized before your A
module. Also, it basically executed the ConfigureServices
(or other public methods in AbpModule
) methods of all the modules by respecting the order of module dependencies.
However, you want to load module B
in the ConfigureService
of module A
.
Maybe I'm wrong, what are your views on this?
This may be because you did not activate the features of Cms-Kit
that you want to use.
All features are individually usable. If you disable a feature, it completely disappears from your application, even from the database tables, by the help of the Global Features system.
If that's the problem, after the installation process, open the GlobalFeatureConfigurator
class in the Domain.Shared
project of your solution and place the following code into the Configure
method to enable all the features in the CMS Kit module
GlobalFeatureManager.Instance.Modules.CmsKit(cmsKit =>
{
cmsKit.EnableAll();
});
See: https://docs.abp.io/en/abp/latest/Modules/Cms-Kit/Index
I guess you want to conditionally load a module in runtime. If so, ABP's Plug-In modules feature will be useful for you. See: https://docs.abp.io/en/abp/latest/PlugIn-Modules
Hello, thanks for the report.
I'm creating an internal issue on the topic.
Hi, you don't need to define RequiredFeatures
at permission group level. Because if all the permissions under it are not already accessible, the group will be invisible either.
Thanks for reporting the issue. I'm opening an internal issue on the subject.
Please let us know if you need a workaround solution.
We use the ABP framework on our websites, but we did not encounter such a problem. We need to examine it in detail. However, before starting the detailed examination, can you write the code below and send the rendered version using your browser's developer tool?
<abp-container>
<abp-row>
<abp-column>1 of 2</abp-column>
<abp-column>2 of 2</abp-column>
</abp-row>
<abp-row>
<abp-column>1 of 3</abp-column>
<abp-column>2 of 3</abp-column>
<abp-column>3 of 3</abp-column>
</abp-row>
</abp-container>
The rendered version should look like this:
<div class="container">
<div class="row">
<div class="col">1 of 2</div>
<div class="col">2 of 2</div>
</div>
<div class="row">
<div class="col">1 of 3</div>
<div class="col">2 of 3</div>
<div class="col">3 of 3</div>
</div>
</div>
If there is no problem with this, we may need to examine the CSS.
Can we confirm that Problem 2 and 3 are solved?
Any chance you could send your OrderService.Web/Pages/Orders/index.js
and OrderService.HttpApi.Client/wwwroot/client-proxies/OrderService-proxy.js
files?