-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NEW] Search users by fields defined by admin #7612
[NEW] Search users by fields defined by admin #7612
Conversation
These changes introduce the possibility of searching users by any field the Rocket.Chat's administrator defines in the new "Accounts -> Fields to consider in search" field.
name: termRegex | ||
}, | ||
{ | ||
'emails.address': termRegex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened with this field on search?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It must be added as default in the settings.js. Will fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rodrigok I've made a new commit which I think has a better implementation and fix the issue you commented above.
- Undone the changes to spotlight.js: The fields returned are only name, email and status as before (since we do not use other fields, there is no reason to return them, at least by now) - Retrieving from mongo the fields to search by in the Users.js model (instead of using the fields coming from spotlight.js) - Fixed the emails.address field that was removed by mistake in the prior commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look.
name: termRegex | ||
}, | ||
{ | ||
'emails.address': termRegex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rodrigok I've made a new commit which I think has a better implementation and fix the issue you commented above.
These changes introduce the possibility of searching users by any field the Rocket.Chat's administrator defines in the new "Accounts -> Fields to consider in search" field.
@RocketChat/core
Related to #7334 and #7210.
Example: