It's in angular/src/assets/abp-web-resources/abp.notify.js.
The message
parameter already accepts HTML formatted string:
abp.notify.error('Some fields have <strong>errors.</strong><br/>Please check and try again.');
Oh, desktop notification.
It's in angular/src/app/shared/layout/notifications/UserNotificationHelper.ts.
ASP .NET Zero is using Push
and it's not possible to be HTML formatted as per Nickersoft/push.js#35:
According to the official docs, it seems that the body attribute is simply a string that does not resolve any HTML tags. Unfortunately, there is nothing Push itself can do to change this, as its just a robust shim wrapper around the native API calls.
IMultiTenantLocalizationSource
is not injected anywhere, so you can't replace its implementation that way.
MultiTenantLocalizationSource
is instantiated directly in EnableDbLocalization
in LanguageManagementConfig.cs#L40.
You can comment out the following line in your WebCoreModule
and instantiate your own implementation.
//Use database for language management
Configuration.Modules.Zero().LanguageManagement.EnableDbLocalization();
Duplicate of #8925
Hi Robin, it is injected and you could do that.
Issue on GitHub: aspnetzero/aspnet-zero-core#3247
I would recommend Option 1.2 below.
ILanguageManagementConfig
Seems LanguageManagementConfig has been initialized together with Configuration.Modules before everything else.
Good conjecture.
More accurately, ILanguageManagementConfig
is instantiated on the first call to Configuration.Modules.Zero()
.
Configuration.Modules.Zero()
is first called in YourProjectCoreModule.PreInitialize
.ReplaceService
only runs in AbpKernalModule.Initialize
, before other modules' Initialize
.Therefore, calling ReplaceService
for this in YourProjectWebCoreModule.PreInitialize
is too late.
ILanguageManagementConfig
is instantiatedYou can directly register CustomLanguageManagementConfig
as the default implementation before that first call.
IocManager.IocContainer.Register( // Add this
Component.For<ILanguageManagementConfig>() // Add this
.ImplementedBy<CustomLanguageManagementConfig>() // Add this
.IsDefault() // Add this
); // Add this
//Declare entity types // Existing code
Configuration.Modules.Zero().EntityTypes.Tenant = typeof(Tenant); // Existing code
ILanguageManagementConfig
is registeredYou can AddSingleton
to IServiceCollection
in your Web
project's ConfigureServices
.
services.AddSingleton<ILanguageManagementConfig, CustomLanguageManagementConfig>();
ILanguageManagementConfig
without replacingIs there any concern of calling customized EnableDbLocalization() in this way?
In general, it is not preferable since Configuration.Modules.Zero().LanguageManagement
would have the unexpected implementation if used elsewhere — but it's not used elsewhere.
Therefore, in this case, there is no concern.
Try (abp as any)
:
- abp.libs.sweetAlert.config.error.button = abp.localization.localize('Ok', 'AbpZeroTemplate');
+ (abp as any).libs.sweetAlert.config.error.button = abp.localization.localize('Ok', 'AbpZeroTemplate');
I think your use case of matching exact query parameters is generally not appropriate, but you can achieve it as follows.
app-navigation.service.ts:
- new AppMenuItem('Event_Pools', 'Pages.Main.Event.Management.EventPool', 'flaticon2-next', '/app/main/event/management/event-pool/list', ['/app/main/event/management/event-pool/person/list/{event-pool-id}']),
+ new AppMenuItem('Event_Pools', 'Pages.Main.Event.Management.EventPool', 'flaticon2-next', '/app/main/event/management/event-pool/list', ['/app/main/event/management/event-pool/person/list/{event-pool-id}'], [], null, {}),
new AppMenuItem('Event_Pools', 'Pages.Main.Event.Management.EventPool', 'flaticon2-next', '/app/main/event/management/event-pool/list', ['/app/main/event/management/event-pool/person/list/{event-pool-id}'], [], null, { eventType: 'Meeting' })
side-bar-menu.component.ts:
isMenuItemIsActive(item): boolean {
...
- let urlTree = this.router.parseUrl(this.currentRouteUrl.replace(/\/$/, ''));
+ let urlTree = this.router.parseUrl(this.router.url);
let urlString = '/' + urlTree.root.children.primary.segments.map(segment => segment.path).join('/');
let exactMatch = urlString === item.route.replace(/\/$/, '');
+ if (exactMatch & item.parameters) {
+ const itemParamsKeys = Object.keys(item.parameters);
+ exactMatch = itemParamsKeys.length === Object.keys(urlTree.queryParams).length && itemParamsKeys.every(key => item.parameters[key] === urlTree.queryParams[key]);
+ }
...
return exactMatch;
}
Change .GetAll().ToList()
to .GetAllList()
, or begin your own unit of work.
Reference: aspnetboilerplate/aspnetboilerplate#3946 (comment 430319419)