Activities of "dshapiro"

I've resent it.

Already sent on Friday. Please confirm receipt or provide update on findings.

Hi, I sent you an email with our project attached as it would probably be easier. I believe everything we've done is standard and per ABP recommendations, but let me know.

Sorry, yes, "ExtraProperties". All projects were updated to 9.0.3 but our database does not have the column. We tried creating a migration, but it was empty. We also tried running the dbmigrator with a new database name (to generate a new database) and still did not get this new column.

To confirm, is your demo using the angular front end? I found a few things that seemed to imply that this worked for the MVC front end, but not for Angular.

I'd also like to clarify: is it possible to upgrade to ABP 9.x and use .NET Core 8? My team would like to stick to LTS versions of Core.

We've used the provided documentation in order to add a new property to the IdentityRole entity:

*Project.Domain.Shared/ProjectModuleExtensionConfigurator.cs*

public static class ProjectModuleExtensionConfigurator
{
    private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();

    public static void Configure()
    {
        OneTimeRunner.Run(() =>
        {
            ConfigureExistingProperties();
            ConfigureExtraProperties();
        });
    }

    private static void ConfigureExistingProperties()
    {
        
    }

    private static void ConfigureExtraProperties()
    {
        /* https://docs.abp.io/en/abp/latest/Module-Entity-Extensions */

        ObjectExtensionManager.Instance.Modules().ConfigureIdentity(identity =>
        {
            identity.ConfigureRole(role =>
            {
                role.AddOrUpdateProperty<bool>(
                    RoleConsts.IsGlobalPropertyName,
                    options =>
                    {
                        options.Attributes.Add(new RequiredAttribute());
                        options.Attributes.Add(new DefaultValueAttribute(false));
                    });
            });
        });
    }
}

What we've found is that this adds a new column to the Roles table in the angular front end, but does not add the field to the create/edit Role modals. Digging some more, we found the documentation for Dynamic Form Extensions, and configured this for Roles:

*/src/app/core/prop-contributors.ts*

import { eIdentityComponents, IdentityCreateFormPropContributors, IdentityEditFormPropContributors  } from '@volo/abp.ng.identity';
import { ePropType, FormProp, FormPropList } from '@abp/ng.components/extensible';
import { IdentityRoleDto } from '@volo/abp.ng.identity/proxy';

const isGlobalProp = new FormProp<IdentityRoleDto>({
    type: ePropType.Boolean,
    name: 'isGlobal',
    displayName: 'Is Global',
    validators: () => [],
});

export function isGlobalPropContributor(propList: FormPropList<IdentityRoleDto>) {
    propList.addByIndex(isGlobalProp, 1);
}

export const roleCreateFormPropContributors: IdentityCreateFormPropContributors = {
    // enum indicates the page to add contributors to
    [eIdentityComponents.Roles]: [
        isGlobalPropContributor,
        // You can add more contributors here
    ]
};

export const roleEditFormPropContributors: IdentityEditFormPropContributors = {
    // enum indicates the page to add contributors to
    [eIdentityComponents.Roles]: [
        isGlobalPropContributor,
        // You can add more contributors here
    ]
};

*/src/app/app-routing.module.ts*

// ...
{
    path: 'identity',
    loadChildren: () => import('@volo/abp.ng.identity').then(m => m.IdentityModule.forLazy({
      createFormPropContributors: roleCreateFormPropContributors,
      editFormPropContributors: roleEditFormPropContributors
    })),
  },
// ...

Despite this, no new field is appearing on the Create/Edit Role modals.

We also considered/tried to replace the RoleComponent using component replacement, but this would require us to completely rewrite the role component and it's associated behaviour (CRUD, claims, permissions, move users, etc), which we do not want to do.

How can we achieve our goal of managing this new property within the Roles modal?

  • ABP Framework version: v8.3.0
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace: N/A
  • Steps to reproduce the issue: N/A

Thanks, we've got this working now!

Sorry, I'm not quite following your meaning. I'm less concerned about the breadcrumbs and more so wondering if I could define a navigation item that behaves as a sort of "catch-all":

*app-routing.module.ts*

{
   path: '/module1/page1/**', // Something to denote a wildcard/catchall
   name: 'M1P1',
   // etc,
   isActive: (activatedRoute, itemConfig /* this node */) => isPathOrChild(itemConfig.path, activatedRoute); // Or something like this
}

And have this item selected for any of: /module1/page1 /module1/page1/list /module1/page1/details

We would like to avoid that as it's too granular for the menu and the detail page has a dynamic url (based on selection from the list page). Any options for this work as I described?

Ok, I think I understand. Our custom contributor and localizer will be responsible for caching the texts from the database and then we can do one of a few options: 1. We can create a custom resource class per lookup:

public class CompanyTypeResources {

}

...

Configure<AbpLocalizationOptions>(options => options.Resources.Add&lt;CompanyTypeResources>());

2. We can create a single resource class instead (ex: LookupResources) and have our localizer cache all text for this resource 3. Or we can just use the existing MyProjectResources that's created as part of the default template Does this sound right? I'd like to avoid creating a resource class per lookup, so I'm thinking option 2 or 3 would suit best. Any recommendations on best practices?

Showing 1 to 10 of 18 entries
Made with ❤️ on ABP v9.2.0-preview. Updated on January 20, 2025, 07:44