Open Closed

(Tenant/IdentityUser) Entity Extensions questions: Angular UI filter the list(datatable) with the extentions props #2353


User avatar
0
abpVAndy created
  • ABP Framework version: v5.0.1
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Want: Add TenantType/UserType for tenant/abpuser table. And want to use the TenantType/UserType to filter the list of tenants/users management page.

Please check the image for the "want".

Try solutions, I cannot pass the "tenanttype/usertype" to "public override Task<PagedResultDto<SaasTenantDto>> GetListAsync(GetTenantsInput input)" The reason is "GetTenantsInput", which I cannot pass the value of "tenanttype/usertype" to GetListAsync().

And I try to below: use the class "GetTenantsInput" property "Filter" to pass the tenanttype/usertype value to GetListAsync(GetTenantsInput input).

Works. It could pass the value to backend. But the search text will be failed, was "undefined"

tenantComponent.filters.filter + "||tenanttype:1"; will be "undefined||tenanttype:1"

Could you give me any other hint for this requirements.

Thx


4 Answer(s)
  • User Avatar
    0
    alper created
    Support Team Director

    for the backend you can check out this document https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Overriding-Services

  • User Avatar
    0
    bunyamin created

    If you could override the existing endpoint and add new a parameter, then you could do the following on the angular side:

    ...
       action: data => {
         const tenantComponent = data.getInjected(TenantsComponent);
         tenantComponent.filters['tenanttype'] = '1';
       }
    

    This way, it'll be independent of the search field.

  • User Avatar
    0
    abpVAndy created

    Thanks you guys.

    The class "GetTenantsInput" is not IHasExtraProperties. So without source code, I could not change any for this class "GetTenantsInput" and this method: public override Task&lt;PagedResultDto> GetListAsync(GetTenantsInput input)

    If GetTenantsInput is extensible, It would not be hard.

    So that is why I use input.Filter the search text as for type property to filter the list.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi, We will enhance this in next version.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38