I have now installed it with the Abp Studio (Volo.Abp.Gdpr.Web), but unfortunately it still does not work.
Yes, this is the correct package to add to your public web project. If the cookie consent still doesn't appear, it's possible that there's an entry in your localStorage with the value set to 'dismiss'. Please check your localStorage, clear it if possible, and try again to see if the consent banner is displayed.
Hi, thank you for your support!
The issue has been resolved successfully.
Great to hear that! Regards.
Hi, if you are using the GDPR module in your public web application, you can configure the AbpCookieConsentOptions:
Configure<AbpCookieConsentOptions>(options =>
{
IsEnabled = true;
CookiePolicyUrl = "/CookiePolicy";
PrivacyPolicyUrl = "/PrivacyPolicy";
Expiration = TimeSpan.FromDays(180);
});
For further info, you can refer to the documentation: https://abp.io/docs/latest/modules/gdpr
Hi, to be honest, this is not related to ABP, rather it's all about Hangfire. We provide Hangfire Background Jobs Manager yes, but this is a thin wrapper to Hangfire. So, you can rely on Hangfire's own documentation for this, we are just abstracting their implementation and integrate with our own Background Jobs System.
As far as I understand from the documentation of Hangfire, Hangfire doesn't guarantee strict job execution order within a queue, especially under concurrency, and it relies on the concrete storage implementation.
Here is a note about "processing order" of Hangfire Background Job Manager:
You can check Hangfire's documentation, but it seems there is no certain way for that.
Regards.
Hi . The error dialog still showing after editing code like you suggested.
<TelerikSwitch Value="@item.IsActive" OnLabel=" " OffLabel=" " Size="@ThemeConstants.Switch.Size.Small" OnChange="@(async () => await ToggleStatus(item))"/> </span> private async Task ToggleStatus(ChassisTypeDto item) { try { throw new UserFriendlyException("Test exception"); } catch (UserFriendlyException ex) { Logger.LogError(ex, "Handled UserFriendlyException"); await Notify.Error(string.IsNullOrEmpty(ex.Message) ? L["Messages:Error"] : ex.Message); } catch (Exception e) { Logger.LogError(e, "Error change status container type with id id :{SelectedChassisTypeId}", SelectedChassisTypeId); await Notify.Error(string.IsNullOrEmpty(e.Message) ? L["Messages:Error"] : e.Message); } finally { LoaderVisible = false; } }
Okay, it seems it's all about timing and you need to disable ABP's exception handling system on the UI side. To do that, you can add the following line to both your Blazor.Client and Blazor projects' module classes:
public override void ConfigureServices(ServiceConfigurationContext context)
{
//other configs...
context.Services.Replace(ServiceDescriptor.Transient(typeof(IUserExceptionInformer), typeof(NullUserExceptionInformer)));
}
This will replace the UserExceptionInformer service (https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ExceptionHandling/UserExceptionInformer.cs), which shows a message dialog by default. If you want you can create your own UserExceptionInformer implementation and then show Notify popup on the bottom-right for each exception.
After the replacement, it should work seamlessly:
Hi, actually, you should have a shared library for your localization files and the related configuration. So, for example, if you move your localization configurations and the related Localization/Resources/Test/*.json to *.Application.Contracts it should work.
In summary, you should have a shared library to make these configurations (because normally, Blazor.Client is a Blazor WASM application at its core), and then you can inject the IStringLocalizer<TestResource> and use it in your blazor application:
1-)
2-) Update the related *.csproj:
<ItemGroup>
<EmbeddedResource Include="Localization\Resources\Test\*.json" />
<Content Remove="Localization\Resources\Test\*.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="9.0.0" />
</ItemGroup>
<PropertyGroup>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
</PropertyGroup>
3-) Then, use it in your page:
But when I send this dto to create method of service, I get an error of this type: System.InvalidOperationException, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
Hi Murat, API is using the default .NET model binder, and something in your custom attribute is causing a validation metadata exception or reflection issue before the controller is even entered.
There are some checks that you can do:
PspResource is in a shared project. (It typically should be in *.Domain.Shared project)[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter,
AllowMultiple = false)]
public class PspRequiredAttribute : RequiredAttribute
{
public PspRequiredAttribute()
{
//ErrorMessageResourceName = nameof(PspResource.RequiredAttribute_ValidationError);
//ErrorMessageResourceType = typeof(PspResource);
}
}
When your API (the backend part) tries to reflect over the DTO, it's trying to fetch the error message string via the
ErrorMessageResourceTypeduring model binding, and probably this where you get error.
After you have tried these two suggestions, please let me know about the situation. If it's not related to reflection problem, then please share your PspResource class and give more details (such as where the resource class is defined, where you created the attribute, and any other context)
Regards.
Hi, thanks for the detailed explanation!
I've followed your suggestion and updated the
OnChangehandler to use anasynclambda as shown:However, I'm still seeing the default error dialog (from ABP) even though the exception is caught and I’m manually showing a toast notification.
And can i ask are there any supported way to disable this dialog globally or override the error handling mechanism or correctly to handle this?
Thanks again for your support!
<TelerikSwitch Value="@item.IsActive" OnLabel=" " OffLabel=" " Size="@ThemeConstants.Switch.Size.Small" OnChange="@(async () => await ToggleStatus(item))" /> private async Task ToggleStatus(ContainerTypeDto item) { try { var messageKey = item.IsActive ? "Delete:ConfirmInactiveMessage" : "Delete:ConfirmActiveMessage"; var message = L[messageKey, L["ContainerType"]]; if (await Dialogs.ConfirmAsync(message, L["Dialog:ConfirmAction"])) { LoaderVisible = true; SelectedContainerTypeId = item.Id.ToString(); await ContainerTypeService.ChangeStatusAsync(Guid.Parse(SelectedContainerTypeId)); var result = await ContainerTypeService.GetListAsync(new ContainerTypeRequestDto()); ContainerTypes = result.Items.ToList(); await Notify.Success(L["Messages:Success"]); } } catch (Exception e) { Logger.LogError(e, "Error changing container type status for ID: {SelectedContainerTypeId}", SelectedContainerTypeId); await Notify.Error(string.IsNullOrEmpty(e.Message) ? L["Messages:Error"] : e.Message); } finally { LoaderVisible = false; } } public async Task ChangeStatusAsync(Guid containerTypeId) { var containerType = await repository.GetAsync(containerTypeId); var hasInUse = await containerRepository .AnyAsync(d => d.ContainerTypeId == containerTypeId && !d.IsDeleted && d.Asset != null && d.Asset.IsActive); if (hasInUse) { throw new BusinessException(TmsSolutionDomainErrorCodes.ContainerTypeIsInUse); } containerType.IsActive = !containerType.IsActive; await repository.UpdateAsync(containerType); }
Hi, you should catch UserFriendlyException, because ABP shows dialog for this exception type. Can you try like in my suggested code?
Is the next patch release date obvious?
We haven't decided on the date, but it will probably be next week.