rename fields
Is it possible to rename the fields of the displayed tables?
Note: I would like to set special characters such as accents.
Installed libraries and their versions. "admin-bro": "^2.9.0", "admin-bro-expressjs": "^2.1.1", "admin-bro-typeorm": "^0.1.6-alpha.9",
Yes, you can do this via locale property in AdminBro options: https://adminbro.com/AdminBroOptions.html#locale
I have tried to change the field from the displayed table, referred: https://adminbro.com/AdminBroOptions.html#locale
Here, Items is the Resource name as well as a model name, and ownerid is the property.
It still remains same. Is there any alternate way to do that?
Any update on this issue?
I can't think of a reason why it wouldn't work for you, are you sure your the property name matches exactly what's in your model?
i want to name it differently than in the model
Yes, but if your model field is defined as such:
@Column(...)
public ownerId: number;
you should use ownerId in adminjs locale settings:
...,
resources: {
YourModel: {
properties: {
ownerId: 'Owner',
},
},
},
@dziraf Thank you,
Yes it worked for me:
But still I am not able to Rename my pages name.

locale: {
// language: 'en',
translations: {
resources: {
Reports: {
properties: {
userId: 'User'
}
},
I have done mine like this and no luck:
locale: {
translations: {
resources: {
Tolerable_Intake: {
properties: {
DOCUMENT_URL: 'Document URL',
TI_MODIFIEDBY: 'Modified by',
}
}
}
}
}
Do your properties have uppercased names? Could you share your model schema?
@dziraf Yes it's all uppercase.. I am using an old db.
const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
return sequelize.define('Tolerable_Intake', {
INTAKE_ID: {
autoIncrement: true,
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true
},
TI_MODIFIEDBY: {
type: DataTypes.INTEGER,
allowNull: true
},
DOCUMENT_URL: {
type: DataTypes.TEXT,
allowNull: true
}
}, {
sequelize,
tableName: 'Tolerable_Intake',
schema: 'dbo',
timestamps: false,
indexes: [
{
name: "PK__TBL_TOLE__BB5D29EA7A3FD38E",
unique: true,
fields: [
{ name: "INTAKE_ID" },
]
},
]
});
};
Still no luck for me...
No luck for me either. I can hide the field, but I am not able to rename it. eg: .... properties: { id: { isVisible: false, }, fPublisherID: {isVisible : false}, // works ....
however if I do: properties: { id: { isVisible: false, }, fPublisherID: "Published Status" // does not change the name.
@lumayara were you able to resolve this?
@dhammikab No luck for me. Can anyone else?
@lumayara did you check here: https://github.com/SoftwareBrothers/adminjs/issues/1169#issuecomment-1181831026 ? 😉