Open Closed

Angular show ExtraProperties on Registration and Profile pages #3466


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

I want my new User ExtraProperties to show up on my Angular Registration page and Profile page.

I have already added new User ExtraProperties and they show up in the admin UI for users following this guide. https://docs.abp.io/en/abp/latest/Module-Entity-Extensions

I'm not sure what I need to do for the Account pages.

  • Do I need to pull in the source code for the account module, I would prefer not to?
  • Do I need to replace components?

The documentation is not clear in this area as far as I can tell and this is a very basic use case in my opinion.


3 Answer(s)
  • User Avatar
    0
    mahmut.gundogdu created

    I have applied just like in the article. It works.

    I have created an app that uses EF core and angular with Abp Suite. I just added property on YourProjetNameModuleExtensionConfigurator.cs in DomainShared. Could you describe what the problem with your issue is?

      private static void ConfigureExtraProperties()
        {
          
                        ObjectExtensionManager.Instance.Modules()
                  .ConfigureIdentity(identity =>
                  {
                      identity.ConfigureUser(user =>
                      {
                          user.AddOrUpdateProperty<string>( //property type: string
                              "SocialSecurityNo", //property name
                              property =>
                              {
                                  //validation rules
                                  property.Attributes.Add(new RequiredAttribute());
                                  property.Attributes.Add(new StringLengthAttribute(64) {MinimumLength = 4});
    
                                  //...other configurations for this property
                              }
                          );
                      });
                  });
        }
    

  • User Avatar
    0
    clearlaunch created

    I'm not looking to update the Users UI, I'm Looking to update the user's profile page instead so the user can manage these new properties them selves.

    My issues are very similar to this thread https://support.abp.io/QA/Questions/1404/Customizing-PersonalSettings-Personal-Info-page-not-working

    My changes follow the thread above almost exactly. I have added a new tab that can display and update the extra properties, this part is done and working.

    **My problem is with the Personal Info tab that has not been modified or replaced. That tab wipes out any extra properties on the object when a save is performed. ** ex. Extra properties are not passed when someone updates their name.

    Some of the relevant bits aspnet-core\src\QRC.Application.Contracts\QRCDtoExtensions.cs ObjectExtensionManager.Instance .AddOrUpdateProperty<ProfileDto, UserProjectRole>("Project Role") .AddOrUpdateProperty<ProfileDto, string>("Zip Code") .AddOrUpdateProperty<ProfileDto, UserAgeRange>("Age Range") .AddOrUpdateProperty<UpdateProfileDto, UserProjectRole>("Project Role") .AddOrUpdateProperty<UpdateProfileDto, string>("Zip Code") .AddOrUpdateProperty<UpdateProfileDto, UserAgeRange>("Age Range");

  • User Avatar
    0
    mahmut.gundogdu created

    The profile page does not support external properties yet. If you want to add these settings on the personell Info section, You should change abp-personal-settings-form component like mehmet erim's answer https://support.abp.io/QA/Questions/1404/Customizing-PersonalSettings-Personal-Info-page-not-working#answer-9791e83b-44ef-a138-e812-39fcd3713128

    Then you should add external properties profileDTO. It is a little bit complicated. We have added a task for these lack of feature. The task will with Version 6.0 . When the task is completed. it will be easier. The release Date of version 6.0 is 06 september.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35