Activities of "uyarbtrlp"

Thanks, it works now.

The example is not the modal example. It is a whole page request. I know that I can use it for the page. I was trying to ask you about the modal that is created by abp.modalManager like the below:

This is where we open the modal by using action button on datatable.

This is the razor page where we define our modal and its items

This is the cshtml.cs file and OnGetAsync method that we have.

Underlined code has thrown the exception and we want to show that exception on the UI. This is the modal which been created by using abp.modalManager. There are such a functionality for the OnPostAsync method. Whenever I get the exception in OnPostAsync from the app service that I marked, I am able to see it as a error modal or something like that.

But for now, the modal cannot be created due to the exception and we want to show that exception to the user. It seems that showing the exception on the UI is not handled like in OnPostAsync. Do you have any suggestion about that issue when using the modal? We need such a showing mechanism to the user.

Yeah, I've tried to create the page alert for the modal. You've mentioned that in your documentation: Page Alert system was designed to be used in a regular full page request. It is not for AJAX/partial requests. The alerts are rendered in the page layout, so a full page refresh is needed. There is no full page request for our situation. I just hit the button for opening the modal, and I can't see the modal due to the exception in OnGetAsync method. Actually, you've touched the point that I wanted to ask. We have a problem in our system and we want to show the error message which is thrown by the backend side. If the user called the API for that functionality, he would see the error message on Swagger or on Postman. It is not same for the UI. I think it should be like that for the UI. Are there any functionality for that or (if there is not) will you integrate that functionality or do you have any suggestions about how to do it?

@Buckoge,

Thanks for the suggestion. By redirecting to the page, you create a new page for that. What I need is the alert message or something like that. It should be similar to the OnPostAsync method. When you get the exception in application service in OnPostAsync method, you see the error message on the UI. I need such a functionality for OnGetAsync, too.

  • ABP Framework version: v5.3.0
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hello,

We have a modal called FetchDocumentsModal which fetches the documents from a source. We open the modal by using the action button and 'open' method which you described into the documentation for the modal. In the OnGetAsync method inside the FetchDocumentsModal.cshtml.cs, we call some application services to realize the functionality. Whenever the application service throws the exception because there is an error regarding some parameters, the modal cannot be created and I couldn't see anything about the exception on the UI, but I can see the exception message which is returned from the backend-side on developer tools.

How can I show the exception on the MVC UI when the error occurs in OnGetAsync method while using the modal?

Thanks.

  • ABP Framework version: v5.1.1
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hello,

We want to publish the event to both Kafka and RabbitMQ at the same time. Are there any examples or suggestions about that?

We have a user which is a master user and responsible for creating tenants when the multitenancy is true. This user is the HOST user. We don't want to grant the tenant specific permissions to this user. If the user has these permissions, it can manage the tenant specific features.

That's why we don't mark the multitenancy side as MultiTenancySides.Both or we don't ignore the multitenancy. We want that our application is runnable whether the multitenancy is false or true.

When the multitenancy side is false, we want to grant tenant specific permissions (like creating a new permission group and mark as MultiTenancySides.Host like the comment above) to this master user. Since there isn't the multitenancy side the HOST user behavior will be changed and the HOST user will have these permissions. So, it can manage the features. We can say that we have two different approaches.

When I disable the multitenancy, I want to grant the permissions which are for the tenant. For example,

var odmsUserInterfacePermission = odmsPermissionGroup.AddPermission(
                name: OdmsPermissions.UI.UIPermission,
                displayName: L("Permission:UI"), // localization string
                multiTenancySide: MultiTenancySides.Tenant, // set multi-tenancy side
                isEnabled: true // by default is activated
            ).RequireFeatures(OdmsFeatures.ApplicationBaseFeature);

As you can see, this permission is only for the tenant. But in our case, we want to grant this permission while seeding the users like in the code below.

private async Task GrantPermissionToRole(string permissionName, string roleName)
        {

            await PermissionManager.SetAsync(permissionName, RolePermissionValueProvider.ProviderName, roleName, true);
        }

In the database, I can see the permission which are marked as MultiTenancySides.Both or MultiTenancySides.Host. After that, the exception is thrown:

