Is there an existing issue for this?
Description
While extending an existing entity from pre-built modules, (e.g. Role in IdentityManager), even when a proper DisplayName parameter is added with a valid LocalizationResource, the localization of the new property always defaults to the default LocalizationResource instead of the one specified in the DisplayName parameter.
Reproduction Steps
- Create a new module named
MyModule
- Add a new property to an existing entity from pre-built modules in and add a
DisplayName value as specified in the example:
In MyModule.Domain.Shared/MyModuleExtensionConfigurator.cs:
public static void ConfigureExtraProperties()
{
OneTimeRunner.Run(() =>
{
ObjectExtensionManager.Instance.Modules()
.ConfigureIdentity(identity =>
{
identity.ConfigureUser(user =>
{
user.AddOrUpdateProperty<string>( //property type: string
"SocialSecurityNumber", //property name
property =>
{
//localization
property.DisplayName =
LocalizableString.Create<MyProjectNameResource>(
"UserSocialSecurityNumberDisplayName"
);
}
);
});
});
});
}
- Add a localization string in
MyProject.Demo.Shared/Localization/MyProjectNameResource/en.json:
"UserSocialSecurityNumberDisplayName": "Social Security Number"
- Add this
MyModule to an application and run the application and launch Angular application.
- Navigate to
identity/roles path and try adding a new role or edit an existing role
Expected behavior
The label in the form should show "Social Security Number"
Actual behavior
The label shows "UserSocialSecurityNumberDisplayName"
Regression?
No
Known Workarounds
None
Version
8.3.4
User Interface
Angular
Database Provider
EF Core (Default)
Tiered or separate authentication server
None (Default)
Operation System
Windows (Default)
Other information
Issue also present in latest version.
I have identified the root cause of the issue and am raising a PR for the fix.
Is there an existing issue for this?
Description
While extending an existing entity from pre-built modules, (e.g. Role in IdentityManager), even when a proper
DisplayNameparameter is added with a valid LocalizationResource, the localization of the new property always defaults to the default LocalizationResource instead of the one specified in theDisplayNameparameter.Reproduction Steps
MyModuleDisplayNamevalue as specified in the example:In
MyModule.Domain.Shared/MyModuleExtensionConfigurator.cs:MyProject.Demo.Shared/Localization/MyProjectNameResource/en.json:MyModuleto an application and run the application and launch Angular application.identity/rolespath and try adding a new role or edit an existing roleExpected behavior
The label in the form should show "Social Security Number"
Actual behavior
The label shows "UserSocialSecurityNumberDisplayName"
Regression?
No
Known Workarounds
None
Version
8.3.4
User Interface
Angular
Database Provider
EF Core (Default)
Tiered or separate authentication server
None (Default)
Operation System
Windows (Default)
Other information
Issue also present in latest version.
I have identified the root cause of the issue and am raising a PR for the fix.