mirror of https://github.com/zulip/zulip.git
user popover: Fix choice field shows index of selected choice instead value.
Choice type of custom field, displays index of selected choice by user instead of value of choice. Fix this by parsing choice-type custom field to get field value before rendering user popover template. Fixes #10239
This commit is contained in:
parent
4aedc055ce
commit
f8d4578be1
|
@ -182,14 +182,17 @@ function show_user_profile(element, user) {
|
|||
page_params.custom_profile_fields.forEach(function (field) {
|
||||
var field_value = people.get_custom_profile_data(user.user_id, field.id);
|
||||
var field_type = settings_profile_fields.field_type_id_to_string(field.type);
|
||||
if (field_type === "Date") {
|
||||
profile_data[field.name] = moment(field_value).format(localFormat);
|
||||
} else if (field_type === "User") {
|
||||
if (field_value) {
|
||||
if (field_value) {
|
||||
if (field_type === "Date") {
|
||||
profile_data[field.name] = moment(field_value).format(localFormat);
|
||||
} else if (field_type === "User") {
|
||||
profile_data[field.name] = people.safe_full_names([field_value]);
|
||||
} else if (field_type === "Choice") {
|
||||
var field_choice_dict = JSON.parse(field.field_data);
|
||||
profile_data[field.name] = field_choice_dict[field_value].text;
|
||||
} else {
|
||||
profile_data[field.name] = field_value;
|
||||
}
|
||||
} else {
|
||||
profile_data[field.name] = field_value;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue