mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: add new hidden site setting to show full names in user card
adds a hidden site setting, "prioritize_full_names_in_ux", whose effect is to prefer full names in user-menu notifications Co-authored-by: Mark VanLandingham <markvanlan@gmail.com> Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
This commit is contained in:
@@ -57,8 +57,8 @@ class NotificationsController < ApplicationController
|
||||
|
||||
notifications =
|
||||
Notification.filter_inaccessible_topic_notifications(current_user.guardian, notifications)
|
||||
notifications =
|
||||
Notification.populate_acting_user(notifications) if SiteSetting.show_user_menu_avatars
|
||||
|
||||
notifications = Notification.populate_acting_user(notifications)
|
||||
|
||||
json = {
|
||||
notifications: serialize_data(notifications, NotificationSerializer),
|
||||
@@ -88,8 +88,8 @@ class NotificationsController < ApplicationController
|
||||
notifications = notifications.offset(offset).limit(limit)
|
||||
notifications =
|
||||
Notification.filter_inaccessible_topic_notifications(current_user.guardian, notifications)
|
||||
notifications =
|
||||
Notification.populate_acting_user(notifications) if SiteSetting.show_user_menu_avatars
|
||||
|
||||
notifications = Notification.populate_acting_user(notifications)
|
||||
render_json_dump(
|
||||
notifications: serialize_data(notifications, NotificationSerializer),
|
||||
total_rows_notifications: total_rows,
|
||||
|
||||
@@ -1927,9 +1927,7 @@ class UsersController < ApplicationController
|
||||
end
|
||||
|
||||
if reminder_notifications.present?
|
||||
if SiteSetting.show_user_menu_avatars
|
||||
Notification.populate_acting_user(reminder_notifications)
|
||||
end
|
||||
Notification.populate_acting_user(reminder_notifications)
|
||||
serialized_notifications =
|
||||
ActiveModel::ArraySerializer.new(
|
||||
reminder_notifications,
|
||||
@@ -2000,7 +1998,7 @@ class UsersController < ApplicationController
|
||||
end
|
||||
|
||||
if unread_notifications.present?
|
||||
Notification.populate_acting_user(unread_notifications) if SiteSetting.show_user_menu_avatars
|
||||
Notification.populate_acting_user(unread_notifications)
|
||||
serialized_unread_notifications =
|
||||
ActiveModel::ArraySerializer.new(
|
||||
unread_notifications,
|
||||
@@ -2013,7 +2011,7 @@ class UsersController < ApplicationController
|
||||
serialized_messages =
|
||||
serialize_data(messages_list, TopicListSerializer, scope: guardian, root: false)[:topics]
|
||||
serialized_users =
|
||||
if SiteSetting.show_user_menu_avatars
|
||||
if SiteSetting.show_user_menu_avatars || !SiteSetting.prioritize_username_in_ux
|
||||
users = messages_list.topics.map { |t| t.posters.last.user }.flatten.compact.uniq(&:id)
|
||||
serialize_data(users, BasicUserSerializer, scope: guardian, root: false)
|
||||
else
|
||||
@@ -2022,7 +2020,7 @@ class UsersController < ApplicationController
|
||||
end
|
||||
|
||||
if read_notifications.present?
|
||||
Notification.populate_acting_user(read_notifications) if SiteSetting.show_user_menu_avatars
|
||||
Notification.populate_acting_user(read_notifications)
|
||||
serialized_read_notifications =
|
||||
ActiveModel::ArraySerializer.new(
|
||||
read_notifications,
|
||||
|
||||
Reference in New Issue
Block a user