The permission named 'Odms.UI' has multitenancy side 'Tenant' which is not compatible with the current multitenancy side 'Host'. See the inner exception for details.
---> System.ApplicationException: The permission named 'Odms.UI' has multitenancy side 'Tenant' which is not compatible with the current multitenancy side 'Host'
   at Volo.Abp.PermissionManagement.PermissionManager.SetAsync(String permissionName, String providerName, String providerKey, Boolean isGranted)
   at Siemens.Abp.Personas.PlatformIdentityDataSeeder.GrantPermissionToRole(String permissionName, String roleName, Nullable`1 tenantId)
   at Siemens.Abp.Personas.PlatformIdentityDataSeeder.SeedModelAdminAsync(String adminUserName, String adminEmail, String adminPassword, Nullable`1 tenantId)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Siemens.Abp.Personas.PlatformIdentityDataSeedContributor.SeedAsync(DataSeedContext context)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync()
   at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Volo.Abp.Data.DataSeeder.SeedAsync(DataSeedContext context)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync()
   at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Siemens.Abp.Personas.AbpPersonasModule.SeedAsync(IServiceScope scope, AbpPersonasModuleOptions options, Nullable`1 forcedTenantId)
   at Siemens.Abp.Personas.AbpPersonasModule.<>c__DisplayClass1_0.<<OnApplicationInitialization>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
   at Nito.AsyncEx.AsyncContext.<>c__DisplayClass15_0.<Run>b__0(Task t)
   at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
   at Nito.AsyncEx.AsyncContext.Run(Func`1 action)
   at Volo.Abp.Threading.AsyncHelper.RunSync(Func`1 action)
   at Siemens.Abp.Personas.AbpPersonasModule.OnApplicationInitialization(ApplicationInitializationContext context)
   at Volo.Abp.Modularity.AbpModule.OnApplicationInitializationAsync(ApplicationInitializationContext context)
   at Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor.InitializeAsync(ApplicationInitializationContext context, IAbpModule module)
   at Volo.Abp.Modularity.ModuleManager.InitializeModulesAsync(ApplicationInitializationContext context)
   --- End of inner exception stack trace ---
   at Volo.Abp.Modularity.ModuleManager.InitializeModulesAsync(ApplicationInitializationContext context)
   at Volo.Abp.AbpApplicationBase.InitializeModulesAsync()
   at Volo.Abp.AbpApplicationWithExternalServiceProvider.InitializeAsync(IServiceProvider serviceProvider)
   at Microsoft.AspNetCore.Builder.AbpApplicationBuilderExtensions.InitializeApplicationAsync(IApplicationBuilder app)
   at Siemens.Odms.Program.Main(String[] args) in C:\Users\z0048kcm\siemens.odms\host\Siemens.Odms.IdentityServer\Program.cs:line 40

We want to use the tenant permission when the multitenancy is false. It seems we need to define new permission group and put our logic when the multitenancy side is false because it is not handled. I think we need such a logic in the PermissionDefinitionProvider

if(multitenancy == true) {

var odmsUserInterfacePermission = odmsPermissionGroup.AddPermission(
                name: OdmsPermissions.UI.UIPermission,
                displayName: L("Permission:UI"), // localization string
                multiTenancySide: **MultiTenancySides.Tenant**, // set multi-tenancy side is true
                isEnabled: true // by default is activated
            ).RequireFeatures(OdmsFeatures.ApplicationBaseFeature);

}
else
{

var odmsUserInterfacePermission = odmsPermissionGroup.AddPermission(
                name: OdmsPermissions.UI.UIPermission,
                displayName: L("Permission:UI"), // localization string
                multiTenancySide: **MultiTenancySides.Host**, // set multi-tenancy side is false
                isEnabled: true // by default is activated
            ).RequireFeatures(OdmsFeatures.ApplicationBaseFeature);

}
  • ABP Framework version: v5.1.1
  • UI type: MVC
  • DB provider: EF Core
  • Module Template (MVC): yes
  • Separated Deployment & Databases Scenario (MVC): yes
  • Steps to reproduce the issue:"

Hello Abp,

We are currently using the module template with UI. We want to use the module template, when the multitenancy is true or false. Our module should be runnable according to the multitenancy option. We want to integrate the both way.

In PermissionDefinitionProvider, we set our permissions like in the documentation. We have the permissions that are only for the tenant and also for the both side. While we are running the module with multitenancy = false, tenant side permissions is not granted. But we want to use these permissions because we don't need the multitenancy. This is the case.

Here is my question: Does the Abp handle this situation or should we put our logic into the PermissionDefinitionProvider (like if the multitenancy is false, we define new permission groups which are only MultiTenancySides.Host. But in this way, we need to duplicate the permissions.)

Thanks.

I have the same issue in other versions such as 5.1, 5.0

Showing 31 to 40 of 67 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11