Reputation:
i'm using abp 4.4.2 with razor and i want to ignore the PhoneNumber,i was do this in my EntityExtensionMapping:
OneTimeRunner.Run(() =>
{
ObjectExtensionManager.Instance.MapEfCoreEntity<IdentityUser>(i => i.Ignore("PhoneNumber"));
});
after the adding Migration i have this generated code
public partial class IdentityUpdate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PhoneNumber",
table: "AbpUsers");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "PhoneNumber",
table: "AbpUsers",
type: "nvarchar(16)",
maxLength: 16,
nullable: true);
}
}
after the update database, the AbpUsers Table not have the PhoneNumber, However when i want to ignore the field into the user interface in the ModuleExtensionConfigurator,
ObjectExtensionManager.Instance.Modules()
.ConfigureIdentity(identity =>
{
identity.ConfigureUser(user =>
{
user.AddOrUpdateProperty<string>(
"PhoneNumber",
property =>
{
property.UI.OnTable.IsVisible = false;
property.UI.OnCreateForm.IsVisible = false;
property.UI.OnEditForm.IsVisible = false;
});
});
});
The /Identity/Users page and Create/Edit pop-up display again the PhoneNumber.
How can i do ?
Thank you in advance
Upvotes: 0
Views: 228
Reputation: 1585
You need to override the /Identity/Users/index.js file to ignore the PhoneNumber
column.
For this create a folder structure like Identity -> Users -> index.js under your Pages folder. Copy and paste the original content of the index.js (that defined in Identity module) file to your index.js file and remove the PhoneNumber
column related lines from it.
Check the UI Customization document for more info.
File Structure:
Your index.js file:
Upvotes: 1