Activities of "balessi75"

Hi @maliming,

You can reproduce 3 sorting issues using the https://github.com/balessi75/FM.Test project.

  1. Extended properties (mapped to EF) on ABP entities do not sort properly. You can see this by trying to sort on the "Host" column in the tenant management page
  2. Boolean properties for ABP entities do not sort properly. You can see this by sorting on the "Active" column under the User Management page.
  3. User Management's calculated "Roles" column does not have sorting enabled. If we replace/override the user management page and make the column sortable, we receive the following exception...

No property or field 'RoleNames' exists in type 'IdentityUser' (at index 24)

           UserManagementTableColumns
            .AddRange(new TableColumn[]
            {
                   ...
                        new TableColumn {
                            Title = L["Roles"],
                            Data = nameof(IdentityUserDto.RoleNames),
                            ValueConverter = (data) =>
                            {
                                var roleNames = (data as IdentityUserDto)?.RoleNames;
                                return roleNames == null ? string.Empty : string.Join(", ", roleNames);
                            },
                            Sortable = true
                        }
                    ...

Is sorting with paged result sets supported with this kind of calculated column?

Hi @maliming,

Just wanted to thank you for the quick turnaround on this issue. Your solution worked perfectly. Thank you, we appreciate the support!

ABP Commercial 7.0.1 / Blazor Server / EF / Non tiered

We noticed that, if we extend a dependent module's entity with a new column (for example, adding an 'EmployeeId' property to the IdentityUser entity), the new property is listed in the gird, but it's sort does not work properly. It seems to sort for the first page of results, but the sort does not work across multiple page results.

Additionally, we noticed that Boolean columns in the dependent modules do not sort correctly either. For example, in the user listing, if we sort by 'Active' we would expect the inactive users to be listed first - instead the sort seems somewhat random.

Hi @maliming,

I sent you a direct email with details for reproducing/troubleshooting...

hi

I will check and find a way.

Excellent, thank you @mailiming

Hi @maliming,

We are not having any success. We successfully replaced TenantManagment.razor. From there, it wasn't exactly clear to us on how to correctly add the tenant's domain to the action of ImpersonationForm, so for a proof of concept, we hardcoded the action URL as follows:

Once we did this and then attempted to impersonate the tenant, we are directed to the login screen for that tenant (instead of instantly being logged in as the tenant). When we then try to login to the tenant, we receive the following error:

Impersonating a user within a tenant works fine because everything is under the same sub domain URL.

We also tried overriding the OnPostAsync() method of ImpersonateTenantModel and changed return Redirect("~/"); to direct to the tenant's sub domain URL, and this seems to work, but the 'return to impersonator' link no longer appears and were not sure this is the correct way of implementing tenant impersonation with each tenant having it's own subdomain.

Thanks @maliming,

I will try the page overrides and let you know how that works.

In the meantime, can you explain this in more detail?

This requires sharing cookies between the subdomain and the main domain name.

I have limited experience with cookie management and am wondering if there are possible issues or workarounds to consider.

Our project structure looks like this (from Abp Blazor Server template)

ABP 7.0.1 Commercial / Blazor Server / EF / Separated IDS / Non-tiered

Hi, We extended the tenant entity to add a "Host" column which stores a tenant specific subdomain for each tenant (tenant1.domain.com) by following https://blog.antosubash.com/posts/abp-extend-tenant-with-custom-host

We then implemented the following tenant resolver:

	public override async Task ResolveAsync(ITenantResolveContext context)
	{
            var currentContextAccessor = context.ServiceProvider.GetRequiredService<IHttpContextAccessor>();
            var tenantRepository = context.ServiceProvider.GetRequiredService<IHostTenantRepository>();
      
            var host = currentContextAccessor?.HttpContext?.Request.Host.Host;

	    host = GetSubDomain(host);

            if (tenantRepository != null && !host.IsNullOrWhiteSpace())
            {
                var tenant = await tenantRepository.GetTenantByHost(host);
            
                if (tenant != null)
                {
                	context.TenantIdOrName = tenant.Name;
                }
            }
	}

Everything works as expected as we can login to each tenant with a tenant specific subdomain in the URL.

The problem we are finding though is that if we attempt to impersonate a tenant from the host, we are not redirected to the tenant's URL (tenant1.domain.com) instead we stay at at the host URL with no subdomain (domain.com).

Has this tenant impersonation issue ever come up with a basic tenant resolver based on subdomain? Any guidance, examples, or work arounds will be greatly appreciated as tenant impersonation and a custom tenant resolver are both requirements for us.

Hi @liangshiwei,

I was able to get the "SelfUrl" templated correctly based on our needs by overriding....

Volo.Abp.UI.Navigation.UrlsAppUrlProvider

Thank you, I'll close this issue.

Showing 1 to 10 of 108 entries
Made with ❤️ on ABP v8.3.0-preview Updated on July 05, 2024, 15:13