Skip to content
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

Merged

Conversation

goiaba
Copy link
Contributor

@goiaba goiaba commented Jul 31, 2017

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:

searchbycustomfields

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.
@engelgabriel engelgabriel modified the milestone: 0.59.0 Aug 23, 2017
name: termRegex
},
{
'emails.address': termRegex
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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
Copy link
Contributor Author

@goiaba goiaba left a 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
Copy link
Contributor Author

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.

@rodrigok rodrigok merged commit 64c5976 into RocketChat:develop Aug 23, 2017
@goiaba goiaba deleted the search-by-custom-fields branch December 6, 2017 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants