Rocket.chat: Customfield not displayed

Created on 31 Jul 2017  路  8Comments  路  Source: RocketChat/Rocket.Chat

Description:

customFields added via REST-API are not displayed to other users
It is related to issue #2304

Server Setup Information:

  • Version of Rocket.Chat Server: 0.57.2
  • Operating System: Ubuntu 16.0.4 LTS
  • Deployment Method(snap/docker/tar/etc): snap
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • Node Version:

Steps to Reproduce:

  1. add under Administrator the json-definition for a user defined field
  2. use REST-API create user and add customField
  3. set permission view-full-other-user-info to users and guests
  4. login in with a user join group channel or dialog

Expected behavior:

click on the user details in group or channel or dialog you will see customField

Actual behavior:

you art not seeing the customField

Relevant logs:

none at the moment

user settings bug

Most helpful comment

Use this syntax to display custom fields in profile
http://rocketchat/admin/Accounts

Custom Fields to Show in User Info >>
[{"Designation": "designation"}, {"Department": "department"}]

Registration >> Custom Fields
sample json format for add custom fields

{
   "designation": {"type": "text",
       "required": false,
       "minLength": 2,
       "maxLength": 100}, 
   "department": {"type": "text",
       "required": false,
       "minLength": 2,
       "maxLength": 100}
}

To update custom fields though Rest API
"data": {"name": name, "email": email, "customFields": {"designation": 'Artist', 'department': 'Modeling'}}}

All 8 comments

@marco-aa I'm working on this issue and will make a PR soon. I have two questions:

1 - All custom fields should be shown? By now, I've created an admin field (Accounts => Custom Fields to Show in User Info) that must be filled with a list of custom fields to show. I'd like to hear people's opinion about it.

2 - I'm not sure how useful would be to have the possibility to render a label just before the custom field value. Again, would love to hear from other people. For instance, if I fill the "Custom Fields to Show in User Info" field with '[{"Lota莽茫o":"#{secao-descricao} (#{secao-sigla})"}, "secao-telefone"]', the following content will be rendered in the user details (after all other stuff):

Lota莽茫o: Se莽茫o de Sistemas Corporativos de TIC (ssci.citic)
(19)3420-1021

Dear @goiaba thanks for your information,

at 1) I think its great / good if we can diside wich field will be shown - example we store some private infromation and a public finfromation in customFields - so we can deside wich we will show, It's more flexible in this way.
It came into my mind - how the custom field content will be view/rendered - example text vs exmail vs url. Url, Email should be click-able ;) This brings me to your point 2) i think i would be usefull.

Maybe we can handle this like custom-css in the admin settting. We define like you suggested labe,displayformat,field to show.

@MartinSchoeler should we add new-feature label ? not sure because of the discussion with @goiaba about how to implement his functions...

@marco-aa For simplicity, my idea was to follow the other fields behavior that are all rendered as text (emails, for instance).

@goiaba of course - maybe in a second step we can change this to some kind of formating ...
I ask myself - what will happen if inside the text we add html-tags this could be a kind of ugly work around for the first step ;)

Use this syntax to display custom fields in profile
http://rocketchat/admin/Accounts

Custom Fields to Show in User Info >>
[{"Designation": "designation"}, {"Department": "department"}]

Registration >> Custom Fields
sample json format for add custom fields

{
   "designation": {"type": "text",
       "required": false,
       "minLength": 2,
       "maxLength": 100}, 
   "department": {"type": "text",
       "required": false,
       "minLength": 2,
       "maxLength": 100}
}

To update custom fields though Rest API
"data": {"name": name, "email": email, "customFields": {"designation": 'Artist', 'department': 'Modeling'}}}

The issue is that this is not documented, especially the "Custom Fields to Show in User Info" part.
I've created a PR for it: https://github.com/RocketChat/docs/pull/1174

@vfxpandit It works!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

karlprieb picture karlprieb  路  3Comments

mddvul22 picture mddvul22  路  3Comments

Kiran-Rao picture Kiran-Rao  路  3Comments

mattlin picture mattlin  路  3Comments

brendanheywood picture brendanheywood  路  3Comments