@Bryan-EDV if you want to update only texts you can use the localization text files. @maliming provided you the localization keys. if you add these keys in your localization file (en.json) it'll be changed. also you can change the colors and other styles with simple CSS overrides. but if you want to radically change this bar, you need to replace this component as stated here.
Hi, Thanks for the reply, I explored doing css overrides but this component is not in the classes that i can overwrite, so i think i'm left with replacing the whole component.
Is this the correct replaceable component? I am on abp v8.3, eGdprConfigComponents.CookieConsent
does not work
`import { eGdprComponents } from '@volo/abp.ng.gdpr';
key : eGdprComponents.PersonalData `
I'm also under the impression that all source code will be included in the Enterprise version (which my company has purchased), however i didn't find any for this cookie consent bar. can you kindly point me to it? thank you.
Hi, i've done all that, but how do customize the UI?
How can i customize the GDPR cookie consent bar?
Posted this article on the topic: https://medium.com/@kaffeeebene/abp-in-depth-storing-key-tenant-data-in-the-host-database-while-keeping-the-rest-in-tenant-ca2aca0e4cd2
Thanks!
Creating a knowledge article on this topic and will post the link here in a bit
Hi maliming,
I've managed to resolve the issues and get the desired implementation. Give me a few hours to add the code snippets here for others to reference.
Thank you
Thank you for the insights. As I do not want to deviate from the framework design, I will implement the manual assignment of TenantIdCustom
upon entity creation (We forsee only a limited number of such entities)
In addition, I've implemented a DataFilter within MyApplcaitionDbContext.cs
protected bool IsMultiTenantInHostDb => DataFilter?.IsEnabled<IMultiTenantInHostDb>() ?? false;
protected override bool ShouldFilterEntity<TEntity>(IMutableEntityType entityType)
{
if (typeof(IMultiTenantInHostDb).IsAssignableFrom(typeof(TEntity)))
{
return true; // Apply filter for entities implementing IMultiTenantInHostDb
}
return base.ShouldFilterEntity<TEntity>(entityType);
}
protected override Expression<Func<TEntity, bool>> CreateFilterExpression<TEntity>(ModelBuilder modelBuilder)
{
var expression = base.CreateFilterExpression<TEntity>(modelBuilder);
if (typeof(IMultiTenantInHostDb).IsAssignableFrom(typeof(TEntity)))
{
// Get the current tenant ID
var currentTenantId = CurrentTenant.Id;
Console.WriteLine("currentTenantId:");
Console.WriteLine(currentTenantId);
// Create the filter expression
Expression<Func<TEntity, bool>> tenantFilter = e =>
!IsMultiTenantInHostDb ||
(EF.Property<Guid?>(e, "TenantIdCustom") == currentTenantId || EF.Property<Guid?>(e, "TenantIdCustom") == null);
expression = expression == null ? tenantFilter : QueryFilterExpressionHelper.CombineExpressions(expression, tenantFilter);
}
return expression;
}
as per your reference for ef core filter: https://abp.io/docs/latest/framework/infrastructure/data-filtering?_redirected=B8ABF606AA1BDF5C629883DF1061649A#entityframework-core
However the currentTenantId
coming as null, even when logged in as a tenant. Is there some issue with my usage of CurrentTenant.Id?
Something like this? (I not sure if ICurrentTenant
is available for dependency injection on a Entity level though)
Injecting into DomainService
should work right? But this is not desirable, as I would need to override the CreateAsync method for every DomainService for the entity. I would prefer if the Entity itself does the initialization, similar to classes implementing IMultiTenant