Open Closed

Use list view for the 'Login with this tenant' popup modal #6283


User avatar
0
Lexuan.Zhou created
  • ABP Framework version: v7.3.2
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Hi, Is there a way to swap to a list view in this popup modal? It seems like it is a auto complete component and it is very confused about what users are under a specific tenant


10 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    You can override the page if you want.

    /Pages/Saas/Host/Tenants/ImpersonateTenantModal.cshtml /Pages/Saas/Host/Tenants/ImpersonateTenantModal.cshtml.cs

  • User Avatar
    0
    Lexuan.Zhou created

    Hi, Is there a way I can take a look at the original source code? I can't find this component in my project.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Sorry,I just realized you are using the Blazor UI.

    You need to replace the TenantManagement.razor

    Is there a way I can take a look at the original source code

    You can download the source code using the ABP suite.

    Here is the document: https://docs.abp.io/en/abp/latest/UI/Blazor/Customization-Overriding-Components

  • User Avatar
    0
    Lexuan.Zhou created

    Okay, got it. Thanks!

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    :)

  • User Avatar
    0
    Lexuan.Zhou created

    Follow up with this question during my implemention, I am trying to modify the Clicked event for LogInWithThisTenant button, so that it can retreive a list of users under this tenant before it will open the pop up modal. However, I end up getting a. 'System.ObjectDisposedException: Cannot access a disposed object.' Exception. I might mistanderstand some of the lifecycle in Blazor.

    Any suggestion how i should tackle this?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Sorry I didn't find anything.

    Could you share the full error logs and more code detail? thanks.

  • User Avatar
    0
    Lexuan.Zhou created

    Honestly I didn't touch much of the rest of code, all I did was just replacing the block to a foreach loop in TenantManagment.razor. And then in order to retreive a list of identityuser under this tenantId, i am trying to grab from data.As<SaasTenantDto>().Id and pass it to a new end point that I implement: GetListByTenantIdAsync.

    As I debug, I can tell the list of users is trieved succesfully into this blazor component, but it just breaks when it trys to open the modal

  • User Avatar
    0
    Lexuan.Zhou created

    Full error log:

    Unhandled exception rendering component: Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it (or one of its parent scopes) has already been disposed. System.ObjectDisposedException: Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it (or one of its parent scopes) has already been disposed. at Autofac.Core.Lifetime.LifetimeScope.ThrowDisposedException() at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(ResolveRequest request) at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType) at Autofac.Extensions.DependencyInjection.AutofacServiceProvider.GetRequiredService(Type serviceType) at Volo.Abp.Application.Services.ApplicationService.<get_ObjectMapper>b__24_0(IServiceProvider provider) at Volo.Abp.DependencyInjection.CachedServiceProviderBase.<>c__DisplayClass11_0.<GetService>b__1() at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy1.CreateValue() at Volo.Abp.DependencyInjection.CachedServiceProviderBase.GetService(Type serviceType, Func2 factory) at Volo.Abp.DependencyInjection.CachedServiceProviderBase.GetService[T](Func2 factory) at Volo.Abp.DependencyInjection.AbpLazyServiceProvider.LazyGetService[T](Func2 factory) at Volo.Abp.Application.Services.ApplicationService.get_ObjectMapper() at Volo.Saas.Host.EditionAppService.GetListAsync(GetEditionsInput input) in /Users/lexuanzhou/Documents/git/AboveGoal/modules/Volo.Saas/src/Volo.Saas.Host.Application/Volo/Saas/Host/EditionAppService.cs:line 61 at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope) at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Volo.Saas.Host.Blazor.Pages.Saas.Host.TenantManagement.OnInitializedAsync() in /Users/lexuanzhou/Documents/git/AboveGoal/modules/Volo.Saas/src/Volo.Saas.Host.Blazor/Pages/Saas/Host/TenantManagement.razor.cs:line 109 at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) [02:52:41 ERR] Unhandled exception in circuit '7jfx65ZuRgGtEgyCmDFw32JOt5s6wbkF6N8EEbbb-oE'. System.ObjectDisposedException: Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it (or one of its parent scopes) has already been disposed. at Autofac.Core.Lifetime.LifetimeScope.ThrowDisposedException() at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(ResolveRequest request) at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType) at Autofac.Extensions.DependencyInjection.AutofacServiceProvider.GetRequiredService(Type serviceType) at Volo.Abp.Application.Services.ApplicationService.<get_ObjectMapper>b__24_0(IServiceProvider provider) at Volo.Abp.DependencyInjection.CachedServiceProviderBase.<>c__DisplayClass11_0.<GetService>b__1() at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy1.CreateValue() at Volo.Abp.DependencyInjection.CachedServiceProviderBase.GetService(Type serviceType, Func2 factory) at Volo.Abp.DependencyInjection.CachedServiceProviderBase.GetService[T](Func2 factory) at Volo.Abp.DependencyInjection.AbpLazyServiceProvider.LazyGetService[T](Func2 factory) at Volo.Abp.Application.Services.ApplicationService.get_ObjectMapper() at Volo.Saas.Host.EditionAppService.GetListAsync(GetEditionsInput input) in /Users/lexuanzhou/Documents/git/AboveGoal/modules/Volo.Saas/src/Volo.Saas.Host.Application/Volo/Saas/Host/EditionAppService.cs:line 61 at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope) at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Volo.Saas.Host.Blazor.Pages.Saas.Host.TenantManagement.OnInitializedAsync() in /Users/lexuanzhou/Documents/git/AboveGoal/modules/Volo.Saas/src/Volo.Saas.Host.Blazor/Pages/Saas/Host/TenantManagement.razor.cs:line 109 at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) [02:52:54 INF] Completed to save external localizations.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Weird, this is because the component is disposing.

    Can you share a test project? I will check it. thanks. shiwei.liang@volosoft.com

Made with ❤️ on ABP v9.1.0-preview. Updated on December 12, 2024, 07:15