FIX: Show user filter hints when typing @ in search (#13799)

Will show the last 6 seen users as filtering suggestions when typing @ in quick search. (Previously the user suggestion required a character after the @.)

This also adds a default limit of 6 to the user search query, previously the backend was returning 20 results but a maximum of 6 results was being shown anyway.
This commit is contained in:
Penar Musaraj
2021-07-21 09:14:53 -04:00
committed by GitHub
parent 519528daa2
commit 2ce2c83bc9
7 changed files with 116 additions and 12 deletions

View File

@ -1079,6 +1079,8 @@ class UsersController < ApplicationController
}
options[:include_staged_users] = !!ActiveModel::Type::Boolean.new.cast(params[:include_staged_users])
options[:last_seen_users] = !!ActiveModel::Type::Boolean.new.cast(params[:last_seen_users])
options[:limit] = params[:limit].to_i if params[:limit].present?
options[:topic_id] = topic_id if topic_id
options[:category_id] = category_id if category_id