Hi Abp Team,
I am having an issue with the Features in moduled Blazor Web Application. I have a nuget package wich contains FeatureDefenitionProvider for Groups where defenition provider is located in Domain layer and class for const name in Domay.Shared layer, i am using this groups in my modules to control them by features, by default they are true. When i start programm at first every component that is using RequersFeature() are visible, but then disapears on complete program load. As I understand server can see and detect them thas why it visible but when blazor client loads it make them disapear and in abp/application-configuration/feature:values there is no my custom features. My groups are in database with default values and in UI Settings:FeaturesManagement: groups and children are also visible and working. For example i will show featuresdefenition provider for Saas: Domain
using Payhas.Billing.Platform.Localization;
using Payhas.Common.Features; // this is the nuget package
using Volo.Abp.Features;
using Volo.Abp.Localization;
namespace Payhas.Billing.Platform.Features;
public class SaasFeaturesDefinitionProvider : FeatureDefinitionProvider
{
public override void Define(IFeatureDefinitionContext context)
{
var mainModuleGroup = context.GetGroupOrNull(ModulesFeatures.Main);
mainModuleGroup?.AddFeature(SaasFeatures.Saas,
defaultValue: "true",
L(SaasFeatures.Saas));
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<PlatformResource>("Features:" + name);
}
}
DomainShared:
using Payhas.Common.Features;
using Volo.Abp.Reflection;
namespace Payhas.Billing.Platform.Features;
public class SaasFeatures
{
public const string Saas = ModulesFeatures.Main + ".Saas";
public static string[] GetAll()
{
return ReflectionHelper.GetPublicConstantsRecursively(typeof(SaasFeatures));
}
}
Blazor.Client: Navigation MenuContributor
//Saas
var saas = context.Menu.GetMenuItem(SaasHostMenus.GroupName);
saas.RequireFeatures(SaasFeatures.Saas);
Thanks for responding. )))
But with change of configuration, does the localhost also should change in browse as entry point. You still using localhost:44336, instead of test.company:44336? Or am I misunderstanding?
No, I ment url not port
{
"App": {
"SelfUrl": "http://test.company:44336"
},
"AuthServer": {
"Authority": "https://localhost:44376",
"ClientId": "Billing_Blazor",
"ResponseType": "code"
},
"RemoteServices": {
"Default": {
"BaseUrl": "https://localhost:44317"
},
"AbpAccountPublic": {
"BaseUrl": "https://localhost:44376"
}
}
}
Hi, yes it is working. It overriding it. Try to change localhost to random url. In api it works, but in blazor it does not work. Thanks.
Thanks, will wait for your responce.
Yes, thats right.
I have an Internet issue, so may i ask you to create project in AbpStudio for criterias like :
Then create images and in directory ./etc/docker-compose in appsettings.json file change url for blazor , then update docker-compose file with the same url where it used in relations like db-migrator, api, auth and set port of blazor service to 80
Yes, by mounting
volumes: - ./appsettings.json:/app/wwwroot/appsettings.json